I am attempting to run a for each loop for a set of locks in my house. Detect if they are unlocked and if they are, lock them.
Can anyone tell me what I’m doing wrong?
I am getting the following error:
template value is None for dictionary value @ data[0][‘repeat’][‘sequence’][0][‘then’][0][‘data’]
repeat:
for_each:
- device_id: aaa
entity_id: lock.bbb
- device_id: yyy
entity_id: lock.zzz
sequence:
if:
- condition: device
device_id: "{{ repeat.item.device_id }}"
domain: lock
entity_id: "{{ repeat.item.entity_id }}"
type: is_unlocked
then:
- service: lock.lock
data:
target:
device_id: "{{ repeat.item.device_id }}"