joshuacox / mkdomoticz

Make a persistent domoticz container PDQ
GNU General Public License v3.0
16 stars 28 forks source link

telegram notifications do not work #22

Open alan-rpi opened 4 years ago

alan-rpi commented 4 years ago

To replicate follow instructions at https://www.domoticz.com/wiki/Telegram_Bot to create a telegram a/c, create a bot and get the API key, and then obtain the Chat ID.

In Domoticz Settings / Notifications tab, paste the API key and Chat ID into the Telegram settings (as the bottom of the page) and press Test. Message: "Notification Sent - should arrive at your device soon" pops up. No message arrives. Log error:

 2020-03-14 15:58:27.965 Status: Notification: Domoticz test
2020-03-14 15:58:28.016 Notification sent (telegram) => Failed
2020-03-14 15:58:28.024 Active notification Subsystems: email, telegram (2/13)
2020-03-14 15:58:28.016 Error: Telegram: 

There is no problem when sending a message via the CLI: Open the Domoticz CLI in Portainer and connect. Paste the following (after inserting the API key and Chat ID): curl --data chat_id=<CHAT ID> --data-urlencode "text=Some complex text $25 78%" "https://api.telegram.org/bot<API KEY>/sendMessage" It returns: {"ok":true,"result":{"message_id":67,"from":{"id":985736213,"is_bot":true,"first_name":"xxxxxxx","username":"xxxxxxxxx"},"chat":{"id":xxxxxxxxx,"first_name":"xxxxxx","username":"xxxxxx","type":"private"},"date":1584201822,"text":"Some complex text 5 78%"}}root@c826cdca9643:/#

Does the problem have the same issue as sending email?

joshuacox commented 3 years ago

I am now on telegram and will test this soon.

mortyone commented 3 years ago

Telegram may just need port 443 also opened when running "docker create"