I have the following two rules. Sometimes there is there is a long delay (like 5 seconds) between the two different lights coming on. Other times not.
And sometimes, there is a delay, then they both come on nearly simultaneously.
The log shows the delta between ItemCommandEvent for the two devices is around 30mS. Are the delays I’m seeing the zwave lag times?
I fooled around with the time the mqtt stays in the Motion state, but that seems to have no effect.
val night_beg = new DateTime(Night_Start.state.toString)
val night_end = new DateTime(Night_End.state.toString)
val day_beg = new DateTime(Day_Start.state.toString)
val day_end = new DateTime(Day_End.state.toString)
val motion_count = 0
rule "Driveway Motion Night"
when
Item mqtt_test changed from "No Motion" to "Motion"
then
logInfo("loggerName", "In Driveway Motion Night, day_beg: " + day_beg)
if( (now.isAfter(day_beg)) &&
(now.isBefore(day_end)) &&
(zwave_device_16500637f6a_node12_switch_binary.state == OFF)) {
logInfo("loggerName", "Send driveway lights on")
zwave_device_16500637f6a_node12_switch_binary.sendCommand(ON)
createTimer(now.plusSeconds(30), [ | zwave_device_16500637f6a_node12_switch_binary.sendCommand(OFF) ])
}
end
rule "Driveway Motion Night Amber"
when
Item mqtt_test changed from "No Motion" to "Motion"
then
Garage_test.postUpdate("Set from rule")
if( (now.isAfter(day_beg)) &&
(now.isBefore(day_end)) &&
(zwave_device_16500637f6a_node10_switch_binary.state == OFF)) {
zwave_device_16500637f6a_node10_switch_binary.sendCommand(ON)
createTimer(now.plusSeconds(10), [ | zwave_device_16500637f6a_node10_switch_binary.sendCommand(OFF) ])
}
end