Remembering states

Hi,

I know this have been covered in other threads but my question is slightly different!

I would like to remember the state of my WLED’s so that after the automation they can revert back, I have the automation setup to create a scene and reload it which works ok, but… I would like to remember the colour, brightness and effect as well as if the WLED’s were on.

I have had a play around with some code but I cannot get it to work, can anyone help?

Also can one scene remember the states for two different lights? ie WLED1 and WLED2?

service: scene.create
data:
  scene_id: alert_revert
  snapshot_entities: 'wled.effect,light.xmas_wled'


Regards
James

Maybe take a look at this:

There are a couple options. You could use scene.create to maybe do this. Or you could push the state to an input_text as a concatenated string and then read it back later.
I’m not sure how to write that offhand. You’d use Jinja for that.

You can create input boolean in configuration.yaml like this:

input_boolean:
  scene_saved:
    name: scene_saved

and this is example of a part of my yard automation using it:

  action:
  - service: scene.create
    data:
      scene_id: yard_before
      snapshot_entities:
      - light.front_garage
      - light.front_1
      - light.front_2
      - light.front_wall
  - scene: scene.front_bright
  - service: input_boolean.turn_on
    entity_id: input_boolean.scene_saved
- alias: No Motion Restore Front Lights
  trigger:
    platform: state
    entity_id: binary_sensor.garage_outside_sensor_motion
    to: 'off'
    for:
      minutes: 2
  action:
  - service: scene.turn_on
    data:
      entity_id: scene.yard_before
  - service: input_boolean.turn_off
    entity_id: input_boolean.scene_saved