i treid your code with a coco (433mhz) remote and rfxcom, but didn’t quite got it to work
Item Sw3 changed
then
logInfo("knop_ab1_03", "keuken gewijzigd naar "+Sw3.state)
// Assume current dim is 0 if Item is NULL, light will turn on at 20%
val actu = if(Kitchen_c.state == NULL) 0 else Kitchen_c.state as Number
val newDim = actu + 20// calculate the new dim value
val newState = if(newDim <= 100) ON else OFF // determine if the light should be ON or OFF
if(newState == OFF) {
Kitchen_h.sendCommand(OFF) }
else {
Kitchen_h.sendCommand(newDim)
Sw3.postUpdate(OFF)
}
end >
it works only the first press because then it receives an on command, but the switch stays on and the rule won’t trigger again.
so I tried to post an update but the light stays off