I am programming a Zooz ZEN17 Universal Relay to trigger an alarm for 10 seconds and then turn it off. However upon testing, I found out that when I pass through the alarm multiple times after the first trigger, it causes the relay to stay on after 10 seconds. What should I add to my code to fix this issue? I want the relay to only trigger the alarm once even if someone passes through the alarm more than once after the trigger. Below you will find screenshots of my code.
You might be better off setting the parameter in the ZEN17 to auto shut off the relay after x seconds. This way the turn off is not dependent on Zwave commands and how busy the hub may be. You can add logic to handle the no retrigger situation you want in your rule.
Auto Turn-Off Timer for Relay 1
Parameter 6: Use this parameter to set the time after which you want the device connected to Relay 1 to automatically turn off once it has been turned on. The number entered as value corresponds to the number of minutes, seconds, or hours (set the unit in Par. 15). Values: 0 – timer disabled (default); 1 – 65535. Size: 4 byte dec.
Auto Turn-Off Timer Unit for Relay 1
Parameter 15: Choose between seconds, minutes, and hours as the unit for the auto turn-off timer for Relay 1. Values: 0 – minutes (default); 1 – seconds; 2 – hours. Size: 1 byte dec.
To make it even better convert a trigger in @hydro311 example into coditional trigger by adding "if R1 is OFF" condition. Programming auto off timer suggested by @CuriousB is a very good idea. But still keep a delayed by 11 sec off command as an extra safety measure.