Hello everyone, How can I make my rule only trigger when my door state was changed to CLOSED when it’s a specific time, this is the code i got right now
rule “nightLock”
when
Time cron “0/30 * 19-23 1/1 * ? *” or
Time cron “0/30 * 0-7 1/1 * ? *”
then
ZWaveNode006ID150ZWaveModuleForIDLock150And101_DoorLock.sendCommand(ON)
end
rule “dayLock”
when
Time cron “0 0 11 1/1 * ? *”
then
ZWaveNode006ID150ZWaveModuleForIDLock150And101_DoorLock.sendCommand(OFF)
end
On the night its draining my battery like crazy. and when the door closes and open this comes in the log file,
2020-05-15 16:43:52.293 [vent.ItemStateChangedEvent] - ZWaveNode006ID150ZWaveModuleForIDLock150And101_DoorState changed from CLOSED to OPEN
2020-05-15 16:43:58.566 [vent.ItemStateChangedEvent] - ZWaveNode006ID150ZWaveModuleForIDLock150And101_DoorState changed from OPEN to CLOSED
Is it possible to make it lock when the door state has changed to CLOSE than rather trying to close it every 30sec?
rule “nightLock”
when
Time cron “0/30 * 19-23 1/1 * ? *” or
Time cron “0/30 * 0-7 1/1 * ? *”
then
if (ZWaveNode006ID150ZWaveModuleForIDLock150And101_DoorState changed to CLOSED)
ZWaveNode006ID150ZWaveModuleForIDLock150And101_DoorLock.sendCommand(ON)
end