UPDATED: Program Logic Timer Switch Plugin

PLEG is oriented about understanding binary (They happened or they didn’t) events.
Unless you have an event that indicates the Room Temp is below SetPoint temp there is not much I can do.

Thanks R.T.S

[quote=“RichardTSchaefer, post:41, topic:173258”]PLEG is oriented about understanding binary (They happened or they didn’t) events.
Unless you have an event that indicates the Room Temp is below SetPoint temp there is not much I can do.[/quote]

Ok, I see what you are saying and in it’s current form I guess that can be done with Virtual switches.

Do you think your plugin could/will evolve so that trigger situations can be built in the UI and then ‘asked’ ?

By that I mean a Trigger could be built that asks the question "is the Room Temp less than the SetPoint? And to do that I could build a trigger that looks at different devices and their variables, or a UI value ?

Is [Device A]:[Variable C] = [Device B]:[Variable E]

If YES, then it acts as a trigger

(a Trigger Logic Builder is perhaps a better description)

I only have support for device triggers that have been defined by the plugin programmer for the particular device type. I could probably extend the definition … but only my plugin would be able to use these extensions … I will add to the wish list.

PLEG is already pretty complicated for the general user, but I believe it is simpler than LUA coding, it’s syntax, and having to learn about deviceIDs and serviceIDs.

Hi Richard,

First of all, thanks for a brilliant set of plugins which I’m sure will save many of a us a great deal of time.

I do however have a small problem implementing it as I keep on getting either one of these errors depending on how I structure my logic (see attachments for control logic):
Program Logic : KeyFobButton4 OR OfficeMotion > 15:00 OR OfficeTempAbove_20:[string “module(“L_ProgramLogicCCP”, package.seeall)…”]:55: Invalid Value token: 15:00
Program Logic : (KeyFobButton4) OR (OfficeMotion > 15:00) OR (OfficeTempAbove_20):[string “module(“L_ProgramLogicCCP”, package.seeall)…”]:325: Invalid Boolean Expression: OfficeMotion > 15:00

Current firmware version: 1.5.459

I’m trying to use PLTS to manage the heating in my outside office based on a schedule, temperature sensor and movement. But for some reason, I keep on getting one of the errors above when I try and use a Timeout with the Motion trigger. If I do not use brackets, I get a Invalid Token error and if I do use brackets, then I get a Invalid Boolean error. I have deleted and re-created the device a number of times starting from scratch, but always end up with the same result.

Do you or anyone have any idea why this is happening and how to get around it as I can’t seem to get past this error, or is this an error that can be ignored?

Thanks
Jacques

The > 15:00 is part of a Sequence condition expression.
If it is grouped with any other expression it must be enclosed in parenthesis.

The format of this is of the form:
Trigger1; Trigger2 … ; TriggerN > 15:00

This is an ordered sequence, replace the semi-colons with commas and you get an un-ordered sequence.
In this case if the triggers are ordered and TriggerN happens more than 15 minutes from Trigger1 … than this is true. In an un-ordered case if any of the events is more that 15 minutes from the latest … than it is true.

The syntax:
OfficeMotion > 15:00
Is invalid. What are your trying to accomplish with this ?

Got it. At first I could not work out why you would say that OfficeMotion > 15:00 is invalid, until I revisited the documentation and realized that it has to be part of a sequence and cannot be used on its own. :-[ Now it all makes and I have to go back to the drawing board and work out how I want to sequence things.

I have to admit that I’m new to MCV and am still trying to get my head around the whole system and how everything works together or not in this case. so the main aim for me at the moment is to learn how to program a Vera using all the various resources/tools, understand the limitations and discover best practices .

Richard, thanks for the quick reply and pointing me in the right direction.

What did you want it to do ? I can point you in the right direction … but It’s not obvious what you intended.

Wonderful stuff, just the type of high quality work the Vera needs!
Can I use the NOW variable to test for specific time. So instead of check Day or Night with your switch I want to extend the on time if the current time is >5:00PM and <10:00PM?
If so is the NOW variable in 24 hour time (i.e., 5:00PM = 17:00:00)?

Also, merely changing the logic statements does not trigger a Save by Vera. Is the “Save” necessary?

There are somethings that do not require a Save. Usually things on the Settings page do not require a save. I try to keep things on separate tabs to make the UI more predictable.

You can use absolute (24 HR Notation) in sequence expressions:

  Condition = Motion and (16:00:00; NOW; 23:00:00)

Thanks. So does this look correct:
Restart2=
(Motion; KitchenOnButton > 1:00) OR (Motion, NOW > 16:00:00 < 20:00:00) OR (Motion, NOW > 06:00:00 < 10:00:00)

first part from your sample, the rest should be if time is between 4PM and 8PM or, 6AM and 10AM then keep the light on for interval2.

(Motion, NOW > 16:00:00 < 20:00:00)
Although the syntax is correct the semantics for this state: This will ONLY trigger 16 Hours after the motion. Actually if NOW is within (Using comma instead of semi colon) 16 to 20 hours of the motion than trigger ... but since I have not released my crystal ball plugin yet :) this only makes sense for Now after the motion.

In this context the numbers > 16:00:00 and < 20:00:00 are relative times.

I think what you want is:

Restart2 = (Motion; KitchenOnButton > 1:00) or (Motion AND ((06:00:00; NOW; 10:00:00) or (16:00:00; NOW; 20:00:00)))

or:

Early = 06:00:00; NOW; 10:00:00
Later = 16:00:00; NOW; 20:00:00
Restart2 = (Motion; KitchenOnButton > 1:00) or (Motion AND (Early or Later))

Thanks!
Just confirming then
Early = 06:00:00; NOW; 10:00:00
pseudo code: NOW is between (inclusively) 6AM and 10AM

Correct!
In a sequence expression, a semi-colon indicates an ordered set of times.
Absolute times are taken to be in the current day!

Richard,

Loving all the plug-in love (Vera Alerts, Day/Night, PLEG, PLTS, etc). Thanks for letting all of us benefit from your work. Keep it coming!

I just switched over from Countdown Timer to PLTS this weekend. Love being able to keep the triggers all in one place instead of lots of scenes. The one thing I’m missing from Countdown Timer is seeing the time count down on the device screen. Definitely a “nice to have” feature vs. “must have”, but if you get the inclination to add it I’d be even happier than I am now (and that’s without a therapist!).

PLTS has been updated. You can now bind any Vera Device Property to an input that can be used in your condition expressions. Also support for math and string operations and comparisons have been provided. The web documentation has been updated. The first entry in this thread has been updated to reflect the current state of the plugin and provide a road map of what’s next.

@ChrisAZ
I have added the time remain to to the request list.

So, I’m not sure I know the best way to update an App/Plugin. I’ve seen a few threads but no advice.
Going to MiOS Apps will allow me to install it (it doesn’t say re-install or update).

It pains me to say that the simple way is as follows:

To Update Program Logic Timer Switch
http://Vera_IP:3480/data_request?id=update_plugin&Plugin=3018

To Update Program Logic Event Generator
http://Vera_IP:3480/data_request?id=update_plugin&Plugin=3066

To Update Program Logic Core
http://Vera_IP:3480/data_request?id=update_plugin&Plugin=3086

You should wait for Vera to restart between each update.

Wow. If I sent MCV $10 do you think they could add a button to the UI to do that? :-\

You have two potentential options to install the update version:
Option 1
Goto apps.mios.com login and then select your unit if presented with muliple units.
From the My Account select View Plugin Details
Identify the plugin you wish to update and open it by either clicking in the Plugin Name or View located on the right side.
Click on Versions located on the top right of the screen to display the version history sceen.
Under Actions click on Install for the version you wish to install.

Option 2
As Richard identifies…
In your browser use the following command.
http://Vera_IP:3480/data_request?id=update_plugin&Plugin=Plugin_ID

You need to replace Vera_IP and Plugin_ID to details obtained from your unit. The Plugin_ID is obtained from the Advanced Tab of the current installed version

Option 1
Can also be used to install a previous version.