Hello,
I have a large number of Hue lights that are each in a set of groups e.g.
Group gLivingRoomLights "Living Room Lights" (gLights)
Group:Switch:OR(ON,OFF) gLivingRoomLightsToggle "Toggle [(%d)]" (gLivingRoomLights)
Group:Dimmer gLivingRoomLightsDimmer "Dimmer" (gLivingRoomLights)
Group:Color gLivingRoomLightsColor "Color" (gLivingRoomLights)
I would like to create an item to hold the last update time of the group. e.g.
DateTime gLivingRoomLights_LastUpdate
I can create a rule that triggers on update of any member of gLivingRoomLights and then record the time into the Last Update time and this works fine. I am trying to extend this to apply to each individual group of lights
I was hoping to do something like this but cant see a way of making it work;
rule "Record Last Update for Light Groups"
when
Member of gLivingRoomLights changed or
Member of gLivingRoomLamps changed or
...
Member of gAtticLights changed or
then
val lastUpdate = ScriptServiceUtil.getItemRegistry.getItem(triggeringItem.name+"_LastUpdate")
sendCommand( lastUpdate, new DateTimeType())
end
but the triggeringItem is naturally the actual item and not the group it was a member of. Is there a way of getting the group name?
Or is there different way of doing this in a generic way that doesn’t need a rule for each group.
Thanks
James