Setting/Saving/ Restoring Light States

Recently I’ve started playing around with Node-red as the layer that deals with my more complex home automation logic. While playing around with notification lights (i.e. groups of lights being used for alerts/notifications), I quickly realised that my automations would greatly benefit from the following:

  1. Save and restore light states (color, brightness etc).
  2. Set light states for groups depending on the time of day (e.g. lights at 50% brightness after 6pm, then gradually down to 20% by 9pm). This would ideally be a saved light state, so if a subset of the lights that I’m using for motifications/alerts change, I can set the lights back afterwards.

Has anyone executed either of the above, either in HA or Node-red?

Any help greatly appreciated.

Not sure I understand your question but the state of a light is available, so you could set one light identical to another or use an input_select/input_number to keep the state.

Sorry, I realise that my question may not have been very clear.

I basically wanted to take a snapshot of the light states before changing the light state (for a notification for example), and then be able to restore the state after the notification - can you elaborate a little on the input_select/input_number approach you mentioned?

Another approach (to build on top of the first) would be to specify light (group) states depending on the day/time of day and periodically update the lights with the values (while not interfering with the on/off states).

I would have ideally liked to do this in node-red… but I haven’t quite been able to figure out how. I did find scenes however, which may be the answer…