Page 1 of 1
Help: Delayed switching
Posted: Friday 24 April 2020 17:20
by poeschel
I want to close my garage door automatically 30 minutes after I open it if I forget to close it by hand. The gate can be opened or closed by triggering a switch. To determine whether the gate is open or closed, I have installed a window contact. My first try was the following script. I want to close my garage door automatically 30 minutes after I open it if I forget to close it by hand. The gate can be opened or closed by triggering a switch. To determine whether the gate is open or closed, I have installed a window contact. My first try was the following script. However, the gate opened again after 30 minutes if I closed it manually.

- Script1.jpg (27.11 KiB) Viewed 781 times
Therefore I wrote three scripts in the second attempt. In the first one I use a variable, this is set to 1 when the gate is open for 30 minutes. The second script should open the gate if this variable is 1 and the gate is open. With the third script I set the variable to 0 when the gate is closed. Unfortunately, the second script does not fire. So the variable is set to 1 after 30 minutes, but the switch is not triggered. Can somebody help me with it?
Thanks a lot

- Script2.jpg (20.92 KiB) Viewed 759 times

- Script3.jpg (35.18 KiB) Viewed 781 times
Re: Help: Delayed switching
Posted: Friday 24 April 2020 17:22
by poeschel

- Script4.jpg (16.92 KiB) Viewed 759 times

- Variable.jpg (22.94 KiB) Viewed 780 times
Re: Help: Delayed switching
Posted: Saturday 25 April 2020 17:28
by fargle
Think you are overcomplicating. The first script should work on its own if you are triggering on Device. And using a momentary (pulse) switch contact, which is what most controllers want to see. And if open/closed are the right way round on the sensor.
Re: Help: Delayed switching
Posted: Sunday 26 April 2020 14:09
by poeschel
The frist Script dosn't work correctly. My switch gets the command on. After a second it switch off. This is it, what the door need. But open and close ist the same command. The switch doesn't know the position of the door. The first script sends the On-command later without checking of the actual position.
The problem with the other scripts is, that it don't trigger of the changing of the uservariable.Is it a bug in my system?
Re: Help: Delayed switching
Posted: Monday 27 April 2020 6:44
by fargle
poeschel wrote: ↑Sunday 26 April 2020 14:09
The switch doesn't know the position of the door. The first script sends the On-command later without checking of the actual position.
Yes, the switch doesn't know. But the contact does. IF the contact is Open, (assuming Open is the correct state when the garage is actually open), pulse the door switch after 30 minutes. That's all that needs to happen.
Re: Help: Delayed switching
Posted: Monday 27 April 2020 7:23
by wouterlet
A blocky isn't triggered bij a changed variable. Exchange the variable by a dummy switch and it will work with the 2 last scripts.
You can also combine this 2 in one script with an if else function
Re: Help: Delayed switching
Posted: Monday 27 April 2020 15:43
by poeschel
Yes, the switch doesn't know. But the contact does. IF the contact is Open, (assuming Open is the correct state when the garage is actually open), pulse the door switch after 30 minutes. That's all that needs to happen.
But I can't pulse the switch delayed in this way. The first script switches the switch 30 minutes after the gate has been opened. But it is not checked whether the gate is still open. If the gate was closed within these 30 minutes, there is still an impulse and the gate opens again.
Re: Help: Delayed switching
Posted: Monday 27 April 2020 16:45
by wouterlet
That's why you should skip the first script. As I see it the last two are enough
Re: Help: Delayed switching
Posted: Monday 27 April 2020 21:02
by poeschel
wouterlet wrote: ↑Monday 27 April 2020 7:23
A blocky isn't triggered bij a changed variable. Exchange the variable by a dummy switch and it will work with the 2 last scripts.
Thanks, that works.
