Hi team
I’m moving a groupMember rule from OH4 to OH5
While it still works, I am seeing these messages
2025-11-06 13:37:51.048 \[INFO \] \[el.core.internal.ModelRepositoryImpl\] - Loading model ‘Colour_OH5.rules’
2025-11-06 13:37:51.773 \[INFO \] \[el.core.internal.ModelRepositoryImpl\] - Validation issues found in configuration model ‘Colour_OH5.rules’, usin g it anyway:
The method getRed() from the type HSBType is deprecated
The method getRed() from the type HSBType is deprecated
The method getGreen() from the type HSBType is deprecated
The method getGreen() from the type HSBType is deprecated
The method getBlue() from the type HSBType is deprecated
The method getBlue() from the type HSBType is deprecated
The rule itself is fairly simple, in so much as it is meant to see a colour picker change in a member of the ColourPicker group
Extract the new RGB components from that and push them into three items, with names derived from the ColourPicker
rule "colour"
when
Member of ColourPickers received command
then
logInfo("Colour","Colour = "+triggeringItem.name.toString+" Changed to "+triggeringItem.state.toString)
if (triggeringItem.state.toString == "ON") {sendCommand(triggeringItem.name.toString,"0,0,100")}
if (triggeringItem.state.toString == "OFF") {sendCommand(triggeringItem.name.toString,"0,0,0")}
else
{
var HSBType hsbValue = triggeringItem.state as HSBType
var int redValue = hsbValue.red.intValue
var int greenValue = hsbValue.green.intValue
var int blueValue = hsbValue.blue.intValue
var RED = triggeringItem.name+"_RED"
var GREEN = triggeringItem.name+"_GREEN"
var BLUE = triggeringItem.name+"_BLUE"
logInfo("Colour",triggeringItem.name.toString+" HSB Value = "+hsbValue+"\nRGB Values \n"+RED+" = "+redValue+"% \n"+GREEN+" = "+greenValue+"%\n"+BLUE+" = "+blueValue)
sendCommand(RED,redValue.toString)
sendCommand(GREEN,greenValue.toString)
sendCommand(BLUE,blueValue.toString)
}
end
Example Items
Group ColourPickers "All Colour Pickers"
// Edit the following to suit the Dimmer channels in use - Any colour item should be put into the (ColourPickers) group
Color TestItem01Colour "Test Colour 1 Colour Picker" <colorpicker> (ColourPickers, gLoungeLight) ["light"]
Dimmer TestItem01Colour_RED "Test Colour 1 Red" <slider>
Dimmer TestItem01Colour_GREEN "Test Colour 1 Green" <slider>
Dimmer TestItem01Colour_BLUE "Test Colour 1 Blue" <slider>
Dimmer TestItem01Colour_WHITE "Test Colour 1 White" <slider> (gLoungeLight) ["Light"]
Color TestItem02Colour "Test Colour 2 Colour picker" <colorpicker> (ColourPickers) ["light"]
Dimmer TestItem02Colour_RED "Test Colour 2 Red" <slider>
Dimmer TestItem02Colour_GREEN "Test Colour 2 Green" <slider>
Dimmer TestItem02Colour_BLUE "Test Colour 2 Blue" <slider>
Dimmer TestItem02Colour_WHITE "Test Colour 2 White" <slider> ["Light"]
My Question is never “Fix this for me”
but “where can I go to find out how to fix it myself?”
I’ve gone looking for OH5 DSL HSL rules example, but can’t find any guidance.
Can someone point me in the correct direction please?
(FYI, I’ve tried creating this rule in the MainUI and I just can’t wrap my head around it, this DSL approach just seems to work… until something changes
)