iOS actionable notification in NodeRED

I try to use NodeRED for all my automations. Now I’m struggling with iOS Actionable Notifications.
Could you experts please post some simple example(s) where I can see the correct JSON syntax?

Here you go.

This is the actionable notification with image attached for my doorbell.

Strip out the image part if you don’t need it.

{
    "title": "XXXX Road",
    "message": "Doorbell rang at {{mytime}}.",
    "data": {
        "push": {
            "badge": 0,
            "category": "respond_doorbell"
        },
        "attachment": {
            "url": "https://<myurl for the camera image>",
            "content-type": "jpeg",
            "hide-thumbnail": false
        }
    }
}

another example that doesn’t use an image

`{
    "title": "XXXX Road",
    "message": "Loft light has been on for 30 minutes at {{mytime}}.",
    "data": {
        "push": {
            "badge": 0,
            "category": "respond_loft_light"
        }
    }
}`

FYI the {{mytime}} comes from the simple time node.

2 Likes

Thanks. This was useful.
But I can’t make my iPhone show action buttons such as “Silence alarm” and “Sound all”. How can I do that? Are there settings in hassio that I have to configure to make it work?

Have you created the automations for the response?

So did you create a Silence Alarm automation in Home Assistant? You need that created, then you call it with the actionable notification. E.g. where mine says respond_doorbell you’d put whatever Reference you use for silence alarm.

If you have done all that, make sure in the iOS app you’ve updated push settings. Under Notification Settings.

You can also do this using Telegram, and the advantage to it is that anyone can respond, it’s not just for iOS, but anyone who has Telegram installed (and access to your bot of course). This way, you wont have to maintain automations in Home Assistant and Node-RED, everything will be in Node red.

Thanks, I’ve bookmarked that to take a look at when I’ve more time.

1 Like

I hope it’s s helpful to you. Here’s how they look in Telegram.

Great, I’ll experiment with that in the next few weeks and see if it makes the actionable stuff easier.

Being able to notify users that aren’t signed into HA is a bonus, most of the household doesn’t need to be logged in on a phone, but could benefit from notification :+1:t3:

Gave it a shot, and there’s potential, but the inline keyboard buttons don’t trigger a response.

I can type the command in and it works fine triggering a test automation, but the button, configured for the same command, doesn’t send anything.

That and the fact I can’t get the action buttons on a lock screen is a bit of a downer. I like to be able to deal with notifications without unlocking. So I’ll keep experimenting, but for now I’ll stick with iOS actionable notifications until I can get the Telegram stuff to work better.

Did you setup the bot in nodered with a sender and a receiver? You’ll have to attach something like a call service node to respond to the Telegram commands

Yep.

if I send a message manually e.g. /command or use a message using keyboard with /command that works perfectly.

As soon as I introduce inline_keyboard it fails to do anything.

I’ve got a separate flow set up to capture all messages, not just a command, and feed it into the debug window. That shows that the inline keyboard doesn’t appear to send anything.

Solved it.

inline keyboard responses need to be treated as callback queries not commands, where all other inputs are direct commands.

Just means I need two triggers If I want the option for manual command input.

Good post Justin, thank you. I managed to get it all working for me on my Telegram account -and owner of the bot- I cannot get it to work in parallel for my wife’s phone. She does not get any messages from the bot, only me. I have initiated a chat from her phone to my bot. The bot is in her contact list. I am new to all of this and cannot figure out the setting for her to get the same messages that I do. What am I missing ?Thanks for your help !!!