How I can create a toggle in the template for a scene?
When I tried the next example, the switch (on the Entities Card Configuration) went on in two seconds and then back to off
I want when I press the toggle it keep to be on until I press it again
- platform: template
switches:
avattolight:
friendly_name: "avattolight"
value_template: "{{ is_state_attr('scene.test_curtain_with_light', 'scene.test_curtain_with_light', 'on') }}"
turn_on:
service: scene.turn_on
data:
entity_id: scene.test_curtain_with_light
turn_off:
service: scene.turn_on
data:
entity_id: scene.curtain_light_turn_off