Hey, i have a bunch of template lights/switches … i want to create now a value template so HA knows my light/switch is on or off
if you look in my screenshot below, every light/switch has a unique ID, like 4401 or 4502 or …
the value can be 00 or 01 for off/on
how can i make a value template to look for a specific unique id?
before i had a sensor, based on fixed values in a string, now it different
i had :
value_template: "{{ states.sensor.prog.state[12:14] == '01' }}"
But that was static , i want it dynamic to look for a value like 4401 , if thats on/off
so i need to search in a string and get the substring