Telegram Bot. Incorrect Timeout Diagnostics
The Problem
When using the Telegram bot integration in Home Assistant Core, a diagnostic error occurs when the timeout
parameter is set to 60 seconds. This results in a "Timed out" error, even though the timeout value is set to 60 seconds.
Example of Error
The error occurs as follows:
- 00:00:17 - New Telegram message
- 00:00:20 - Sending
- 00:00:40 - Timed out
This indicates that the timeout value is not being respected, and the error occurs after 20 seconds, not 60 seconds.
What Version of Home Assistant Core Has the Issue?
The issue occurs in version 2025.3.2 of Home Assistant Core.
What Was the Last Working Version of Home Assistant Core?
Unfortunately, there is no response to this question.
What Type of Installation Are You Running?
The installation is running in a Home Assistant Container.
Integration Causing the Issue
The Telegram bot integration is causing the issue.
Link to Integration Documentation on Our Website
The integration documentation can be found on our website at https://www.home-assistant.io/integrations/telegram_bot.
Diagnostics Information
The diagnostics information is as follows:
2025-03-13 00:00:17.897 DEBUG (MainThread) [homeassistant.components.telegram_bot] New telegram message send_photo: {'target': [2*******9], 'url': 'http://127.0.0.1:3000/render/d-solo/p4BCXTg4z/test?orgId=1&from=now-24h&to=now&panelId=2', 'username': 'view', 'password': 'view', 'verify_ssl': False, 'timeout': 60, 'caption': '[2025.03.13 00:00] Voltage for 24h'}
2025-03-13 00:00:20.658 DEBUG (MainThread) [homeassistant.components.telegram_bot] Sending file to chat ID 2*******9
2025-03-13 00:00:40.664 ERROR (MainThread) [homeassistant.components.telegram_bot] Error sending photo: Timed out. Args: (), kwargs: {'chat_id': 2*******9, 'photo': <_io.BytesIO object at 0x73ce7ec16ca0>, 'caption': '[2025.03.13 00:00] Voltage for 24h', 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'read_timeout': 60, 'parse_mode': <ParseMode.HTML>, 'message_thread_id': None}
Example YAML Snippet
The example YAML snippet is as follows:
- action: telegram_bot.send_photo
data:
target: '{{ trigger.event.data.user_id }}'
url: http://127.0.0.1:3000/render/d-solo/p4BCXTg4z/test?orgId=1&from=now-{{states('input_number.v_hours')|int}}h&to=now&panelId=21
username: ***
password: ***
verify_ssl: true
timeout: 60
caption: '{{ states(''sensor.data_time'') }} Phase 3. Voltage for {{states(''input_number.v_hours'')|int}}h'
continue_on_error: true
Anything in the Logs That Might Be Useful for Us?
Unfortunately, there is no additional information in the logs that might be useful for us.
Additional Information
Unfortunately, there is no additional information available.
Possible Causes of the Issue
There are several possible causes of the issue:
- Incorrect timeout value: The timeout value may be set incorrectly, causing the error to occur.
- Network issues: Network issues may be causing the error to occur.
- Integration issues: Issues with the Telegram bot integration may be causing the error to occur.
Troubleshooting Steps
To troubleshoot the issue, the following steps can be taken:
- Check the timeout value: Check the timeout value to ensure it is set correctly.
- Check the network connection: Check the network connection to ensure it is stable.
- Check the integration: Check the Telegram bot integration to ensure it is working correctly.
Conclusion
Q: What is the issue with the Telegram bot integration in Home Assistant Core?
A: The issue is that the timeout
parameter is not being respected, resulting in a "Timed out" error, even though the timeout value is set to 60 seconds.
Q: What version of Home Assistant Core has the issue?
A: The issue occurs in version 2025.3.2 of Home Assistant Core.
Q: What type of installation are you running?
A: The installation is running in a Home Assistant Container.
Q: What integration is causing the issue?
A: The Telegram bot integration is causing the issue.
Q: What is the error message?
A: The error message is "Timed out".
Q: What is the diagnostics information?
A: The diagnostics information is as follows:
2025-03-13 00:00:17.897 DEBUG (MainThread) [homeassistant.components.telegram_bot] New telegram message send_photo: {'target': [2*******9], 'url': 'http://127.0.0.1:3000/render/d-solo/p4BCXTg4z/test?orgId=1&from=now-24h&to=now&panelId=2', 'username': 'view', 'password': 'view', 'verify_ssl': False, 'timeout': 60, 'caption': '[2025.03.13 00:00] Voltage for 24h'}
2025-03-13 00:00:20.658 DEBUG (MainThread) [homeassistant.components.telegram_bot] Sending file to chat ID 2*******9
2025-03-13 00:00:40.664 ERROR (MainThread) [homeassistant.components.telegram_bot] Error sending photo: Timed out. Args: (), kwargs: {'chat_id': 2*******9, 'photo': <_io.BytesIO object at 0x73ce7ec16ca0>, 'caption': '[2025.03.13 00:00] Voltage for 24h', 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'read_timeout': 60, 'parse_mode': <ParseMode.HTML>, 'message_thread_id': None}
Q: What is the example YAML snippet?
A: The example YAML snippet is as follows:
- action: telegram_bot.send_photo
data:
target: '{{ trigger.event.data.user_id }}'
url: http://127.0.0.1:3000/render/d-solo/p4BCXTg4z/test?orgId=1&from=now-{{states('input_number.v_hours')|int}}h&to=now&panelId=21
username: ***
password: ***
verify_ssl: true
timeout: 60
caption: '{{ states(''sensor.data_time'') }} Phase 3. Voltage for {{states(''input_number.v_hours'')|int}}h'
continue_on_error: true
Q: What are the possible causes of the issue?
A: The possible causes of the issue are:
- Incorrect timeout value: The timeout value may be set incorrectly, causing the error to occur.
- Network issues: Network issues may be causing the error to occur.
- Integration issues: Issues with the Telegram bot integration may be causing the error to occur.
Q: What are the troubleshooting steps?
A: The troubleshooting steps are:
- Check the timeout value: Check the timeout value to ensure it is set correctly.
- Check the network connection: Check the network connection to ensure it is stable.
- Check the integration: Check the Telegram bot integration to ensure it is working correctly.
Q: How can I resolve the issue?
A: To resolve the issue, follow the troubleshooting steps outlined above. If the issue persists, contact Home Assistant support for further assistance.