Switched to Javascript and it works!
this.BedRoom2commandTime = (this.BedRoom2commandTime === undefined) ? (Date.now() - 3000) : this.BedRoom2commandTime
if(event.itemCommand !== undefined){
this.BedRoom2commandTime = Date.now();
}
if(event.itemState !== undefined){
if((Date.now() - this.BedRoom2commandTime) > 2000 ){
if(event.itemState > 0){
events.sendCommand("BedRoom2Light_Dimmer",100)
}else{
events.sendCommand("BedRoom2Light_Dimmer",0)
}
}
}
Thanks both!