Active status - easy way?

I tried searching for this topic but only came across’ RTS implementation of this in HAL:

How do I make a scene that checks all my devices’ status (on/off/dimming%, locked/unlocked, armed/tripped, etc.) and reports back (maybe via a notification) on which devices are on (or whatever status I’d like to check).

This may be used before retiring to bed at night, or before you go on vacation, etc.

There was code I needed to do this in HAL.
I provided a mechanism to decide what to include and under which conditions …

I believe that this level of flexibility will be needed to achieve users expectations … I expect a number of people will have a different feeling about what is active.

Thanks, RTS. I actually wanted to PM you but figured other users might be interested to know as well.

I’m still a noob and just starting to dive into scripting and LUA/LUUP coding. So it seems there’s no easy way of doing this? I checked the HAL boards but didn’t find the actual script in there–did you do that in LUA as well? Or am I oversimplifying this?

Thanks for your help!

Av

What’s the actual problem youre trying to solve here? Is it finding the right devices, specifying their required state, or issuing the notification? It’s straight-forward to scan the Luup.devices table for specific subsets of device properties, notification has plugins available to help, …

I’m looking for a way to issue notifications on selected states/status of all devices, on demand. So basically like polling my whole network and letting me know which devices are on or unlocked, for example. Hope I’m explaining myself well. I do apologize as I’m just getting my feet wet in this area. Thanks!

I meant there is a significant amount of code to do this.
My code is in the Android client.
The strategy is the same:

[ul][li]Clear the list of active devices[/li]
[li]Loop over all of the devices in Vera.
See: http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#variable:_devices
[/li]
[list]
[li]For the devices you are interested in …
[/li][li] Get the appropriate attribute(s) to determine if the device is active:
See: http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_variable_get
Note: You can get the ServiceId of a device variable by going to an instance of the device, open the advanced tab, and let the mouse hover over the name of the attribute.
[/li]
[li]If you find device is active, add it to the list of active devices.[/li]
[/list]
[li]Using the notification plugin of choice … send the list of active devices.[/li][/ul]

As I indicated … which devices you consider eligible are probably user specific.
Also what states a device must be in to be considered active might also be user specific.