I have the below code and I am having a difficult time understanding how to use the developer templates area of HA in order to show me what each part is doing. I can get “doors” to report to me the array/ list but can’t figure out how to get the others to spit out their values to the developer templates results panel.
Thank you all for showing me how to do this!
variables:
doors: |
{{ states.lock | rejectattr('object_id', 'match', 'boltchecked')
| map(attribute='object_id')
| map('regex_replace', '(^.*)_lock$', 'binary_sensor.\\1') | list }}
open_doors: |
{{ expand(doors) | selectattr('state', 'eq', 'on')
| map(attribute='name') | list }}
closed_doors_unlocked: |
{{ expand(expand(doors) | selectattr('state', 'eq', 'off')
| map(attribute='object_id')
| map('regex_replace', '(^.*$)', 'lock.\\1_lock') | list)
| selectattr('state', 'eq', 'unlocked')
| map(attribute='entity_id') | list }}