Telegram Plug-in to send text, images and video notifications
-
Installed and tested, can't get it to work.
I just dropped the files into cmh-ludl and created the device.
No error messages, but i noticed that the BotID turned into a date value when I pasted it in at the variables tab? its only the number before ":" that goes in there?
is the user ID including the "@"?Tried to send a message using both Reactor, and the "Actions" tab in the device. bots returns "OK" from the telegramservice.
Is the "DisableNotification" a boolean value? -
Yes, once again an issue of Vera variables not having a reliable data type. AltUI (and openLuup) display large numbers as dates. For openLuup the threshold is 1234567890, for AltUI, a little lower, IIRC.
-
Ok, so the value seems to be correct even if the gui thinks its a date.
2020-11-15 12:13:45.817 luup.call_action:: 755.urn:bochicchio-com:serviceId:VeraTelegram1.Send 2020-11-15 12:13:45.817 luup_log:755: VeraTelegram(send@201): send({ action="Send", serviceId="urn:bochicchio-com:serviceId:VeraTelegram1", Text="reqrqe", DeviceNum="755" }) 2020-11-15 12:13:45.948 luup_log:755: VeraTelegram(nil@194): executeCommand("curl --data chat_id=perhusaas --data-urlencode \"text=reqrqe\" --data disable_notification=false \"https://api.telegram.org/bot1460220026:AAHOtQStG8xnTxnV1oAmPfy8MhwQam3Yb-w/sendMessage\""): "{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: chat not found\"}" 2020-11-15 12:13:45.948 openLuup.server:: request completed (30 bytes, 1 chunks, 132 ms) tcp{client}: 0x5624bd630508
(token above is now revoked and renewed)
So, does this mean that it can't find the bot, or my username?
Also tried to create a channel and added the bot to it, no difference. -
@PerH said in Telegram Plug-in to send text, images and video notifications:
Ok, so the value seems to be correct even if the gui thinks its a date.
Yes, that's the case.
-
-
To send a message to Telegram, you'll need a ChatID. From the error message, it's clearly missing.
It's different if you want to send it to a user (UserID is enough or a group).
Here you can find one of the many articles giving instructions: https://medium.com/@sean_bradley/get-telegram-chat-id-80b575520659
-
But - i did try to send it to my user ID. Does it have to be to a group?
This is what i get when i use the generated chatID:
2020-11-15 17:01:19.487 luup_log:755: VeraTelegram(send@201): send({ action="Send", serviceId="urn:bochicchio-com:serviceId:VeraTelegram1", Text="Test!", DeviceNum="755" }) 2020-11-15 17:01:22.147 luup_log:755: VeraTelegram(nil@194): executeCommand("curl --data chat_id=-362200779 --data-urlencode \"text=Test!\" --data disable_notification=false \"https://api.telegram.org/bot1460212826:AAGUroMlLkhnneQkmX9rf0H5SggkGMK1QuA/sendMessage\""): "{\"ok\":false,\"error_code\":401,\"description\":\"Unauthorized\"}"
-
I'll let the token stay up a while if you want to try sending to it..
-
Will do, thanks! Any plans on getting this one into AltAppstore?
-
Uh oh, I was sure it already was. I’ll add lately.
-
FYI, Reactor's direct support for your plugin (in the Notify action) is now available in 3.9-20321, the stable branch release (so in AltUI, go to Plugins, and on the Reactor row enter "stable" as the version and click the update button).
-
Contact!
Had to make a new token to make it work, theres no expiry of them, i hope?
Now i have to learn how to send "special" characters, it didnt even like "!".. But i don't intend to yell in my notifications anyway.
Sent one from reactor too Patrick.
To all you developer guys; Awesome job! thankyou for making this great HA system! Hope to join in on making some contributions myself.
-
didn't find the Message function in this forum, and couldn't send pictures in "chat":
@toggledbits , there's a small UI bug in the stable release:
Other than that, its f**in awesome.
-
I can't reproduce it. What version of AltUI are you on? (see More > Plugins)
-
@perh said in Telegram Plug-in to send text, images and video notifications:
Now i have to learn how to send "special" characters, it didnt even like "!"
It should work out of the box. I have emojis in my notifications and they are correctly encoded.
-
Thats weird, this is the error i get with "Hello!" :
luup_log:755: VeraTelegram(nil@194): executeCommand("curl -k -H 'Content-type: application/json' 'https://api.telegram.org/botXX:XX/sendMessage?parse_mode=MarkdownV2&chat_id=-362200779&text=Hello%21&disable_notification=false'"): "{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: can't parse entities: Character '!' is reserved and must be escaped with the preceding '\\\\'\"}"
-
therealdbreplied to PerH on Nov 17, 2020, 7:36 AM last edited by therealdb Nov 17, 2020, 2:37 AM
@perh Yep, I tracked it down on the other forum as well. As a temporary solution, set Format parameter to Markdown. I defaulted to MarkdownV2, but
_ * [ ] ( ) ~ > # + - = | { } . !
should be escaped and I didn't pay attention to this. Sorry, I'll push an update to GitHub very soon, to default to Markdown anyway.
12/41