Is it possible to query the condition of device groups defined in the plugin from a script? Currently I have statements like
If hs.deviceValue(StatusDevice)>0
do something
End If
and for multiple devices for example I need to do
SetStatus(337, hs.deviceValue(48)+hs.deviceValue(41)+hs.deviceValue(39)+hs. deviceValue(40)+hs.deviceValue(38)+hs.deviceValue(37) )
and manually fetch the IDs of all the devices I want to check.
I would love to use this plugin, assign the devices into groups (which seems to be possible) and then write a script that simply checks if *any* device in a group is ON and if so, sets a virtual status device.
Reason: I have status devices for areas of the house. Like Livingroom, Office, Garage, Upstairs etc. Each status device should be ON if ANY of the lights in that area is on and off if ALL the devices in the area are OFF.
If hs.deviceValue(StatusDevice)>0
do something
End If
and for multiple devices for example I need to do
SetStatus(337, hs.deviceValue(48)+hs.deviceValue(41)+hs.deviceValue(39)+hs. deviceValue(40)+hs.deviceValue(38)+hs.deviceValue(37) )
and manually fetch the IDs of all the devices I want to check.
I would love to use this plugin, assign the devices into groups (which seems to be possible) and then write a script that simply checks if *any* device in a group is ON and if so, sets a virtual status device.
Reason: I have status devices for areas of the house. Like Livingroom, Office, Garage, Upstairs etc. Each status device should be ON if ANY of the lights in that area is on and off if ALL the devices in the area are OFF.
Comment