I suspect I am missing something trivial or fundamental, since this request would appear to be basic.
It’s easy enough to make basic luup calls to determine the state of a device. But what about a scene?
If I have a scene that turns on 4 lights, Vera seems to know that all four lights are indeed on (regardless of how they got that way) and therefore that scene is active. Can I programatically determine if the scene is active without reproducing that logic to query all of the lights individually?
Scenes are not “active” or “inactive”. They are instant events that affect the state of your devices, and then they are finished.
If you want to know if the states that your devices are in matches what the scene set them to, you’ll have to query each device individually, and apply whatever logic you need to the results.
Full disclosure: Vera (UI5 particularly, I haven’t seen this in UI7) has some logic that attempts to do the above for simple scenes, but I never found that it worked well, and it’s definitely not exposed through Luup, so you’re back to doing it yourself manually.
Fair enough.
I’ve just seen it presented as the scene being active if all of the devices were in the state defined by the scene. Seems like that logic might already implemented somewhere, so tapping into it would be cool.
I suppose, if I were motivated enough, I could query the scenes, and for each one of them get the devices and their states, and then compare that with the current states of devices to see what matches up. Given the size of my system (pretty small) that might all be more effort than it is worth unless I just feel like playing with it.