How to configure actionable notifications?

Hey all,

I've trying to build actionable notifications in Node Red to push to Home Assistant, but all I get it just normal notifications with no actions or clickable option.

I tried the array from this topic (Unable to create multiple actionable notifications), but no luck there.
I also tried this:

{
    "message": "Something happened at home!",
    "data": {
        "actions": [
            {
                "action": "URI",
                "title": "Open Url",
                "uri": "https://google.com"
            }
        ]
    }
}

But that also just shows the message with no clickable link.

To clarify: I select the HA action node and as entity I select notify.mobile_app_my_iPhone and put the code above in as JSON

Any tips?

Yeah, I've seen that one and I found out that you actually need to force press the notification in iOS due to some bug to see the actions.

Now I'm struggling to get the URL in the correct format lol

I'm not clear on what you mean by this, do you have a link? If you want the texts to show up instantly you need to use the interruption level option in the data section.

https://companion.home-assistant.io/docs/notifications/notifications-basic#interruption-level

Edit I set up and was able to send an actionable notification to my ipad without any issues.

{
   "title": payload.title,
   "message": payload.message,
   "data":{
       "push": {
          "interruption-level": "critical"
       },
       "actions":[
           {
               "action": payload.action1,
               "title": "5 Min"
            },
           {
               "action": payload.action2,
               "title": "20 Min"
            },
            {
                "action": payload.action3,
                "title": "All"
            }
       ]   
   }
}

Apparently it's an iPhone related bug: Buttons not showing on Actionable Notifications on iOS app - #21 by u20p17 - automation - Home Assistant Community

Many people have the same problem on iPhone, but not in iPad.

So on you iPhone you need to long press the notification to see the options for your actions.

I was able to make a notification like this where I could get a clickable link:

{
    "message": "Something happened at home!",
    "data": {
        "actions": [
            {
                "action": "URI",
                "title": "Open Url",
                "uri": "{{{payload}}}"
            }
        ]
    }
}

You need three {{{}}} around the payload. By default, Mustache will replace certain characters with their HTML escape codes. To prevent this, use triple braces: {{{payload}}}

I don't have an iphone so I haven't seen this issue. However it seems that this is just the way iphones work, especially 3d touch enabled devices, from the docs

iOS 13 and later

  • All devices support notification expanding by performing a right to left swipe and pressing 'View' in the lock screen or pressing and holding, but on 3D Touch-enabled devices you may still need to apply some force to do it. If you're not in the lock screen, you can also pull the notification down to expand it.

it's not a bug, it's a feature

hahaha

1 Like