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. snapshots that can’t persist past reboots aren’t very useful as all set states have to be adjusted again
Option “persistent: true/false” for saving in scenes.yaml by service scene.create is necessary.
Until this feature hopefully gets implemented, did anyone try this avenue:
Will probably give it a try but wondering if anyone tried it yet?
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.