Persist scenes created with scene.create

Currently scenes created with scene.create are discarded after a restart. Because of that they can often not be reliably used like described in the documentation, e.g. in order to save the current state of some devices in order to recall this state later again. If for some reason HA has to be restarted in between or the configuration reloaded this will not work.

I would therefore suggest to treat scenes created with scene.create like scenes create via the UI. I see no disadvantage in persisting and not deleting them. scene.create already overrides a scene if it exists. Optionally a scene.delete service could be implemented although this might be useful in only rare cases.

This feature could then also be used for integrations which are not able by themselves to persist the state of entities over a restart.

This would be helpful in many situations, for example saving the state of multiple lights when they are turned off after a timeout to re-enable them if motion is sensed within a limited period of time. This allows emulating the typical behavior of motion sensing light switches across multiple lights.

2 Likes

same here. I use scene.create for preserving the state of my light after switching them off and on again via an automation based on motion detection.
Does anyone knows a workaround to preserve this scene over a reboot? Via script maybe?

2 Likes

I second this.
I use scene snapshots for adjusting some temperatures in the house based on the current hourly price of electricity.
If I restart HA at the wrong time, all my set temperatures have to be adjusted.

1 Like

I second this too. snapshots that can’t persist past reboots aren’t very useful as all set states have to be adjusted again

3 Likes

Option “persistent: true/false” for saving in scenes.yaml by service scene.create is necessary.

2 Likes

Until this feature hopefully gets implemented, did anyone try this avenue:

Will probably give it a try but wondering if anyone tried it yet?

Thx

As far as a I understand it, it doesn’t save the attributes of an entity.

Thanks for the feedback, will check with the developer if it’s on the roadmap.

1 Like

I second this too.
The persistence option true/false is a good idea on this road

I’ve tried to use scene.create with homeassistant.boot trigger to restore my “last know lights states” but I didn’t notice that dinamic scenes disapear on restart :cry:

I came here looking for a solution

1 Like

Any solution to this? I changed my wholw setup so I could easily do changes to my scenes and then finding out that I have to make them all again after a restart.

Was going to use scene.create to restore the state of template lights after a restart but bumped into this. Guess I’ll have to use a less elegant workaround.

I create scenes on the fly to hold the status of all lights. The ability for them to persist a restart would be welcome.

2 Likes

After a couple of years this is still on the top of my wishlist. Would be so nice to sit on the sofa, setup all my lights like I want and click a button to save/update the scene.

I have scene buttons that I can hold to update a scene. This would be such a great feature to home assistant

2 Likes

Is there any chance of realisation here? Or a custom integration that allows persistent scenes? It is really inconvenient to reset all scenes after a restart. Greetings, Eckart

1 Like