Turn off ALL adaptive lighting in an emergency - regardless of location / newly added / other config

Hi there,

I’m fairly new to Home Assistant but have rapidly gone down the rabbit hole and have setup many amazing things - this is a great community with really strong integrations.

I’ve setup an emergency automation in which if there’s a fire, CO2, heat, etc. detected it will turn on all my house lights to 100%, open blinds, turn off the HVAC, send notifications, etc. I’ve been a big fan of the HACS Adaptive Lighting add-in. However, I’m wondering, if there’s a way through an automation turn off all adaptive lighting and/or disable the integration (as part of my routine above)? I see there’s a way to disable it area by area, but I’d like to write this automation in a way that despite if I were to add or change areas, light entities, etc. I’d like to ensure adaptive lighting is disabled across the board no matter how my setup evolves.

Any pointers on how this might be possible is much appreciated. Inversely, being able to re-enable it across the board would be helpful too as part of the ‘recovery procedure’ from an emergency (and to make life easier as I test this automation out.

Much appreciated!

If you go to the integrations page and click on the adaptive lighting integration. There you will see your adaptive configurations.

If you click on “4 entities” You will be presented with 4 switches that turn off different parts of adaptive. One for daytime settings, one for sleep, on for brightness and one for color.

Thanks Mikefila, that’s right. What I’m curious about is if there’s a generic way to toggle all those switches off and on - regardless of the names and how many exist. So let’s say I finish this emergency automation today - I’d love that if tomorrow I add some more lights/entities/locations under Adaptative Lighting that those switches automatically get toggled off through this automation without me having to revisit it. Hopefully that makes sense and am curious if there’s a simple programmatic way to do that.

Sorry I misread that. You can do that but that is outside my knowledge of how to automate this. The following would return all the adaptive switches that were on. You would need to save that to restore possibly by creating a scene.

{{ states.switch
   |selectattr('entity_id', 'search', 'adaptive')
   |selectattr('state','eq','on')
   |map(attribute='entity_id')
   |list }}

Edit: I was able to get this working. Afterwards apply the scene and then delete it.

alias: adaptive turn off
description: ""
trigger:
  - platform: state
    entity_id:
      - input_button.1
condition: []
action:
  - action: scene.create
    metadata: {}
    data:
      scene_id: pre_emergency_adaptive
      snapshot_entities: |
        {{ states.switch
         |selectattr('entity_id', 'search', 'adaptive')
         |selectattr('state','eq','on')
         |map(attribute='entity_id')
         |list }}
  - action: switch.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: |
        {{ states.switch
         |selectattr('entity_id', 'search', 'adaptive')
         |selectattr('state','eq','on')
         |map(attribute='entity_id')
         |list }}
mode: single