When gate is open too long , close it and send notification

You can disable the PLEG to stop it from working.

Your Scene - Enable (Arm) PLEG

In PLEG add the following

Bypass = NOT Test

When Test (Or the gate closes) it turns the PLEG off so it can’t activate again until the scene is run.

Doesn’t that mean I can not use PLEG for something else ( in the future)?

I guess when I bypass/disarm it ,it stops the whole of PLEG and not just the part for the gate, althoug I am for the moment just using it for the gate, I will probably use it also for other things.

Cor

Yes if you disable the PLEG it disable ALL actions (except the ARM action) for the PLEG.

Of course there are other ways to do this … you can have a Virtual Device … and use it in the logic … or you can use an ARMED sensor in the logic … then ARM/BYPASS the sensor to control the logic …

[quote=“Cor, post:20, topic:176782”]@ SirMeili, yes indeed it does make sense and sounds like a good idea. I wait a little implementing this , maybe there is an option not to use a virtual switch, and controll all via the scene/PLEG.

Good to know there is at least one solution.

Cor[/quote]

Cor,
I just switched mine to use the Multiswitch instead of the virtual switch. So now I can use it for 8 similar tasks or different tasks. I understand that you probably don’t want the extra device just floating around, but at least this way you can get more bang for your buck out of the one device. Just another option :slight_smile:

Tomorrow I am going to install the multiswitch ( that’s a good idea).

In the scene, switching the switch on >> got it.
switching the switch to off in the PLEG after the gate is closed … hmmmm , no I don’t get it. And associating the multiswitch to activate the < gate_open and (gate_open; Now > 03:00) > or not … no clue how to tackle that :-s

I will create a switch “manual gate only”
In the scene it goes to “on”
create a input in PLEG " manual_gate_only" from this device with multiswitch “on”

How do I tell PLeg to only activate the condition < auto_close> (gate_open and (gate_open; Now > 03:00)) when the multiswitch is on and afterwards switch it to off?

Cor

slowly I am getting what I want.

The multiswitch has just been installed and button 1 is now called “Auto Gate”

In Pleg I made an input “Auto_gate” with the Description “MultiSwitch Switch 1 is turned on” (attachment 1.jpg). So far so good I think.
In the condition Tab I inserted Auto_gate and gate_open and (gate_open; Now > 03:00) (attachement 2.jpg) And that is horribly wrong , since it isn’t working.

On the actions tab I clicked the multiswitch 1 button , so after the 3 minutes PLEG should close the gate and click the button 1, which should go to off than.

I think just the condition part is wrong.

Attached 2 screenshots.

Cor

Anyone has an idea to insert this in the PLEG condition?

Thanks,
Cor

Finally , I got it to work. Using a virtual switch did the trick.

Thanks ,
Cor

I want to extend it a bit.

now with this code:

Auto_gate1 and gate_open and (gate_open; Now > 03:00)

The gate closes after 3 minutes, when it has not been closed by the scene. There is a possibility that the gate turned the wrong direction and didn’t close with the “auto_close”

I would like to insert a second try to close after 5 minutes , will this code be correct insteadof the previous code?

Auto_gate1 and gate_open and (gate_open; Now > 03:00) and (gate_open; Now > 05:00)

Or will the 3 and 5 minutes now somehow collide?
thanks,
Cor

The new condition will only fire after 5 minutes. You may be better to split this into two conditions with their own actions:

cond1 Auto_gate1 and gate_open and (gate_open; Now > 03:00) cond2 Auto_gate1 and gate_open and (gate_open; Now > 05:00)

I know you do not like two conditions so here is one:

Auto_gate1 and gate_open and ((gate_open; Now > 03:00 < 4:00) OR (gate_open; Now > 05:00))

But actually if you kept the original condition and renamed it with an underscore(_) as the the first character.
This would try every minute (after 3 minutes) until it is closed!