New Telegram Action

Hi Paolo,
I have configured openhab.cfg and created a rule according to the wiki.
I have struggled finding the right zip (I am running 1.7.1, which does not contain telegram in the addons.zip).
Anyway, I found it in 1.8.0 and checked it out.
By the way, my “chat” ID is the same like my “from” ID on https://api.telegram.org/bot
Is this always the case?
And I get an error in the openhab.log:
[o.a.telegram.internal.Telegram] - Method failed: HTTP/1.1 400 Bad Request

In general my confusion is related to “botname” “botusername” (I have chosen both to be the same ;-). Which one to define in openhab.cfg.
Furthermore the botusername in my telegram App (iPhone) is named “@MYBOTUSERNAME”.
So what is the right one to choose?

Apart from the correct addon version, 1.7, 1.8, … (about which I cannot help you, telegram action is just included in 1.8 and later …) you should just follow the instruction written here: https://github.com/openhab/openhab/wiki/Actions#telegram-action
Just follow step by step in order to get your token and chatId, it is very easy to get the telegram token and chatId

The bot name in the openhab.cfg can be any name. And that will be used as first parameter for the sendTelegram method.

Thanks for your quick response.
Actually I followed the step by step thoroughly and I got the token and chatID.

So you mean, just adding the org.openhab.action.telegram-1.8.0-SNAPSHOT.jar to my distribution-1.7.1 will not work?

About using telegram addon on 1.7 I do not have a certain answer. I think it should work but it was developed and tested on 1.8.
Probably @hakan or @watou can give you a better answer about general compatibility issues with addons.

Thanks - let’s see what @hakan or @watou suggest.
:smile:

Honestly, I would be very very surprised if this did work. But then again, I have seen stranger things :smile:

If you want to experiment with the daily builds, please download the 1.8.0-SNAPSHOT archive from https://openhab.ci.cloudbees.com/job/openHAB/

If not, @teichsta proposed a tentative schedule for the 1.8.0 release, please read about it at his posting at Upcoming 1.8 Release

Hi Hakan,

I would like to test the snapshot, but I am afraid, that I mess my system up completely. :wink:
Before I start trying, I need to clone my micro SD.
Thanks for your help.
I will also check out the official release discussion.

I don’t know why placing org.openhab.action.telegram-1.8.0-SNAPSHOT.jar in your openHAB 1.7.1 runtime’s addons folder would be a problem. It ought to work under usual circumstances. Your openHAB Designer from 1.7.1 won’t consider it a valid action, but you can ignore that complaint in Designer.

OH Designer is not the problem (currently I use 1.8. designer as well and it recognizes the “sendTelegram” action).

However after Telegram bot configuration I get the following message in openhab.log.
[o.a.telegram.internal.Telegram] - Method failed: HTTP/1.1 400 Bad Request

Any idea?

probably wrong chatid or token, hard to say without additional information.
how do you call sendTelegram? by a rule? can you post the rule?

Same here,
[o.a.telegram.internal.Telegram] - Method failed: HTTP/1.1 400 Bad Request

My rule:

rule “Send telegram with Formatted Message”
when
Item TemperaturaEnergy changed
then
sendTelegram(“bot1”, “prova prova”)
end

Are you sure that configuration is correct? Here all is working fine.

Thanks for the hint.
I have checked everything again very thoroughly and found the issue indeed in my openhab.cfg.
Some copy / paste issue with the chatID. So you were absolutely right! @paolo_denti.
It did not have anything to do with incompatibility of the different .jars.

I use the openHAB designer and with .cfg files there is obviously not a proper syntax handling!?
Which editor (within OH_Designer should I use?) - currently just text editor which somehow caused the issue.
Thanks @hakan & @watou as well.

It works, id mistake for me too (I used @botname sintax).
Any chance to upload also a jpg? It would be wonderful for secure camera apps :smiley:

2 Likes

And merged by @watou already :smile:

Expect the new functionality on tonights Jenkins build.

Wiki updated as well :wink:

1 Like

Thanks!!

sorry for the dumb question… but where can I download last version?

Telegram action is included in 1.8 and not included in 1.7. So you can either build it on yourself or wait until the 11th of January, when the 1.8 will become official