Change item state from Notification

is it possible to change an item state from a Broadcast notification?
As an example what I’m looking for: When the garage door is open for 10 minutes, send a broadcast notification that asks me if I want to close the door, and I can do that from the notification.
I’ve seen that it’s possible to do it with telegram. As I’m using the openhab android app (and broadcast notifications) anyways on multiple devices, it would be really cool if it was possible to do it directly from there.
Thanks and best regards

Telegram is the only way I know of to do this. It cannot be done using the myopenhab notifications.

This would be a great feature.

I think HomeAssistant has something like this.

I feel like this came up awhile back in the Android app discussion, and that it’s not an easy thing to add. I can’t find the specific posts.

You might be able to do this using Tasker, but I haven’t tried it.

  1. OH triggers a notification in the OH Android app
  2. Tasker sees/deletes the notification
  3. Tasker pushes its own notification with action buttons
  4. Pushing an action button sends a command to OH

It would be a lot of work, so I’d only want to do this for a handful of very specific actions.

I am assuming you are talking about the google voice broadcast.

I think you can’t do it because of privacy conserves from google. They only want to turn the mic on after you command it to. I think you could phase it so it doesn’t sound silly.

Like google saying

“hey @HDaniel you have left the garage door open again if you ask me nicely I will close it for you.”

“Ok google close the garage door”

You can also simultaneously do this in telegram. The trick is not having yes no answers like .

The garage door is open silly do you want me to shut it. YES IGNORE

I was referring to the broadcast notification on the Openhab Android app. I was already afraid it wouldn’t work, but before working on a work around I thought it won’t hurt to ask.
I might have a look at the telegram implementation then. Anyways thanks for the answers everybody.

Here is the example of the implementation of telegram

Using the Binding not the openHAB action


rule "Send telegram with question"
    Item Presence changed to OFF
    val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22")
    telegramAction.sendTelegramQuery("No one is at home, but some lights are still on. Do you want me to turn off the lights?", "Reply_Lights", "Yes", "No")

rule "Reply handler for lights"
    Item telegramReplyId received update Reply_Lights
    val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22")

    if (telegramMessage.state.toString == "Yes")
        telegramAction.sendTelegramAnswer(telegramReplyId.state.toString, "Ok, lights are *off* now.") 
        telegramAction.sendTelegramAnswer(telegramReplyId.state.toString, "Ok, I'll leave them *on*.")

Telegram makes a lot more sense than Tasker, since it won’t have to be set up individually on every Android device.


2years later and is there anything new on the subject? It would be really cool if the function would work with OPENHAB Notification. I use it a lot and currently implementing it with Telegram.

Greetings Tobi

Nothing new.