Hello
I’m running openhab 3.0.2 as a docker container. I installed Telegram Binding and configured a Telegram Bot Thing with my Token and ID and the Thing shows Online as status. I then created the following test DSL rule.
val telegramAction = getActions("telegram","telegram:telegramBot:TelegramBot")
telegramAction.sendTelegram(" Pumpe 1 hat einen Alarm. Bitte überprüfen.")
If I fire the rule and click on Run now, the message appears within seconds in my Telegram Chat Bot on my personal smart phone. I then installed Telegram on a second smart phone and added my Chat Bot to Telegram. For some reason the message doesn’t appear on that smart phone at all. I really don’t know why. Did I miss something?
Hello James
Thank you for your answer. Yes my idea was to use the same chat bot for all three family members to send the alarm only to one chat bot and all three family members get the alarm if they add the Telegram chat bot to there Telegram app.
Yesterday I did some research on the net and found this post. It’s a kind of the other way round. I would like to have one Telegram chat bot and multiple consumers.
Maybe I don’t understand the idea of a chat bot. Is it necessary that every family member creates his own Telegram chat bot and then I can send the alarm to each of this individual chat bot? Can only Telegram chat bot creators receive messages in this chatbot?
Hi, you have to add the chatbot in the family’s telegram.
Then you have to find out the chatID of the new members.
in the thing configuration you add the chatIDs.
Then the messages will be sent to all active chatIDs
I have one bot for me and my wife.
You are able to send messages only to one member if you add the chatID into the rule.
Greets
As you are building your system have a think about what each family member wants as they probably don’t want all the same thing. You want the least amount of messages and only want the information you want.
You have successfully created one bot and have figured out how it works
Do the same for each family member so in the future you can address each one individually.
Then you can do things like
val telegramManuel = getActions("telegram","telegram:telegramBot:Manuel")
telegramManuel.sendTelegram(" Pumpe 1 hat einen Alarm. Bitte überprüfen.")
Add another person could be
val message = " Pumpe 1 hat einen Alarm. Bitte überprüfen."
val telegramPerson = getActions("telegram","telegram:telegramBot:Person")
val telegramManuel = getActions("telegram","telegram:telegramBot:Manuel")
telegramManuel.sendTelegram( message )
telegramPerson.sendTelegram( message )
val message = " Happy Birthday you are " + secondCalc + " Seconds Old"
val telegramManuel = getActions("telegram","telegram:telegramBot:Manuel")
telegramManuel.sendTelegram( message )
Person you have left your lights on in your bedroom do you want me to turn them off?
I’m monitoring only a pump in the basement of a building. If there is an alarm on the pump controller, a message should be sent to only three people, me included. Not more. So all person should get the same message. There is no need at the moment to address these three people individually.
I supposed that one telegram chat bot should be enough for this but as I noticed I’m the only one which gets the message (I was creating the chat bot from my smartphone and I’m the only one having the token and ID).
Btw I’m on openhab 2.5 but I think it’s the same way.
I had linked the ‘chatID’ channel to an item.
then, I wrote to the bot with my wifes phone.
(you can search the bot and write a message)
Now, the chatID string changed.
This is the chatID from the wifes phone.
In the thing configuration (telegram bot) is a field where you add the chatIDs which the bot can interact.
Put here yours (is already) and the other chatID. (comma separated)
I expected to receive an additional chatID which I can then add in my Telegram Thing. Unfortunately I only get the following answer from api.telegram.org.