I am trying to recreate my HomeKit scenes in Home Assistant but I hate the horrible live option (who made this?) because all lights and curtains are going wild. So I’m trying to yaml it, but I don’t know exactly what I am looking at?!
Edit: Wait a minute, the scene is not actually editable in review mode?! Then what exactly is the point of having it at all? Dumb, dumb, dumb UI design. The scene editor should open in review mode, with everything fully editable, and then have a button for manually enabling a live preview. It is the only thing that would make any kind of sense.
Also calling it “review mode” is yet another nonsensical name to add to the list of stupid and/or overlapping names in HASS. Or am I the only one who thinks “review mode” sounds like it would do exactly the same thing as “live edit”, i.e. a live preview/review of what the scene looks like in real life?
The scene editor is trying to list each and every attribute so it can put it back exactly the same. If you dislike the scene editor as much as I do, and do not feel the need to change 20 attributes from every entity (ok, exaggerating) then I suggest you simply write a script and call that when you want to activate the “scene”.
That way you are in control of what attributes are relevant for the scene. For instance, I have no clue why a scene would want to try to restore the existing preset list. That sounds dangerous to me, especially if the scene was created long ago. By writing a script instead (using the script editor if you like) you’ll miss nothing, but you’ll have the additional advantage that you can use templates and conditionals to make the scene even smarter.
The only thing I use scenes for (which is the actual real advantage of them) is to capture the state of entities on the fly, so you can return that a little while later. For example: if the fire alarm goes off, I capture the state of all lights in the house and then turn them all on, full brightness. If we checked all is safe, I call the scene to return lights to the way they were. That scene is not stored, because it is single use. So my scene.yaml is completely empty.
I was afraid for this, I’d like to separate my scenes and scripts.
But how do I know what I need to alter for it to change (and what is a “state-save”.
The captured scene data is not usable one on one, but you can use it to see the current values for the thing you are interested in. I use developer tools instead to see what things are relevant and what their current value is. Then I use the script editor to write the actions, such as light.turn_on to set brightness and color or pick a preset. I might use conditionals to alter some things or use an input_number to configure some things of the scene in a dashboard:
Or, when you want to turn a lot of things off when you go to sleep, you can set a sleep label on all the entities, and call homeassistant.turn_off on the sleep label. Scenes can’t compete with that. I dare you to edit a real sleep scene in the evening . It was one of the first things I did when discovering and editing scenes. And it was the last time I edited a scene using the scene editor.
Luckily, categorising and labeling scripts goes a long way in organising them.
Okay, I am over to scripts. The crappy scenes editor with lights is somewhat doable, but with curtains it is horrible. I hope they will do something about that….