Hello,
I’m having an issue with a group of lightbulb I created in items.
Group:Color:OR(ON, OFF) HLR_Lights_Color "Color Lights of Living Room" <colorwheel> (Hall, LivingRoom)
Color Bulb_Kitchen_Colorpicker "Kitchen Bulb Colorpicker via rules" <dimmablelight> (HLR_Lights_Color, LivingRoom)
Color Bulb_Hall_Colorpicker "Hall Bulb Colorpicker via rules" <dimmablelight> (HLR_Lights_Color, Hall)
Color Bulb_LivingRoom1_Colorpicker "LivingRoom1 Bulb Colorpicker via rules" <dimmablelight> (HLR_Lights_Color, LivingRoom)
Color Bulb_LivingRoom2_Colorpicker "LivingRoom2 Bulb Colorpicker via rules" <dimmablelight> (HLR_Lights_Color, LivingRoom)
The thing is I manage to control my group through sitemap. But it gets more complicated when i want to do it with rules :
var hsbHue = (HLR_Lights_Color.state as HSBType).hue.intValue;
var hsbSat = (HLR_Lights_Color.state as HSBType).saturation.intValue;
var hsbBrt = (HLR_Lights_Color.state as HSBType).brightness.intValue;
if (xc_current_mode == "hue") {
hsbHue -= 20
if (hsbHue < 0)
hsbHue = 360
} else if (xc_current_mode == "saturation") {
hsbSat -= 10
if (hsbSat < 0)
hsbSat = 0
} else if (xc_current_mode == "brightness") {
hsbBrt -= 10
if (hsbBrt < 0)
hsbBrt = 0
} else {
hsbBrt -= 10
if (hsbBrt < 0)
hsbBrt = 0
}
val color = hsbHue+","+hsbSat+","+hsbBrt;
logInfo("Color", "Retrieving HSB info -> " + color)
//HLR_Lights_Color.sendCommand(color)
HLR_Lights_Color.postUpdate(color)
Bulb_Hall_Colorpicker.sendCommand(color)
Bulb_Kitchen_Colorpicker.sendCommand(color)
Bulb_LivingRoom1_Colorpicker.sendCommand(color)
Bulb_LivingRoom2_Colorpicker.sendCommand(color)
My command is originally sent correctly to the group, but then reverted back from one element of the group :
==> /var/log/openhab2/events.log <==
2020-01-12 18:25:09.239 [ome.event.ItemCommandEvent] - Item ‘Bulb_Hall_Colorpicker’ received command 0,0,90
2020-01-12 18:25:09.239 [ome.event.ItemCommandEvent] - Item ‘Bulb_Kitchen_Colorpicker’ received command 0,0,90
2020-01-12 18:25:09.239 [ome.event.ItemCommandEvent] - Item ‘Bulb_LivingRoom1_Colorpicker’ received command 0,0,90
2020-01-12 18:25:09.239 [ome.event.ItemCommandEvent] - Item ‘Bulb_LivingRoom2_Colorpicker’ received command 0,0,90
2020-01-12 18:25:09.240 [GroupItemStateChangedEvent] - HLR_Lights_Color changed from 0,0,90 to 0,0,100 through Bulb_Kitchen_Colorpicker
Is there anything i’m doing wrong ? At first I used “HLR_Lights_Color.sendCommand(color)” as an only sending command one, but as my problem started appearing, I tried different things.
Thanks in advance.