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.
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. -
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\"}"
-
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)
-
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.
@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 '\\\\'\"}"
-
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 '\\\\'\"}"
@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.
-
I can't reproduce it. What version of AltUI are you on? (see More > Plugins)
@toggledbits
I've got something similar. Running ALTUI 2.50.2549 (from the bottom banner)
Installed the Reactor.stable branch for the Pushover enhancements.
Oddly, although my Plugins tab for Reactor reads GitHub.stable, my Reactor Logic Summary page notes:Version: 3.9develop-20318.1220 config 20263 cdata 20045 ui 20190 pluginDevice 98 LuaXP 1.0.2enh
-
That's correct. The stable branch is a development branch, so it will have development tagging on the versions. The stable branch is updated when work from development is tested and passes.