In my HA Config, I added the following to group my lights, however I don’t want the “turn on” service to work, so left it blank. The issue is when I set the button to just “toggle”, the screen flashes black for some reason when I turn off all the lights???
HA Config:
switch:
- platform: template
switches:
all_lights:
value_template: >-
{{ is_state('light.1', 'on')
or is_state('light.2', 'on')
or is_state('light.3', 'on') }}
turn_on:
# service: "commented out line"
turn_off:
service: light.turn_off
data:
entity_id: all
Any help to go about this better? Don’t really want the screen to flash black everytime I turn off the lights…
Answer: The button hold to turn off all will create a pop up on single tap, which has all lights listed to turn on individually. I have 0 use cases to turn on all lights, as they are all in different rooms. But would like a simple way to turn them all off.
Confirmed this works, however my whole screen flashes black as mentioned in the original post, whereas this does not happen with “toggle”… WHYYYYyyyy sigh
EDIT: Doesn’t happen when I use the LIGHT group. Might be because of the code in the template I used for the Switch…
Fun fact, even after adding the line in as suggested:
turn_on:
service: light.turn_on
data:
entity_id: all
turn_off:
service: light.turn_off
data:
entity_id: all
However, it still flashes black when I press the button. This blank screen can last up to 1-4 seconds, so I will obviously not use the switch method but stick to the “light: group” method (which does not flash my screen black).