Persist scenes created with scene.create

I have a use case for this where I created a motion sensor triggered automation to control lights, and the very first action is to snapshot using scene.create so that I can return the lights to the previous state.

I need to have the automation mode set to “Restart” so that the lights stay on if a person is still in the zone. But because the lights are already on from the initial trigger, when the automation gets restarted, the original scene.create before the initial trigger gets overwritten and hence the lights never turn off.

If there an option to preserve the scene.create from the earliest trigger, this would allow me to move all my hue motion sensors to HA! :pray:

3 Likes

Saw the Github discussion on this one and walked into the same problem myself. Having to work around this by setting a persistent “default” scene if the snapshot scene is unknown/unavailable but it’s rather annoying that scene persistence isn’t possible without admin intervention. A user should be able to set the lights and expect that scene to resume when they leave/return to the room.
Any extensions around to solve this?

Just ran into this bug. I made an automation involving a Loratap six-button panel that would save the current light setup on double-click and retrieve it on single-click, and it works great until Home Assistant restarts and I lose all my scenes.

I tried creating scenes via the GUI and passing their entity IDs into the automation’s “create scene” option but that didn’t work or even trigger a noticeable error message, it just put a message in the logs about the scene already existing.

Furthermore, scenes created with scene.create can’t be edited in the GUI, although that’s less inconvenient than having the scenes disappear upon restart.

I ran into this. I have a bunch of lamps that are both being controlled by motion (at night) and manually (by day). At night, brightness is set to the lowest level, and by day I wanted to keep whatever the user last used (there's a remote nearby that allows control).

I had originally built this before the scenes were there using input_number helpers that get updated when the config changes - tried using scenes and then saw there's no way to update a scene persistently. So I reverted...