How to generate a short (1 second) negative pulse

Moderator: leecollings

Post Reply
PBdA
Posts: 15
Joined: Monday 14 December 2015 16:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

How to generate a short (1 second) negative pulse

Post by PBdA »

Hello,
I have a zwave relay (Qubino ZMNHND1 Flush 1D relay) which commands an alarm. The relay is normally closed and to arm or disarm alarm, it should open for a short time and then close. I have tried a lua script:

Code: Select all

commandArray[1] = {['Alarm command'] = 'Off'}
commandArray[2] = {['Alarm command'] = 'On AFTER 1'}
but it does nothing. This works only for a pulse >= 3 seconds:

Code: Select all

commandArray[1] = {['Alarm command'] = 'Off'}
commandArray[2] = {['Alarm command'] = 'On AFTER 3'}
It's possible to generate a short positive pulse with a scene:

Code: Select all

Command: On
On delay: 0
Off delay: 1
But it doesn't work for an Off command:

Code: Select all

Command: Off
On delay: 1
Off delay: 0
Switch goes Off immediately but never return to on.
PBdA
jautem
Posts: 5
Joined: Tuesday 26 January 2016 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Contact:

Re: How to generate a short (1 second) negative pulse

Post by jautem »

can you use sleep function in lua script , turn off , sleep 3 et turn back on ?
raspberry cam - moteino rfm69 - Zwave Stick - IR - 433 transceiver
PBdA
Posts: 15
Joined: Monday 14 December 2015 16:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

Re: How to generate a short (1 second) negative pulse

Post by PBdA »

jautem wrote:can you use sleep function in lua script , turn off , sleep 3 et turn back on ?
Sleep is a bad thing in lua script because it blocks execution of other scripts. Furthermore, I think it doesn't work because commandArray is executed at once when script return.
PBdA
jautem
Posts: 5
Joined: Tuesday 26 January 2016 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Contact:

Re: How to generate a short (1 second) negative pulse

Post by jautem »

so perhaps fork another script like shell in lua source script , and shell script will sleep and use api to finish job ?
raspberry cam - moteino rfm69 - Zwave Stick - IR - 433 transceiver
PBdA
Posts: 15
Joined: Monday 14 December 2015 16:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5893
Location: Colomiers, France
Contact:

Re: How to generate a short (1 second) negative pulse

Post by PBdA »

Nice idea but I have taken another way: Qubino ZMNHND1 Flush 1D relay can be configured to return to On by itself with a configurable delay. I had to use a recent OpenZwave config but it works.
Thank you for your help.
PBdA
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest