8000 Telegram Bot: Error sending message: Timed out. · Issue #9049 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Telegram Bot: Error sending message: Timed out. #9049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
levipereira opened this issue Aug 19, 2017 · 6 comments
Closed

Telegram Bot: Error sending message: Timed out. #9049

levipereira opened this issue Aug 19, 2017 · 6 comments

Comments

@levipereira
Copy link
levipereira commented Aug 19, 2017

Home Assistant release (hass --version):
0.51.2

Python release (python3 --version):
Python 3.4.2

Component/platform:
Telegram Bot/ Polling

Description of problem:
Telegram bot not sending message. Getting timeout error and a lot connection error.

Expected:
Telegram bot send message in automation

Problem-relevant configuration.yaml entries and steps to reproduce:

telegram_bot:
  - platform: polling
    api_key: [redacted]
    allowed_chat_ids:
      - [redacted]


# Example configuration.yaml entry for the notifier
notify:
  - name: HasTelegram_bot
    platform: telegram
    chat_id: [redacted]


automation:
- action:
    service: notify.HasTelegram_bot
    data_template:
      message: >
        O Portão da Garagem está {{ trigger.to_state.state }}
  alias: 'Telegram: Status Portão Garagem'
  trigger:
    platform: state
    entity_id: sensor.status_portao_garagem

Traceback (if applicable):

I opened the garage door ... error sending msg

Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.status_portao_garagem=Aberto; friendly_name=Portão Garagem, icon=mdi:gate @ 2017-08-19T16:06:05.206077-03:00>, entity_id=sensor.status_portao_garagem, old_state=<state sensor.status_portao_garagem=Fechado; friendly_name=Portão Garagem, icon=mdi:gate @ 2017-08-19T15:38:17.292277-03:00>>#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.components.automation] Executing Telegram: Status Portão Garagem#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=Telegram: Status Portão Garagem, message=has been triggered, domain=automation, entity_id=automation.telegram_status_portao_garagem>#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.helpers.script] Script Telegram: Status Portão Garagem: Running script#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.helpers.script] Script Telegram: Status Portão Garagem: Executing step call service#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1973721008-15, service=hastelegram_bot, domain=notify, service_data=message=O Portão da Garagem está Aberto>#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1973721008-16, service=send_message, domain=telegram_bot, service_data=message=O Portão da Garagem está Aberto, target=409583353>#033[0m 
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1973721008-15>#033[0m
Aug 19 16:06:05 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state automation.telegram_status_portao_garagem=on; friendly_name=Telegram: Status Portão Garagem, last_triggered=2017-08-19T16:06:05.268691-03:00 @ 2017-08-19T15:38:33.697645-03:00>, entity_id=automation.telegram_status_portao_garagem, old_state=<state automation.telegram_status_portao_garagem=on; friendly_name=Telegram: Status Portão Garagem, last_triggered=2017-08-19T18:13:56.114448+00:00 @ 2017-08-19T15:38:33.697645-03:00>>#033[0m
Aug 19 16:06:10 rpi-model3 hass[29932]: #033[31m2017-08-19 16:06:10 ERROR (Thread-8) [homeassistant.components.telegram_bot] Error sending message: Timed out. Args: (409583353, 'O Portão da Garagem está Aberto'), kwargs:{'disable_notification': False, 'parse_mode': 'Markdown', 'reply_markup': None, 'timeout': None, 'reply_to_message_id': None, 'disable_web_page_preview': None}#033[0m```


I closed the garage door 30 sec later .. msg successful 

``` Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.status_portao_garagem=Fechado; friendly_name=PortãoGaragem, icon=mdi:gate @ 2017-08-19T16:06:35.563478-03:00>, entity_id=sensor.status_portao_garagem, old_state=<state sensor.status_portao_garagem=Aberto; friendly_name=Portão Garagem, icon=mdi:gate @ 2017-08-19T16:06:05.206077-03:00>>#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.components.automation] Executing Telegram: Status Portão Garagem#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=Telegram: Status Portão Garagem, message=has been triggered, domain=automation, entity_id=automation.telegram_status_portao_garagem>#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.helpers.script] Script Telegram: Status Portão Garagem: Running script#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.helpers.script] Script Telegram: Status Portão Garagem: Executing step call service#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1973721008-17, service=hastelegram_bot, domain=notify, service_data=message=O Portão da Garagem está Fechado>#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1973721008-18, service=send_message, domain=telegram_bot, service_data=message=O Portão da Garagem está Fechado, target=409583353>#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1973721008-17>#033[0m
Aug 19 16:06:35 rpi-model3 hass[29932]: #033[32m2017-08-19 16:06:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state automation.telegram_status_portao_garagem=on; friendly_name=Telegram: Status Portão Garagem, last_triggered=2017-08-19T16:06:35.645496-03:00 @ 2017-08-19T15:38:33.697645-03:00>, entity_id=automation.telegram_status_portao_garagem, old_state=<state automation.telegram_status_portao_garagem=on; friendly_name=Telegram: Status Portão Garagem, last_triggered=2017-08-19T16:06:05.268691-03:00 @ 2017-08-19T15:38:33.697645-03:00>>#033[0m

Additional info:

Aug 19 16:25:17 rpi-model3 hass[29932]: #033[31m2017-08-19 16:25:17 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:25:22 rpi-model3 hass[29932]: #033[31m2017-08-19 16:25:
8000
22 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:25:27 rpi-model3 hass[29932]: #033[31m2017-08-19 16:25:27 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:36:31 rpi-model3 hass[29932]: #033[31m2017-08-19 16:36:31 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:14 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:14 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:32 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:32 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:37 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:37 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:42 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:42 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:47 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:47 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:52 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:52 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:37:57 rpi-model3 hass[29932]: #033[31m2017-08-19 16:37:57 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:38:02 rpi-model3 hass[29932]: #033[31m2017-08-19 16:38:02 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:38:07 rpi-model3 hass[29932]: #033[31m2017-08-19 16:38:07 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:38:12 rpi-model3 hass[29932]: #033[31m2017-08-19 16:38:12 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:38:17 rpi-model3 hass[29932]: #033[31m2017-08-19 16:38:17 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:38:22 rpi-model3 hass[29932]: #033[31m2017-08-19 16:38:22 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:38:27 rpi-model3 hass[29932]: #033[31m2017-08-19 16:38:27 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
Aug 19 16:39:24 rpi-model3 hass[29932]: #033[31m2017-08-19 16:39:24 ERROR (MainThread) [homeassistant.components.telegram_bot.polling] Client connection error#033[0m
@levipereira
Copy link
Author
levipereira commented Aug 23, 2017

I installed the tox and asyncio.
Will check if issue come up again.

 root@rpi-model3:~# pip3 install tox
Collecting tox
  Downloading tox-2.7.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 346kB/s
Collecting pluggy<1.0,>=0.3.0 (from tox)
  Downloading pluggy-0.4.0-py2.py3-none-any.whl
Requirement already satisfied: virtualenv>=1.11.2; python_version != "3.2" in /usr/local/lib/python3.4/dist-packages (from tox)
Collecting py>=1.4.17 (from tox)
  Downloading py-1.4.34-py2.py3-none-any.whl (84kB)
    100% |████████████████████████████████| 92kB 991kB/s
Installing collected packages: pluggy, py, tox
Successfully installed pluggy-0.4.0 py-1.4.34 tox-2.7.0

root@rpi-model3:~# pip3 install asyncio
Collecting asyncio
  Downloading asyncio-3.4.3-py3-none-any.whl (101kB)
    100% |████████████████████████████████| 102kB 390kB/s
Installing collected packages: asyncio
Successfully installed asyncio-3.4.3

@levipereira
Copy link
Author

The error still the same.

@Actpohomoc
Copy link

Same to me. In new automation (edited what was created by web page config-automation)

- action:
  - data_template:
      message: '{{ trigger.from_state.state }}: garage door is open'
    service: notify.notify
  - data_template:
      message: '{{ trigger.from_state.state }}: garage door is open'
    service: notify.tele_mbihouse
  alias: ALARM garage door is open
  condition:
  - condition: state
    entity_id: binary_sensor.a1_garage_door
    state: 'on'
  id: '1510311871996'
  trigger:
  - entity_id: alarm_control_panel.alarm_panel
    platform: state
    to: triggered

slack notification is ok: armed_home: garage door is open

but telegram bot is not. This is an error:

2017-11-13 12:49:47 ERROR (Thread-3) [homeassistant.components.telegram_bot] Error sending message: Can't parse entities in message text: can't find end of the entity starting at byte offset 5. Args: (-310654787, 'armed_home: garage door is open'), kwargs: {'reply_markup': None, 'disable_notification': False, 'reply_to_message_id': None, 'disable_web_page_preview': None, 'timeout': None, 'parse_mode': 'Markdown'}

@sander76
Copy link
Contributor

Maybe check after:

#10214

has been released.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
0