First simple PLEG try, problems to understand

Hi I’m trying to use PLEG, seems impressive and very usefull. I want to use a virtual switch to arm or disarm PLEG, See below. However this doesnt seem to work. When i use the virtual switch nothing happens in PLEG??

Please help

Thanks, Paul

Program Logic Event Generator

Device ID: 292014-01-18 14:03:56.371 PLC Version: 5.5

Triggers

Name Description Last Trigger State
AutOn Automation switch is turned on 2014-01-19 13:54:01.452 true
AutOff Automation switch is turned off 2014-01-19 13:53:57.799 false
Schedules

Name Type Time Days Random On Delay Off After Type Off Time Off Days Random Off Delay State Last Schedule
AutOnSchedule Weekly 12:00:00 1,2,3,4,5 None Weekly 13:00:00 1,2,3,4,5 None false 0
Conditions

Name Expression Last True State
cAutOn AutOn == 1 2014-01-19 13:54:01.453 true
cAutOff AutOff == 0 2014-01-19 13:54:01.457 true
Actions

Actions for Condition: cAutOn

Immediate

Device Action Arguments
Program Logic Event Generator SetArmed newArmedValue=1
Actions for Condition: cAutOff

Immediate

Device Action Arguments
Program Logic Event Generator SetArmed newArmedValue=0

Is the PLEG armed ?

Maybe it’s just me - but I don’t think you can ARM the PLEG from within PLEG if it’s not armed …

/Martin

You can arm it manually from the Device Control on the Dashboard.
You can also arm/bypass it programmatically with the reserved condition names ARM and BYPASS

[quote=“RichardTSchaefer, post:4, topic:178956”]You can arm it manually from the Device Control on the Dashboard.
You can also arm/bypass it programmatically with the reserved condition names ARM and BYPASS[/quote]

?
I thought that BYPASS meant that actions are not fired; How can the action to change PLEG from BYPASS to ARM fire, if the PLEG is on BYPASS ?

/Martin

[quote=“flyveleder, post:5, topic:178956”][quote=“RichardTSchaefer, post:4, topic:178956”]You can arm it manually from the Device Control on the Dashboard.
You can also arm/bypass it programmatically with the reserved condition names ARM and BYPASS[/quote]

?
I thought that BYPASS meant that actions are not fired; How can the action to change PLEG from BYPASS to ARM fire, if the PLEG is on BYPASS ?

/Martin[/quote]
The special conditions for Arm and Bypass don’t need actions so they are not inhibited by the PLEG being in Bypass.

In the PLEG Basics pdf, it describes this special device action:

SetArmed - Set PLEG Arm/Bypass as specified by newArmedValue. 1 = Arm, 0=Bypass.

I have tried this and I can set the PLEG to BYPASS using this action, but once bypassed, it will not ARM by using the action “newArmedValue = 0.” Is that the correct behavior? However, I should be able to ARM or BYPASS a different PLEG by using this action, yes?

However, within the PLEG, I can still both ARM or BYPASS using the ARM & BYPASS conditions, correct? I am trying to set up some vacation parameters and still struggling with the best way to do it.

In the PLEG Basics pdf, it describes this special device action:

SetArmed - Set PLEG Arm/Bypass as specified by newArmedValue. 1 = Arm, 0=Bypass.

That should be removed from the documentation.

[quote=“RichardTSchaefer, post:8, topic:178956”]

In the PLEG Basics pdf, it describes this special device action:

SetArmed - Set PLEG Arm/Bypass as specified by newArmedValue. 1 = Arm, 0=Bypass.

That should be removed from the documentation.[/quote]

I’ll remove it from the next version.

However, within the PLEG, I can still both ARM or BYPASS using the ARM & BYPASS conditions, correct?

Yes. The ARM and BYPASS Conditions don’t require Actions so ARM will work even if the PLEG is Bypassed.

I am trying to set up some vacation parameters and still struggling with the best way to do it.

Rather than Arm/Bypass the whole PLEG, you could also add an OnVacation term to some of your Conditions. OnVacation could be a Condition that includes absolute Schedules and/or a VirtualSwitch.

Hello, thanks for the help!
Rexbecket: I used your solution: works fine

Could someone be so kind as to explain what a virtual switch is and how I create one.

Slowly getting my head around PLEG - it looks great.

VirtualSwitch is a plugin that creates a device that looks, in Vera’s UI, like a normal Z-Wave switch but has no hardware component. It can be turned on or off through the UI buttons and by using actions from scenes or other plugins. They are very useful for indicating various states like Home/Away, VacationMode, etc.

You can install it from the mios app store: Virtual Switch