Door opens? Turn on light. Door closes? Turn of light.
Hi all,
I am new with the Zipatile (just installed my first few sensors and activators :)), so please explain what I'm doing wrong.
What I want:
- When sunset ("voordeur lamp" is configured to be on at sunset), and front door opens, turn on the light.
- Wait (keep checking) whether the front door closes and turn off the light after 120 seconds.
I build the rule as following, my train of thoughts:
- When voordeur lamp (front door light) and voordeur (front door) are on/open, turn on the light in the hallway instantly;
- then keep checking for 10 minutes (repeat 600 times, with 1 second wait for the action) whether the front door is closed. If so, keep the hallway light on for another 120 seconds (wait 120 seconds) and then turn it off.
-- The repeat should stop running e.g. after the 2nd attempt, if the frontdoor already closed by then (e.g. within 2 seconds after opening).
Underneath rule does turn on the "hal lamp" (hallway light), but it doesn't turn it off, while the front door did close.
Thanks in advance for your guidance!
Paul,
You don't need to use repeat to update sensor state, you can achieve this using the puzzle JOIN. See below and let me know if this works as you expect.
PPB_ZIPATOQUAD_DOOR = VOORDEUR
PPB_QUBINOF2RLY1 = VOORDEUR LAMP
PPB_QUBINOF2RLY2 = HAL LAMP
Regards
Paul,
You don't need to use repeat to update sensor state, you can achieve this using the puzzle JOIN. See below and let me know if this works as you expect.
PPB_ZIPATOQUAD_DOOR = VOORDEUR
PPB_QUBINOF2RLY1 = VOORDEUR LAMP
PPB_QUBINOF2RLY2 = HAL LAMP
Regards
Agree with Alberto, it's easier to use JOIN. But your rule can work as well it you use 'Refresh All' before testing if the door is opened. Once a rule is trigered, the rule always uses the state of devices when the rule is trigerred, not the current one. This is why 'Refresh All' exists. See my example: https://community.zipato.com/topic/stopping-execution-of-a-repeat-block#comment-25971
Agree with Alberto, it's easier to use JOIN. But your rule can work as well it you use 'Refresh All' before testing if the door is opened. Once a rule is trigered, the rule always uses the state of devices when the rule is trigerred, not the current one. This is why 'Refresh All' exists. See my example: https://community.zipato.com/topic/stopping-execution-of-a-repeat-block#comment-25971
Hey Olivier en Alberto,
Thanks a lot for your quick replies!
Alberto, your code works perfectly, thanks for the extra printscreen, really helped me out :-)
Olivier, thanks, I was doubting why it didn't work but that explains a lot. Alberto wrote in the topic you mention: "doing it very often may decrease battery life on your devices on the long run", so let's not go for that option.
Thanks both!
Hey Olivier en Alberto,
Thanks a lot for your quick replies!
Alberto, your code works perfectly, thanks for the extra printscreen, really helped me out :-)
Olivier, thanks, I was doubting why it didn't work but that explains a lot. Alberto wrote in the topic you mention: "doing it very often may decrease battery life on your devices on the long run", so let's not go for that option.
Thanks both!
Hi, I disagree with Alberto, Refresh All doesn't drain the batteries, as Refresh All doesn't trigger the Zipabox to retreive the new state of the device, but rather let the rule see the new value that was sent nevertheless by the device when its state was changed.
Hi, I disagree with Alberto, Refresh All doesn't drain the batteries, as Refresh All doesn't trigger the Zipabox to retreive the new state of the device, but rather let the rule see the new value that was sent nevertheless by the device when its state was changed.
Replies have been locked on this page!