I’ve made a script where I want to turn on something when it is off.
The goal is for this to be reuseable. The service switch.turn_on works with a variable for the property target.entity_id, but the condition isn’t working like this.
I’m getting this error:
Message malformed: Entity {{ plug_entity_id }} is neither a valid entity ID nor a valid UUID for dictionary value @ data['sequence'][0]['entity_id']
alias: Test
sequence:
- condition: state
entity_id: "{{ plug_entity_id }}"
state: "off"
- service: switch.turn_on
data: {}
target:
entity_id: "{{ plug_entity_id }}"
mode: single
The script is called from an automation like this:
description: ""
mode: single
trigger:
- platform: state
entity_id:
- input_select.heater_mode
condition: []
action:
- service: script.test
data:
plug_entity_id: switch.shellyplug_1
Thank you! This is what I was looking for. I still don’t understand why home assistant doesn’t have complete yaml references with an explanation per property.