How to make Telegram notifications work?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
tgg3
Posts: 7
Joined: Monday 14 May 2018 9:42
Target OS: Raspberry Pi
Domoticz version: 3.9453
Contact:

How to make Telegram notifications work?

Post by tgg3 » Thursday 17 May 2018 10:12

I'm trying to get Telegram notifications working. However, I see the following in the log when I click the "Test" button next to to the Telegram notification settings:
---------------
2018-05-17 16:02:43.737 Error: Telegram: {"ok":false,"error_code":404,"description":"Not Found"}
2018-05-17 16:02:43.737 Notification sent (telegram) => Failed
2018-05-17 16:02:43.753 Active notification Subsystems: telegram (1/14)
---------------

I got the API Key and the Chat ID (from the @get_id_bot on Telegram) and pasted those strings into the notification settings Telegram. I get the feeling I need to do something else.

Thanks much for your help.
Tom

simonrg
Posts: 1071
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version: 3.8807
Location: North East England
Contact:

Re: How to make Telegram notifications work?

Post by simonrg » Thursday 17 May 2018 16:53

The error looks like it isn't Domoticz, but somehow in the communication to / from Telegram.

Try this is browser -

Code: Select all

http://api.telegram.org/botAPInumeric:APIalphanumeric/sendMessage?chat_id=CHATID&text=Hello
Replace APInumeric:APIalphanumeric with your API key and CHATID with your chat ID.

Response should be:

Code: Select all

{"ok":true,"result":{"message_id":xxxxxx,"from":{"id":xxxxxxx,"is_bot":true,"first_name":"Bot Name","username":"botname"},"chat":{"id":xxxxxxx,"first_name":"firstname","last_name":"surname","username":"userid","type":"private"},"date":1526568064,"text":"Hello"}}
Are you able to get this to work?
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

tgg3
Posts: 7
Joined: Monday 14 May 2018 9:42
Target OS: Raspberry Pi
Domoticz version: 3.9453
Contact:

Re: How to make Telegram notifications work?

Post by tgg3 » Friday 18 May 2018 6:51

I found my problems. Your HTTP test code was very useful. I hadn't created the bot and then added a chat for that bot to my Telegram app (which isn't mentioned in https://www.domoticz.com/wiki/Telegram_notification). The api key I was using didn't go with the bot I ended up creating.

Sorry for the NOOB mistake. There are so many new concepts for someone new to the world of DIY IoT (sensors, controllers, new hardware, new software languages, messaging APIs, etc.). I really appreciate the help from everyone in the support forums.
Tom

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests