#Light attributes history?

1 messages · Page 1 of 1 (latest)

soft pendant
#

I have an Automation that in case of fire turns all the lights to 100% and white light, is there a possibility to set the lights back to both correct state and brightness as before the automation ran? Hopefully without setting up helpers for all the lights(as new lights might be added to the group)

Does this exist in some history, or do i need to fetch the current brightness/color temp at the start of the automation and save it in a variable to set it back after?

action: light.turn_on
metadata: {}
data:
  brightness_pct: 100
  color_temp_kelvin: 6500
target:
  label_id: fire_light
cedar raft
soft pendant
# cedar raft You can create scenes on the fly <https://www.home-assistant.io/integrations/sce...

Thanks never knew about that, at first i had 2 problems: i didn't want to use the light entities in the snapshot.
And there was some issues with lights that was in the off state before going to 100%

...
sequence:
  - action: scene.create
    metadata: {}
    data:
      scene_id: fire_before_01
      snapshot_entities: |
        {{ label_entities('fire_light') }}
  - action: light.turn_on
    metadata: {}
    data: {}
    target:
      label_id: fire_light
  - action: scene.create
    metadata: {}
    data:
      scene_id: fire_before_02
      snapshot_entities: |
        {{ label_entities('fire_light') }}
  - action: light.turn_on
    metadata: {}
    data:
      brightness_pct: 100
      color_temp_kelvin: 6500
    target:
      label_id: fire_light
...
FIRE
...
  - action: scene.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: scene.fire_before_02
  - action: scene.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: scene.fire_before_01
...