Help: Delayed switching Topic is solved

Moderator: leecollings

Post Reply
poeschel
Posts: 13
Joined: Tuesday 21 April 2020 15:04
Target OS: Linux
Domoticz version: 2021.1
Location: Germany
Contact:

Help: Delayed switching

Post 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
Script1.jpg (27.11 KiB) Viewed 783 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
Script2.jpg (20.92 KiB) Viewed 761 times
Script3.jpg
Script3.jpg (35.18 KiB) Viewed 783 times
Last edited by poeschel on Saturday 25 April 2020 13:54, edited 1 time in total.
Version: 2021.1
Platform: Ubuntu server 20.04
poeschel
Posts: 13
Joined: Tuesday 21 April 2020 15:04
Target OS: Linux
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Help: Delayed switching

Post by poeschel »

Script4.jpg
Script4.jpg (16.92 KiB) Viewed 761 times
Variable.jpg
Variable.jpg (22.94 KiB) Viewed 782 times
Version: 2021.1
Platform: Ubuntu server 20.04
fargle
Posts: 67
Joined: Tuesday 27 March 2018 17:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help: Delayed switching

Post 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.
poeschel
Posts: 13
Joined: Tuesday 21 April 2020 15:04
Target OS: Linux
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Help: Delayed switching

Post 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?
Version: 2021.1
Platform: Ubuntu server 20.04
fargle
Posts: 67
Joined: Tuesday 27 March 2018 17:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help: Delayed switching

Post 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.
wouterlet
Posts: 109
Joined: Tuesday 02 October 2018 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help: Delayed switching

Post 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
poeschel
Posts: 13
Joined: Tuesday 21 April 2020 15:04
Target OS: Linux
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Help: Delayed switching

Post 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.
Version: 2021.1
Platform: Ubuntu server 20.04
wouterlet
Posts: 109
Joined: Tuesday 02 October 2018 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help: Delayed switching

Post by wouterlet »

That's why you should skip the first script. As I see it the last two are enough
poeschel
Posts: 13
Joined: Tuesday 21 April 2020 15:04
Target OS: Linux
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Help: Delayed switching

Post 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. :D
Version: 2021.1
Platform: Ubuntu server 20.04
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest