Hi All,
Having a real doozy of a fight with a new rule, and I’m hoping someone can point out where it’s going wrong as I’m sure its something simple…
The premise: I have 4 hue Ambience Spot Lights in the living room that I want to set up so that they are part of a group that turn off / on together.
Items:
For each spot I have, the only difference is the number, ie HueLight2, 3, 4 and the appropriate channel
Dimmer GF_LR_HueLight1_Brightness "GF LR Hue Light 1 Brightness" (gLivingRoomLights) {channel="hue:blahblah:brightness"}
Dimmer GF_LR_HueLight1_ColorTemp "GF LR Hue Light 1 Colour" {channel="hue:blahblah:color_temperature"}
So far so good, I can’t see a switch option so I’m guessing it’s just setting the brightness to 100 or 0 is the equivalent on / off function.
I also have a group called gLivingRoomLights in the same items file.
My rule:
rule "Living Room Lights ON/OFF - Alexa"
when
Item aLivingRoomLights changed
then
if(aLivingRoomLights.state == ON)
{
logInfo(logName, "Living Room Lights - Alexa - ON")
//GF_LR_HueLight1_Brightness.sendCommand("100")
//GF_LR_HueLight2_Brightness.sendCommand("100")
//GF_LR_HueLight3_Brightness.sendCommand("100")
//GF_LR_HueLight4_Brightness.sendCommand("100")
gLivingRoomLights.members.forEach[ i | i.SendCommand("100") ]
}
else
{
logInfo(logName, "Living Room Lights - Alexa - OFF")
//GF_LR_HueLight1_Brightness.sendCommand("1")
//GF_LR_HueLight2_Brightness.sendCommand("1")
//GF_LR_HueLight3_Brightness.sendCommand("1")
//GF_LR_HueLight4_Brightness.sendCommand("1")
gLivingRoomLights.members.forEach[ i | i.SendCommand("1") ]
}
end
In this case, I have an alexa dummy item aLivingRoomLights that sends an ON / OFF command, this then runs the rule to turn the lights on or off.
Now it works if you comment out the group part and uncomment the basic Brightness.sendCommand to each light, so I know the basic functionality is there, but I want to have it as a group should I want to add more lights / do different scenes.
The logs show the logfile entry but no errors…
So, where have I gone wrong with the group members.forEach line and is there not a on / off switch for these bulbs, do they really operate 0 to 100? I couldn’t really see much info in the Hue binding docs…