Actionable Notifications . working examples?

Hello!
We want to get started with Actionable Notifications on iOS but are unable so far.
We are using the Companion Docs as a starting point

All the below code is based on the Companion App docs but we are probably making some newbie mistakes?
We can send notifications but not with a url /uri link or with any embedded actionable buttons.
Have searched this forum but found no examples that work for us. If there is, would appreciate a link.

I an ideal world, we want a persistant notification on the ios app that also has actionable buttons.

This is the source for all code below:

This automation is working, but we are so far unable to add any actionables to it.
If we can get this working, we want to try and building notification action scripts
as in the examples at the last part of that Companion Doc page.

alias: TEST example without url or actionables
description: test example
triggers:
  - trigger: state
    entity_id:
      - switch.gx_device_relay_1_state_2
conditions: []
actions:
  - action: notify.send_message
    target:
      entity_id:
        - notify.my_iphone
        - notify.my_laptop
    data:
      title: Battery low
      message: Emergency switch activated. Power is off.
   mode: single

Below are some functions we want to add, from the same Companion Docs.
However we try to add them we get errors and mostly:
extra keys not allowed @ data['actions']. Got None
We are struggling with this. Grateful for any links or clear working examples.
Many thanks!

     actions:
- action: "ALARM" # The key you are sending for the event
    title: "Sound Alarm" # The button title
    - action: "URI" # Must be set to URI if you plan to use a URI
    title: Open Url
    uri: /dashboard-alarms/0  #URL to open when action is selected, can also be a lovelace view/dashboard   
- action: "URI"
  title: "Call Pizza Hut"
  uri: "deep-link://tel:2125551212"

Post the complete automation.
It looks like you have indentation errors but we can't know for sure when you just post bits in different code blocks

Thanks for your reply.
The first code of mine is the complete automation, and as mentioned.
It already works and we want to add actionable to it. This is for a solar system..

The snippets are also just example from the Companion docs.
Perhaps that is not the right way to go about it.
Any other example starting point to do this I also very much appreciated.

Typical examples of what we want to achieve:

  1. Message: Battery is low > button to go to HA to start the genset or charge from grid
  2. Message: The PV voltage is too high > button to go to HA to attend to the materd
  3. Any component sends and alarm that needs attentiing to.

My question is how I add the actionable code to it
Basically a persistent notification on iOS and a button and a link.

Post one of the automation that gave you errors.

If you don't provide us with one, we have to make one up... and it's likely that it won't match what you actually want, so you'll have to modify it... and on and on.

The example in the docs is quite good.

There are also a number of Blueprints for this kind of thing:

2 Likes

That looks perfect, I will read up and give it a go! Truly appreciated!