Hi all,
I have an automation that runs a script with a bit of logic in it that returns which scene I should be in for my energy usage, and a boolean that is whether or not I should activate that scene in the automation.
The script is running fine, and it returns what I expect it to, but traces on my automation show that my conditional is evaluated as false, even when my script is returning true.
Here's the YAML for the actions part of my automation
actions:
- action: script.scene_selector_script
metadata: {}
data: {}
response_variable: new_scene - if:
- condition: template
value_template: "{{ new_scene.update }}"
then: - action: scene.turn_on
metadata: {}
data: {}
target:
entity_id: "{{ new_scene.scene }}"
- condition: template
And here is the changed variables section of my trace
context:
id: 01JHTTKG6CJDD7EMG7NK7808V3
parent_id: 01JHTTKG6B9THZ81190RKWVJJR
user_id: null
new_scene:
scene: scene.save_power
update: true
But when I look at the step details for my conditional:
if
Executed: January 17, 2025 at 2:07:26 PM
Result:
result: false
if/condition/0
[If template renders a value equal to true]
Executed: January 17, 2025 at 2:07:26 PM
Result:
result: false
entities: []
Can anyone help me figure out why the conditional is evaluating to false even though the script is returning true?
Thanks!