More debugging, it seems like the rule does not run for some reason:
22:16:26.814 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘Scene_LivingRoom2’ received command 3
22:16:26.910 [INFO ] [marthome.event.ItemStateChangedEvent] - Scene_LivingRoom2 changed from 4 to 3
Because no infor is written to the karaf console:
@rich I also tried to cast the hsbValue to string to a new variable called hsb without succsess:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////// Switch the different areas where LED-Lights should be switched on/off ////////////////7////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
rule "Change Scene 2 in Living Room"
when
Item Scene_LivingRoom2 received command
then
Group_Light.members.forEach [s | logInfo("Debug", s.name + " equals " + s.state.toString)]
val hsb = hsbValue.toString
//logInfo("Debug", "hsbValue equals change group " + hsbValue.toString)
//Group_Light.members.forEach [s | logInfo("Debug", s.name + " equals " + s.state.toString)]
//Group_Light.members.forEach[s | s.sendCommand(OFF)]
/*
if (receivedCommand==1) {
Group_Tv.members.forEach [ item |
sendCommand(item,hsbValue)
]
}
if (receivedCommand==2) {
Group_Dinner.members.forEach [ item |
item.sendCommand(hsbValue)
]
}
*/
//Switch on just bar
if (receivedCommand==3) {
/*
Group_DMX_LivingRoom.members.filter( s | s.state.toString != "0,0,0").forEach [ item |
item.sendCommand(HSBType::fromRGB(0, 0, 0))
]
*/
Group_DMX_LivingRoom.members.forEach [ item |
//item.sendCommand(hsb)
logInfo("Info", "Turning off " + item.name)
]
Group_DMX_Bar.members.forEach [ item |
//item.sendCommand(hsb)
logInfo("Info", "Turning on " + item.name)
]
}
//Switch OFF
if (receivedCommand==4) {
Group_DMX_LivingRoom.members.filter( s | s.state != "0,0,0").forEach [ item |
//item.sendCommand(HSBType::fromRGB(0, 0, 0))
]
}
end