@ArtyMarty wrote:
What don’t I understand here?
I am trying to set up a switch template for turning a night light on and off with various automations.
I want to be able to change the input boolean to on or off and have it switch the light.
Problem i’m getting, if I switch the switch the boolean updates and the light goes on or off. If I update the input boolean, the template switch also changes but the light does not go on or off.I made a card for it while testing, you will see what I mean…
This is the code:
input_boolean: night_lite: # For night light etc name: 'Night Lite' initial: on icon: mdi:ab-testing # for night light switch: - platform: template switches: night_lite: value_template: "{{ is_state('input_boolean.night_lite', 'on') }}" turn_on: - service: input_boolean.turn_on entity_id: input_boolean.night_lite - service: light.turn_on entity_id: light.steps turn_off: - service: input_boolean.turn_off entity_id: input_boolean.night_lite - service: light.turn_off entity_id: light.steps
Posts: 6
Participants: 3