I am trying to get a boolean to work in my script to choose between two notification actions. The condition in the IF Statement always returns false no matter how I configure it. Choose/Default yield the same result. Please take a look at the code below and tell me what I am doing wrong. I am brand new to HA.
alias: Send Message to iPhone
fields:
title:
selector:
text: null
name: Title
description: Add the Message Title
required: true
message:
selector:
text: null
name: Message
description: Add the Message
required: true
critical_notification:
selector:
boolean: {}
name: Critical Notification?
description: Is this a critical notification?
default: true
sequence:
- if:
- condition: template
value_template: |
{{ is_state("critical_notification", "on") }}
then:
- service: notify.mobile_app_ iphone
data:
title: "{{ title }} "
message: "{{ message }} "
data:
push:
sound:
name: default
critical: 1
volume: 1
else:
- service: notify.mobile_app_iphone
data:
title: "{{ title }} "
message: "{{ message }} "
mode: single