Panic light

Hallo and thank you for reading!

I am very new to HA and i would like to create a button with a icon at the lovelace page where i can turn on all lights with just one single press.
I actually do have a button like that already but when one single light is already on, the “Panic Button” shows on (activated)!

The button that i need is turning on all lights despite the fact that one or more lights are already turned on.

Please, if you know how to do that, let me know.
I hope i will understand how to create your idea in my HA

With many thanks and regards

Klaus

How about this?

service: light.turn_on
data: {}
target:
  entity_id: light.all

Hallo Jan!

Thank you very much for your reply.
The question now is, what will i do with that code?

I tried to add a light switch and put the code there, but it was not working.

Can you maybe explain where and how i will use the code that you sent?

Sorry to bother you

Thank you

Klaus

Or use a button with a scene

:wink:

But the scene has to be created and also updated whenever you have new lights or change them :wink:

I would create a helper - of type input_button - let’s call it input_button.panic and link an automation to it:

alias: Panic
description: "Turns on all lights"
trigger:
  - platform: state
    entity_id:
      - input_button.panic
action:
  - service: light.turn_on
    target:
     entity_id: light.all
mode: single

And I would still create a scene, and add a button-card to lovelace

show_name: true
show_icon: true
show_state: true
type: button
tap_action:
  action: call-service
  service: scene.turn_on
  data: {}
  target:
    entity_id: scene.full_light
entity: scene.full_light
icon: mdi:home-lightbulb

Nothing against scene in the end but imagine you have 100 lights - that is some clicking to do a scene. The service is a one line thing and does the same with almost no efforts. :wink:

The button goes without saying - it was even mentioned in the original post so I was not suggesting anymore.

1 Like

Surely it is simple as using a button card where tap_action is to call a service. Use the service in post 2