Hello everyone,
I'm watching and reading a bunch of tutorials on value templates and still in a bit of a rut.
I'm trying to make it so that the lights will turn off when person 1's phone is plugged in, but the lights stay on if person 2 is home. If both people are home, the lights shut off when both phones are plugged in.
This is what I have so far - admittedly assisted by ChatGPT. I'm a bit lost on where to go from here making conditions with the variables (i.e., person1_home) set by the template
- condition: template
value_template: >
{% set person1_home = is_state('person.person1', 'home') %}
{% set person2_home = is_state('person.person2', 'home') %}
{% set phone1_charging = is_state('sensor.phonecharging1', 'charging') %}
{% set phone2_charging = is_state('sensor.phonecharging2', 'charging') %}```
Any help would be appreciated! Cheers