Critical iOS notification with message template

I’m trying to edit an existing iOS notification automation that currently works and send me my thermostats temperature when it is out of range. I’m currently using the below action in my automation:

service: notify.mobile_app_****_iphone
data:
 message: "Temperature Out of Range: {{ states('sensor.my_ecobee_temperature') }}"
 title: “Temperature Out of Range”

I’m trying to update this to be a “critical” notification so I am sure to get the notification on CarPlay and when in do not disturb.

I’m trying to add to the action with the below script:

service: notify.mobile_app_****_iphone
data:
 message: "Temperature Out of Range: {{ states('sensor.my_ecobee_temperature') }}"
 title: “Temperature Out of Range”
 push:
  sound:
   name: default
   critical: 1
   volume: 0

The problem is when I try to test this I get the following pop up:

Error running action

extra keys not allowed @ data[‘push’]. Got None

Anyone have any advice on this?

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Or the </> button, not the button.

Fixed, thanks

1 Like

It needs an extra data: key.

  - service: notify.mobile_app_****_iphone
    data:
      message: "Temperature Out of Range: {{ states('sensor.my_ecobee_temperature') }}"
      title: "Temperature Out of Range"
      data:
        push:
          sound:
            name: default
            critical: 1
            volume: 0 # this should be 1 if you want to hear it
1 Like

Wow an easy one. Thank you that worked!

1 Like