Perform action when light configuration changes from current selected scene

Hi All,

I have an input select that i’m using for scene selection. When the input select changes, it triggers a new scene. I sue this to highlight the currently selected scene.

What i would like to do, is to trigger the input select to go to ‘unknown’ or ‘custom’ when any of the lights change value. ie; If someone turns another light on, or adjusts the brightness then the scene has changed and therefore the input select should reset, as its no longer valid.

Any ideas?

To my knowledge, there’s no easy way to implement what you have requested. The reason is because there’s no way, for an automation or script, to know what a scene is programmed to do.

To detect that an entity’s state has deviated from the state set by a scene, the automation or script would have to know what the scene did. Unfortunately, there’s nothing available, in Home Assistant’s scripting language, to determine what a scene does.

After a scene sets the state of various entities, it’s done. Each entity that was changed has no record of its previous state or that it was changed by a scene.

How does this work when you are creating or editing scenes ?

Say I have an RGB bulb currently on and set to ‘red’ in my living room, I also have a separate smart plug thats currently on, powering a lamp. I then edit a pre existing scene in HA for my living room, and that I have set which is ‘all off’

The second I go into the scene to edit it, everything in the living room turns off, including the RGB bulb and the smart plug.

Lets imagine I change my mind and don’t even edit that ‘all off’ scene and simply exit the page. Whatever the state of the devices was before is now restored, and the bulb turns back on again in red and the smart plug turns on the lamp.

EDIT: Actually I realise this is a slightly different use case. The OP wanted to check if the current states of some entities were different from those set in a specific scene, where as my question is more about restoring to a previous known scene.