Actionable notifications in Android app version 1.6.0

Hi,

I’m very excited to see actionable notifications coming to the android app. But i’m stuck doing something with it : not sending twice the same notification. Before it was easy with push => set a tag.
Now i’m unable to do this, did someone managed to do it ?
One more thing i loved with push, when i dismissed a notification there was an event fired, i can’t see if it’s also the case here.

Thx

Edit ! ok, found it, will come in a future release !

Thank you so much for this - saved me a lot of time.

1 Like

Just a FYI to everyone in this thread but we started updating the companion site to include Android examples! Keep in mind this site will be kept up to date with the firebase builds so at times you may see features described that are not in the play store release yet. Just look for the Android logo to see what is supported and what syntax to use :)’

5 Likes

Is it possible to have action take you to a live camera stream?

Interested in this too…
Before I used pushover, there was an url: option, you could click on it and it would open an stream url…

yes use the uri option and enter the URL you wish to navigate to for the live stream.

      service: notify.mobile_app_<your_device_id_here>
      data:
        message: "Something happened at home!"
        data:
          actions:
            - action: "URI"
              title: "Open Url"
              uri: "https://google.com" # URL to open when action is selected

Alternatively you can also have the entire notification take you to the stream as well: https://companion.home-assistant.io/docs/notifications/notifications-basic#notification-click-action

      service: notify.mobile_app_<your_device_id_here>
      data:
        title: "Motion Detected in Backyard"
        message: "Someone might be in the backyard."
        data:
          clickAction: 'https://google.com' # action when clicking main notification

Don’t forget to check the docs for more things you can do!

3 Likes

Cool, gonna implement my 2 cameras on a doorbell notification, so gonna use example 1 , with 2 different camera urls

I am guessing that this would not work with unifi cameras since there is no URL that I’m aware. Still cool!

a very quick google search leads to: https://community.ui.com/questions/How-to-see-the-live-view-directly-with-an-URL-/de2845bd-96e9-4aff-857d-1ff2949e2ccf#answer/b2f57d2a-0b4a-4f3c-bb4c-d261b9480477

And I had already seen that and I was hoping for a simpler solution but thanks for pointing out a google search.

i created a seperate view on my lovelace config, where i have my cameras in live view configured
so when doorbell rings, my url is that specific lovelace view page

cause indeed rtsp doesnt open as an url …

ok, tested and working with an url to my camera view :slight_smile:
what would be cool, if the image would be a live view :slight_smile: , instead if a static image

Hi,
Any idea why the notification is not dismissed when clicking on an action (like it is the case in html5 notif)?

Thanks!

it shoudl be dismissed when you click on it, mine do. It only stays if you are using sticky: true

It’s set to sticky: false. The notification is only dismissed when clicking on it but not when clicking on an action button

False is the default for sticky. Can you check if tag or color works?

Color and tag works. I can dismiss a notification by sending clear_notification as message

Big thanks to @NimdaBE for the tip on finding the output. I was building out my notification and thought of something I don’t know how to solve with NodeRed. I’m doing a check every minute after my notification fires to see if the door is still open. If I am working in my garage maybe I want the garage to be open for longer. I thought about just adding another check to see if anyone is home and to not fire, which I am likely going to do, but maybe there is another action I might want the option to ignore? How would you go about stopping the flow with an “ignore” option?

{
    "message": "Would you like to close the garage door?",
    "title": "Garage Door Left Open",
    "data": {
        "actions": [
            {
                "action": "close_door",
                "title": "Close Door",
            },
            {
                "action": "ignore",
                "title": "Ignore"
            }
        ]
    }
}

What if I wanted the message to be the contents of the msg.payload object?

What if I wanted the message to be the contents of the msg.payload object?

Nevermind, I figured it out. It figures, I messed with it forever before I posted the question and as soon as I post the question, I realized what it needed