Persisting scenes created via `scene.create`

I’m looking through the documentation for scene.create and right away I run into the statement “This scene will be discarded after reloading the configuration.”

Is there any means to persist a service-created scene between reloads? If not, is there a core architectural reason for this, or should I be submitting this as a feature request?

3 Likes

Probably only by writing it in YAML.

The trouble with that is it is no longer “service created”, it’s manually created.

Can you tell me what the use case is for this?
If I want a persistent scene, I create a scene through the UI or in YAML. If I want a scene on the fly, I use scene.create.

Use case is something of an edge-case situation in the HASwitchPlate project and I’m mostly just exploring options here. Sounds like the answer is “no”, and maybe I should try a feature request to see if that goes anywhere.

edit: to clarify - I’m trying to create a scene for the user which they can edit later through the UI. If I do that in YAML, they can’t edit it.

How about if you do it via the UI?

Works fine if I do it through the UI, but this is for a project that I am distributing to others, and who might benefit from having that first step taken for them. So, I want to create the scene once, have it persist, but leave it in a state where they can edit it (or delete it) later without having to hand-edit YAML.

1 Like

I’ve stumbled across this thread because I am trying to persist scenes created by scene.create following a restart.

My use case is as follows. I have an automation that will turn on a scene when the room becomes active (triggerred via aqara motion sensor). If I want to change this scene, instead of having to use the scene editor to change the states of each entity, it would be great to just have a button in lovelace called something like ‘save room state’ which when pressed it would trigger the scene.create service and overwrite the scene.

Is such a thing possible?

4 Likes

But would there be a way of getting the YAML contents from the saved scene?

My typical use case is as follows: I have a smart radio that I can control through the Frontier Silicon integration and choosing a channel (whether on DAB, FM, Smart Radio) involves calling either the media_player.play_media service or a scene with media_content_id set to something like Internet radio/preset/1. It is a bit of a complicated process to retrieve this ID, so I was hoping that I could call scene.create as a way of saving my radio channels in HA.

Could you store your currently selected channel in an input_text instead?

@luma
Did you ever find a way to accomplish this?
My use case here:

Thx,