Thanks for the advice! This helped me to create a working rule!
var Timer timer = null
rule "Dimmer"
when
Item Robb1_Action_Trigger received command
then
if (timer!==null) {
timer.cancel
}
if(receivedCommand == INCREASE) {
timer = createTimer(now.plusMillis(100)) [|
Voorkamer_Dimmer.sendCommand(INCREASE)
timer.reschedule(now.plusMillis(100))
]
}
if(receivedCommand == DECREASE) {
timer = createTimer(now.plusMillis(100)) [|
Voorkamer_Dimmer.sendCommand(DECREASE)
timer.reschedule(now.plusMillis(100))
]
}
end