Hello,
What I am trying to do is to have an automation, which calls a script, while passing a couple of variables to said script. In the script I need to evaluate one of the boolean variables to true, before proceeding. I'm having trouble writing the template to properly do this evaluation, as it always ends up being false.
The automation is:
alias: Test Messaging
description: ""
triggers:
- trigger: state
entity_id:
- light.office
conditions: []
actions:
- action: script.announcement_duplicate
data:
message: This is a test message
urgent: "true"
mode: single
And the corresponding script is below. Don't pay attention to the action. I'm concerned with getting the IF statement evaluated properly at this point.
sequence:
- if:
- condition: template
value_template: "{{ is_state(urgent, \"true\") }}"
then:
- data:
volume_level: 0.3
target:
entity_id:
- media_player.garage_speaker
enabled: true
action: media_player.volume_set
- parallel:
- data:
entity_id: media_player.garage_speaker
message: "{{ message }}"
enabled: true
action: tts.cloud_say
- data:
entity_id: media_player.garage_speaker
message: This is an "{{urgent}}" urgent
enabled: true
action: tts.cloud_say
alias: Announcement (Duplicate)
mode: queued
max: 20
description: ""
Thank you!