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.
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?
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.
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
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.
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
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