I have a Nodon wall switch wich control one spotlight and one ceiling lamp. Ceiling lamps zwave switch Fibaro builtin wit two switches is set to have Non remote 2+4 as lifeline. For button 1+3 I have scenes running to control q2 of the same fibaro builtin switch.
In my case I just want all this to happen very fast as short latency as possible. My rule looks as follows. I’m trying to be able to insert the state in trigger line so it would be soemthing like this Item z16_scen received update <= 2.0 but can’t get it to work. If I do this I need to have two diffrent rules which would be fine by me.
ule “NODONREMOTE”
when
Item z16_scen received update
then
if (z16_scen.state <= 2.0 && z13_q2.state==OFF ) {
logInfo("Remote Nodon", "Rule: Spotligt på via scen")
sendCommand(z13_q2, ON)
}
if (z16_scen.state >= 3.0 && z13_q2.state==ON) {
logInfo("Remote Nodon", "Rule: Spotligt av via scen")
sendCommand(z13_q2, OFF)
}
end
Several people have reported that using the new rule engine with for instance Jython (“Python on JVM”) runs considerable faster than DSL.
However, for a simple rule like this, the bottleneck is not in the rule processing but in the overall event processing within openHAB and of course the system it runs on.
You should probably better off focusing on the use of timers and ‘competing’ rules and the system as a whole for low latency/speed and not so much in this rule.
BTW, make sure not to avoid the use of primitives (int, float, …) but only Java Number type objects. DSL is known for being extra slow wiith that.
I think it works a little bit quicker if you trigger on command instead of update (first happens the command, later the update). That in combination with receivedCommand it will be a little bit faster
rule “NODONREMOTE”
when
Item z16_scen received command
then
if ((receivedCommand as Number) <= 2.0 && z13_q2.state==OFF ) {
logInfo("Remote Nodon", "Rule: Spotligt på via scen")
z13_q2.sendCommand(ON)
}
if ((receivedCommand as Number) >= 3.0 && z13_q2.state==ON) {
logInfo("Remote Nodon", "Rule: Spotligt av via scen")
z13_q2.sendCommand(OFF)
}
end
I tried the suggestion above but rule wouldn’y fire at all. I think I read somwhere that som or perhaps all wallswitches only send updates and not commands. I’m not shur I’m right.