[RELEASE] Telegram Bot API (notifications)

I've got from Botfather API ID in format like this

465861174:AAFJbac9fJNQO-BuniBfWVNa2JKDBr65kHo

As result during config. step I've got API ID validation error. It seems your code need to be updated a bit.

I just want to say thanks. Our household uses Telegram for easy internal communications like sending a pic or location or group message.

I found this pretty easy to set up over all. I first tested it with a chat on my own account, then decided I want a "group" chat with the bot and other family members. It took a few minutes but eventually figured out that you create a group, invite the bot, send "/start" (not sure if this was necessary or not), then go get the new Chat ID. This Chat ID will be a negative number (for some reason this threw me off, I thought it was some error), and put that into your Hubitat app and it now sends messages to this group.

Thanks!

2 Likes

Cant seem to get Chat ID, i send teh URL in your instructions replacing with the Bot ID provided by @BotFather but it just returns the log of the chats with the bot... please help, is there something im missing?

UPDATE: NVM i just saw it presented in a different way, thought it would come out all arranged the way that you have it, sorry for being such a noob

1 Like

I’ve been using this without issue for a while.

I am wondering if it would be possible to expose the last message sent and received as attributes that rule machine can work with?

Hi t.me users

I have successfully created a Telegram device (thanks @mbafford). I have successfully created a Bot. I can successfully send messages from Hubitat to the Bot, which I get on my phone in the Telegram app. Has been working flawlessly since Matthew release the code.

I now want my wife to get the same Hubitat Bot messages on her iPhone 12 Telegram app.
But I am stumped.

When we add the Hubitat Bot to her app, using the format t.me/<myhubitathere_bot>, it successfully "adds" it to her Chats. I have tried /start, /subscribe (and many others I am sure are not valid commands!), but she simply does NOT get any messages... And yet it works fine from my phone; it may be that I did something "extra" to enable functionality for me, but I for the life of me cannot think what.

Anybody got any ideas?

Thanks
J

That's because you created/own the bot. You need to great a group with the you, the bot and your wife in it. then send messages to the group chat id. You can get the group chat id by adding chat ID echo as a member of the group then it will show you your group chat id. then remove it after you have the ID.

1 Like

You know, I was wondering about me being the owner...

CHECK - Create a group with the you, the bot and your wife
CHECK - Add 'chat ID echo' as a member of the group
CHECK - Group chat id retrieved
CHECK - Remove 'chat ID echo' as a member
FAIL - Then send messages to the group chat id

What works... If I or my wife send a message in the Group chat, we see it.
How do I get my Hubitat Bot's messages to show up in the group as well?
Do I need to change the configuration in the Telegram Device in Hubitat?
Change this?
image

Yes change the chat id setting on hub to the group id number you got from the chat ID echo, make sure you include the "-" at beginning if it has one.. leave the bot api key bit as you have it in the hub if you have already done that.

If you or your wife send message to group it would work just like normal chat group the bot doesn't care about them unless you send it /commands.

1 Like

Dean, thanks a million. Works like a charm.
Trust me when I say I did read up on the subject, lots, and I was still bamboozled.

1 Like

Oh great stuff. Your very welcome. :+1:

Great it worked perfectly for me, are you thinking of adding the function of sending messages from telegram to hubitat?

Posted in another forum discussion that I'm having problems getting notifications from the hubitat app and tried using Telegram. The setup process was a bit involved but the instructions provided here are very helpful, and... It works great! Thank you.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.