Ok, finally I fixed it!
@vladosam, thanks for your help, but when I tried your solution it still did not work for me… But now I know why…
I switched to polling… and after that, when I tried to acknowlege the alert from my telegram group again, using inline keyboard, hoping that @vladosam solution works, but it still didn’t…
However, now I could see some error in my home-assistant.log:
2020-04-24 00:39:15 ERROR (dispatcher) [homeassistant.components.telegram_bot] Incoming message is not allowed ({'id': 'XXXXXXXXXXXXXXXXXXX', 'chat_instance': '-xxxxxxxxxxxxxxxxxxx', 'message': {'message_id': xxxx, 'date': 1587677931, 'chat': {'id': -xxxxxxxxxxxxx, 'type': 'supergroup', 'title': 'HomeAssistant'}, 'text': '*ALERT:* BATHROOM LEAKAGE DETECTED!', 'entities': [], 'caption_entities': [], 'photo': [], 'new_chat_members': [], 'new_chat_photo': [], 'delete_chat_photo': False, 'group_chat_created': False, 'supergroup_chat_created': False, 'channel_chat_created': False, 'from': {'id': xxxxxxxxx, 'first_name': 'hassio', 'is_bot': True, 'username': 'my_ha_bot'}}, 'data': '/bathroom_leak_ack', 'from': {'id': <MY_USER_ID>, 'first_name': 'drew', 'is_bot': False, 'username': 'drew-kun', 'language_code':home-assistant.log
Ok, that’s something…
Fast google-fu led me here…
So I added the id from the home-assistant.log
error message to the list of allowed_chat_ids
of telegram_bot:telegram_bot:
- platform: polling
parse_mode: html
api_key: !secret telegram_hassio_token
allowed_chat_ids:
- !secret telegram_hassio_chatid
- <USER_CHAT_ID FROM ERROR IN THE LOG>
restarted HA and voila!
Now I can send bot commands from my telegram group to my hassio instance.
It seems that hassio indeed needs the user_id of a person in the telegram group in order to receive commands… The group’s id (the negative number) is obviously enough for sending messages, but not enough for receiving commands (maybe because multiple people in the group can send those commands, but not all of them necessary need to be allowed to do this - so it makes sense).
And speaking about webhook platform people say they fix same kind of problem adding url:
and trusted_networks
to telegram_bot: in configuration.yaml. Here is the reference
I will play with it a bit more, also will try adding the bot’s ID… and see if it is enough for all the users in the group to be able to send comands to hassio. Will leave the answers here for reference.
Thank you guys for your help!