openHAB 4 scenes: Indication if a scene is active?

Just migrated one docker container to 4.0.0 M4. Very nice.

Do the new “no-code” scenes include a functionality to indicate if a scene is active? I didn’t find anything in this documentation Rules - Scenes | openHAB

Thanks for your help.


No, scenes are stateless! It is a fire and forget.

Thanks Hans-Jörg for your feedback.

Do you know if there’s already something available that would implement a state (template, marketplace, …)?

No, as said, scenes are stateless and this is not going to be changed. Reason for that is quite simple. Think of turning on several lights within a scene. If one of the lights is switched of, the scene is no longer valid.
Only thing you can do, create an item triggering the scene and get that state as indication. But as said, changing one of the items included in the scene gives a setting, not reflecting the scene but your trigger item will still be on.

I try to replicate the functionality of the home app on Apple products (HomeKit). The scenes there indicate if they are active. They actually have a kind of hysteresis implemented (e.g. if the scene includes only one light ON with 80% brightness, the scene is indicated as active if the light is ON with 78%).

I see two options, both requring a proxy item (as previously suggested). Obviously, you can update the proxy item to ON when the scene rule runs, so the question is how to turn it off.

The simple approach is to trigger a second rule on any of the items changing. When that happens, update the proxy item to OFF without bothering to check the states of other items in the scene.

The more complex approach is to trigger the rule on any items changing, but also check the states of all of the items in the scene. If the conditions are met, update the proxy item to ON. Otherwise, set it to OFF.

The advantage of the latter approach is that you can identify when the scene is turned on by coincidence. So if 3 of 4 lights are already on and you turn on the 4th, openHAB would know that the scene is active. If this doesn’t matter to you, then there’s no need to check conditions.

1 Like