Save Scenes bug?

There seems to be a bug in the Scenes editor when saving.

When I click the Save button on the bottom right of the screen to save the Scene, it’ll disappear for a split second then immediately come back. No matter how many times I click it, it always comes back. If I attempt to leave the editor page, I’ll be prompted to confirm that I want to stay/leave as there are unsaved changes to the scene. The scene does appear to save correctly if I leave, but this bug doesn’t give me proper confidence.

Anyone else experiencing this? Don’t know when this started, but this is not a new bug with the recents core updates. It’s been around for a few months for me.

Perhaps you are trying to save an invalid scene. Have you checked your log for errors when this happens (Settings → Logs)?

Did you remove default_config from your configuration.yaml? If so then you must have scene: !include scenes.yaml somewhere in there. It must be exactly like that, the filename and location is specific and cannot be changed. The UI editor only looks at the scenes.yaml file in the root of the config folder so if you don’t have that included in your configuration then you get wonky behavior similar to what you’re describing.

2 Likes

Thanks guys.

@tom_l - Nothing in logs are suggesting an error.

@CentralCommand - I have both default_config and !include scenes.yaml in my configuration.yaml file.

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Hm, strange. What exactly is in your scene?

Just some lights and a fan. :slight_smile:

Mike, you just lead me to the answer though!

I have a switch that I was using a helper to change the device type to a light. Looks like I had both the switch and light in there with conflicting states. I removed this and just called the light as an entity, which seems to have fixed the issue.

Odd that logs didn’t flag this as an issue. And that the scene ultimately did save. I guess the Scenes editor validation logic just didn’t like it?

Thank you!

When you open a scene in the UI scene editor it immediately executes the scene, putting all your stuff in the state specified by the scene. When you save it then it captures the current state of all the listed entities and devices into the scene config.

I’m not exactly sure what’s happening but my guess is having both in there means when the scene is executed it affects the state of the light (perhaps not in a way that is easily determined, like an attribute). Since the current state of the light does not exactly match what’s in the scene it asks if you want to save again. And every time it saves it likely executes the scene again starting the cycle over.

I’m totally guessing. I don’t really use scenes very much and I never use the scene editor, I just write YAML. But that seems like a possible explanation for why your scene is valid and saves but also keeps telling you there’s unsaved changes.

1 Like

I have similar issue: when I adjust an existing Scene, changes do not save. Sometimes the Save button even doesn’t appear even I make changes. 2023.8.3.

I have a variation on this too.

My scenes weren’t saving (and my automations). I found my config.yaml did have the required text in them. I have corrected that.

I now have a different problem. The new scene saves in the scenes.yaml but the scene doesn’t execute and the UI doesn’t register the existence of the scene that is located in the yaml. Yes I have restarted after config changes.

Any ideas?

I’m having issues like described here too. Especially with covers and blinds…