Fixed conditional running of notification creation

This commit is contained in:
2022-09-22 19:57:09 -04:00
parent 8c2c141cc1
commit 2a7b90015f

View File

@ -1600,10 +1600,16 @@ script:
data: data:
notification_id: "weatheralerts_alert" notification_id: "weatheralerts_alert"
## Create a new persistant notification in the UI for a new alert ## Create a new persistant notification in the UI for a new alert
- service: > - if:
- condition: template
value_template: >
{% if states.sensor.weatheralerts.state != '0' %} {% if states.sensor.weatheralerts.state != '0' %}
persistent_notification.create true
{% else %}
false
{% endif %} {% endif %}
then:
- service: persistent_notification.create
data: data:
notification_id: "weatheralerts_alert" notification_id: "weatheralerts_alert"
message: "{{ message }}" message: "{{ message }}"