core: Error sending messages from Telegram bot

The problem

Some of the messages I send to Telegram using Telegram bot are missing in a random way. I was using notify service. Changed to telegram_bot.send_message service but it fails the same. I have updated to last core version with the same result.

What version of Home Assistant Core has the issue?

core-2024.7.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

telegram bot

Link to integration documentation on our website

https://www.home-assistant.io/integrations/telegram_bot

Diagnostics information

No response

Example YAML snippet

telegram_bot:
  - platform: polling
    api_key: !secret telegram_api_key
    allowed_chat_ids:
      - !secret telegram_chat_id_one
      - !secret telegram_chat_id_two

notify:
  - name: telegram_one
    platform: telegram
    chat_id: !secret telegram_chat_id_one
  - name: telegram_two
    platform: telegram                          
    chat_id: !secret telegram_chat_id_two

Anything in the logs that might be useful for us?

Registrador: homeassistant.components.telegram_bot
Fuente: components/telegram_bot/__init__.py:717
integración: Telegram bot (documentación, problemas)
Ocurrió por primera vez: 20:34:05 (2 ocurrencias)
Último inicio de sesión: 20:34:10

Error sending message: Timed out. Args: (Id_one, 'Subiendo la persiana izquierda de la terraza...'), kwargs: {'parse_mode': <ParseMode.MARKDOWN>, 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'read_timeout': 60, 'message_thread_id': None}
Error sending message: Timed out. Args: (Id_two, 'Subiendo la persiana izquierda de la terraza...'), kwargs: {'parse_mode': <ParseMode.MARKDOWN>, 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'read_timeout': None, 'message_thread_id': None}

Additional information

I’m using a script that send the same message to two different people with different chat_id according to the state of two helpers that enable the sending of the message. In one of the chats I’ve added ‘timeout: 60’. I think that when a message fails, is in both chats but I’m not sure about that.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 22 (1 by maintainers)

Most upvoted comments

Approximately 90% of my automations are in Node Red. Until now Telegram notifications were done by calling a Home Assistant script. Last Sunday, I changed these notifications to Node Red directly using nodes from the ‘node-red-contrib-telegrambot’ palette. Since that moment and after four days, I have not missed any Telegram notifications. I think this indicates that there is a problem with the Home Assistant Telegram_bot integration. Perhaps a library that this integration depends on has recently changed and this error is a side effect. Who knows

I have made a new telegram bot two days ago, and changed telegram api key to use new bot. Today I’ve lost one message. “Error sending message: Timed out” again