Hello Community. I have a question about notifications in OpenHab app (Android). I download OpenHab app from play market and now I have this app in my phone, and can get from this app push notofications (I use openHab cloud and write some rules with sendNotification action). But if I have a lot of flats with OpenHab installations and want to get push messages on my phone form each of these flats. How can I do that ?
The myopenhab.org service only supports one instance of OH at a time. Similarly, the Android app currently only supports one OH instance at a time (they are adding support for more OH instances to the Android app I think).
You have several options.
-
Set up a VPN so that all the OH instances can see each other. Set up MQTT 2.5 Event Bus and configure all the OH instances to funnel all the alerts to a single OH instance. That OH instance then generates all the push notifications.
-
Use an alternative push notification service like Telegram. If your push notification service of choice doesn’t have a native Oh binding, MQTT Warn is a separate little
-
Use the Mail binding and issue alerts over email. Many phone providers offer an email to SMS gateway which you could use to send SMS messages via email.
Hello. I have one more question about option2. I try to use telegram group chat to get notify from bot, that I succesfully created according to following instruction:
I use command https://api.telegram.org/bot/sendMessage?chat_id=&text=testing with my token, and chat ID with “-” sign (because I use group chat).
And after this I succesfully receive text in chat. But I can’t get messages via openHab.
telegram.cfg:
bots=openHab2
openHab2.chatId=-3278…
openHab2.token=1223…Ng
rule:
rule “Send Notification via Telegram”
when
Item DI0sw changed from OFF to ON
then
logInfo(“notifications”, “Sending notification via Telegram.”)
sendTelegram(“openHab2”, “This is our notification sent via Telegram.”)
end
What wrong I do ?
this is configuration for old binding (1.x)
In new binding (2.x) all information must be in Things.
telegram.things:
Thing telegram:telegramBot:Telegram_Bot [chatIds="378xxx846",
botToken="xxxxx",
proxyHost="localhost",
parseMode="Markdown"]
and rule:
rule "Telegram msg"
when
Item DI0sw changed from OFF to ON
then
val telegramAction = getActions("telegram","telegram:telegramBot:Telegram_Bot")
telegramAction.sendTelegram("message")
end
Thank you for your answer. As i understand, in new OpenHab configuration I don’t need to type bot name. Token and chatID is enought ( Thing telegram:telegramBot:Telegram_Bot - static expresion ?). Am I correct ?
Yes, you are right.