Read state of a hue lamp, trigger temporary change, restore previous state

I’m trying to configure an automation that when triggered

  1. Polls the state of hue bulb “hue_1”
  2. Stores the state
  3. Sets the state of “hue_1” to color “B” for X seconds
  4. Restores “hue_1” back to original state

Use case.
Evening and my livingroom lights are set to 6700K @ 80%. Dryer finishes it’s cycle. One lamp switches to red for five seconds then reverts back to 6700K @ 80%. Would also need to work if the lights are off.

Hope someone can help me!

First thing that comes to mind here is to simply create a scene on the fly, activate light, delay and then activate scene, something like this maybe!

action:
  - service: scene.create
    data:
      scene_id: before
      snapshot_entities: light.your_light_goes_here
  - service: light.turn_on
    data:
      color_temp: 153
      brightness_step: 255
    target:
      entity_id: light.your_light_goes_here
  - delay:         
      seconds: 10
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.before
1 Like

Would this overwrite the one that was created previously everytime it’s run?
There’s no way to temporarily store the state information?

Yes, it’s a temporary scene.

Yes, that’s exactly what the above example is doing.

This appears to be working, thanks