New Telegram Binding - Tester and Feedback welcome

You got a second version or old action telegram installed? Seems an old and a new instance is running

It is just a clean 2.5.3 installation… just copy the things,items and rules file
my thing is:

Thing telegram:telegramBot:Samaritan "Telegram Samaritan" [ 

  chatIds="27xxxx", 

  botToken="277xxxxxxxxxxxxxx",

  proxyType="SOCKS5",

  parseMode="Markdown"]

I got a warning almoust every 5 sec

You configure Things in Shell only? Or do you have a second Thing configured in Graphical Interface like PaperUi or Habmin?

SOLVED
I had Openhab running also on another machine with same Telegram chat.
As soon as I stopped the other machine the warn disappear.
I Apologize for boring you
Thanks
Lorenzo

All fine. I m always glad if able to help at some things to give some back. I got a lot off help too :slight_smile:

I would love to have the possibility to send commands to my bot.
As well as showing a keyboard with preconfigured values like this:

Did you allready read the documentation with examples for questions and Reply- Buttons?

Yes but the reply buttons are bound to a specific message and can not be opened via a command or the keyboard button
image

I thought about this how to implement in openHAB.
I think you cannot create this automatically (I mean yes you can get all Groups/Items but that would not be ideal).
So somehow it would be great if you can specify a “layout” for these buttons. That way you can make them really useful and maybe support custom commands also…

1 Like

@ZzetT
What I also thought about: Maybe it would be great to implement a queue for sending messages?
It would be great addition for me if messages will arrive even if there is no internet connection at the moment (so retry until the Telegram servers are reachable again…). It looks like, now just drops these messages.

hello,

is it possible to send mp4 files or gif files over the binding?

I thing it works over “sendDocument” but the binding doesn’t support this?

Hi,
today I tried the telegram binding.
Now I can not add a new Bot with PaperUI. I can not push the add button, but I think I did all the necessary inputs. Also tried with different browsers, but it is still the same problem.

With textual configuration it works without any problems.
I am using the 2.5.9 Release Build.

did you pressed Return key after adding the chat-id?

IIRC i have had this same issue

Thank you. Yes you are right. When pressing the Retun key the drop down in the Chad ID field ist filled and it works.
Maybe someone can put this in the descripiton in the PaperUI. In my opinion it is not intutive.
BR

Hi,

I am trying to add button, to ask for answer.
I can see the button, but I wonder how to catch the answer in a rule. I mean wait for the answer to process the rest of the rule.

Here is my code:

var String PorteGarageActionAnswer = ""

val PorteGarageAction = telegramAction.sendTelegramQuery("Porte de garage ouverte, voulez-vous la fermer?", PorteGarageActionAnswer, "Oui", "Non")

if(PorteGarageActionAnswer == "Oui" && PorteGarageAction == "true"){
    PorteGarage_Relay.sendCommand(ON)
    telegramAction.sendTelegramAnswer("fermerGarage", "")
}
if(PorteGarageActionAnswer == "Non"  && PorteGarageAction == "true"){
     telegramAction.sendTelegramAnswer("fermerGarage", "")
}
else
     telegramAction.sendTelegramAnswer("fermerGarage", "")

thanks

You can’t do it this way - you need two different rules. See the last example at the bottom of the documentation page “To send a question with two alternatives and a reply from the bot:”

1 Like

Just a heads up that in openHAB V3.x it appears this binding or the core has an issue displaying the chatIds config field. Possibly due to the multiple=true

I have it working after I setup using a thing file instead of using the UI.

Or you can use the code input of the ui and add the Parameter chatIDs. For me this was the solution, so everything is inside the jsondb config.

thanks, that is quicker than opening a file editor.

YAML

UID: telegram:telegramBot:MyBot
label: Telegram Bot
thingTypeUID: telegram:telegramBot
configuration:
  proxyType: SOCKS5
  longPollingTime: 25
  parseMode: ""
  chatIds: "123456789"
  botToken: 1111111111:aaaaabbbbbccccdddddeeeeefffff

@marc1310
A heads up that I made some changes to the binding to allow it to send MP4 and GIF files.

3 Likes

You hero! I originally used Telegram to send notifications but when I realised it couldn’t send GIFs (in my case created by your IPcamera binding) I migrated to Pushover. If Telegram can soon send GIFs and MP4s I’ll move back to Telegram since I sometimes reach the 7500 free tier notification limit near the end of the month.