Program Logic Event Generator Plugin

Sorry, can you explain with one more example. I need to run scene if no one phone_kate_ON and phone_s2_ON for last 3 minutes. Which is correct and what is different:
phone_kate_OFF AND (phone_kate_ON; phone_kate_OFF > 180) AND phone_s2_OFF AND (phone_s2_ON; phone_s2_OFF > 180)
phone_kate_OFF and (phone_kate_OFF;Now > 180) AND phone_s2_OFF and (phone_s2_OFF;Now > 180)

To understand these you need to know two things:

  1. Under Which Situations will the conditions be evaluated.
  2. How to understand the behavior of the sequence expressions.
    [hr]
    The condition Expressions are evaluated when ever an input Trigger is fired, a Device Property is changed, or a Schedule has arrived. Also if the NOW clause is used then conditions are evaluated every minute.
    [hr]
    There are two types of sequence expressions. Ordered (Semi-colon separated) and UnOrdered (Comma separated) tokens. In the Ordered case, the last time the specified elements became true must have been true in the order listed or the expression returns false. Then it computes the delta time from the oldest element to the newest element. This delta time is used in with the optional constraints. If specified … these constraints must also be true or the condition returns false.
    [hr]
    Let’s look at fragments of the two case you have submitted:
    (phone_kate_ON; phone_kate_OFF > 180)
    This is true only if phone was turned off after it was on for 3 minutes.
    Also it’s only evaluated when the triggers happen … There is nothing to cause evaluation 3 minutes later, and even if it did … the clause would not provide the behavior your desire. This is not what you want.

Now:
(phone_kate_OFF;Now > 180)
This is evaluated every minute. 3 Minutes after phone_kate_OFF became true this expression will be true. But a sequence expression does not care if the elements are still true! That’s why you use:
phone_kate_OFF and (phone_kate_OFF;Now > 180)

So the second one will achieve your objective.

Great! Now I understand :slight_smile:
Is any way to run scene no more frequently than once per hour? For example, when detect motion - say hello, not not more than 1 time in a hour :slight_smile:

Is any way to run scene no more frequently than once per hour? For example, when detect motion - say hello, not not more than 1 time in a hour

How about the following condition:

TalkToMe = Motion and (TalkToMe; Motion > 1:00:00)

Version 2.0 is now available at the APP store. (Also upgrade to 2.0 for Program Logic Core plugin.)
It includes support for Actions.
This completes the major functionality for this plugin.

Well done for getting this all approved. I’ve updated my beta versions to 2.0 and everything is working well.

May I repeat a request from the now locked beta thread?

Would it be possible to implement a function: Random(hh:mm:ss) which returns a psuedo-random time between 00:00:00 and hh:mm:ss? This would be great for switching lights on and off when away from home.

It would be a valuable addition to a future release.

Check out the vacation ghost plugin. It's designed to perform this particular task.

Thanks for the suggestion. I’ll give that a try once they get the major bug sorted.

Would it be possible to implement a function: Random(hh:mm:ss)

I am not sure I want to open up the condition expression evaluation to functions.

I have toyed with the idea of exposing pre and post evaluation LUA code.
The LUA code would be able to references (READ) Input Values an modify (READ/WRITE) condition values.

Hi Richard

I have updated PLEG to 2.0 version. I do not see anything in the “Actions” Tab. All i see is a “?” as in the previous versions.

Should i have to do anything different?

Thanks

Upgrade to 2.0 for the Program Logic Core plugin as well.
Then refresh your browser.

Thanks Richard… That helped!!!

Hi Richard

In the Actions, i want to call sequence of actions.

For HeaterON condition:

  1. Turn on Power to Heater
  2. Wait for a Minute (for the thermostat to boot)
  3. Set the Thermostat

Similarly for the HeaterOFF condition i want to do the following…

  1. Turn HEATER OFF
  2. Wait for 2 Minutes
  3. Turn OFF FAN
  4. Wait for a minute
  5. Turn OFF Power

So in the Advanced Tab under Actions, i see i can call the above sequences. But i do not see an option to add Delay.

Please let me know how can i add delay in the sequence.

Thanks

I am not sure I want to open up the condition expression evaluation to functions.

OK so one alternative is for me to create a plugin that returns a randomized time value and then use that as an input to PLEG so I can have a condition expression like: SomeState; NOW > RandomizedTime. Will that evaluate OK? Would RandomizedTime need to be an offset (eg. 600 seconds) or absolute time (eg. 19:10:00)?

OK so one alternative is for me to create a plugin that returns a randomized time value and then use that as an input to PLEG so I can have a condition expression like: SomeState; NOW > RandomizedTime. Will that evaluate OK? Would RandomizedTime need to be an offset (eg. 600 seconds) or absolute time (eg. 19:10:00)?

I already answered my own question: You can’t take a value through an input and evaluate it in a condition expression. Back to the drawing board…

I have a scenario that I’m having trouble getting the correct logic. I have my deck light turn on if it’s night and the deckdoor is opened. (Night and DeckDoorOpen) This works great, but when I let the dog out I want the deck light to turn off after the door is shut again (show below). Right now I just have the deck lights turn off on a 3 minute timer BackFloodLightsOn; NOW > 3:00 (So after the last door open, 3 mins later they shutoff)

Door is opened to let dog out, door is closed (but light needs to stay on while dog is out), door is opened to let dog back in, door is closed(want light off).

I need the light to turn off on the last door is closed. I think I need to use a Program Logic Timer Switch but just not sure how to set it up.

Thank you

You can do almost anything with PLEG that you can do with a PLTS.
What PLTS allows you to do is to manually (from the web interface) start, reset, stop, … the timer independent of the conditions specified to have it run automatically.

You can still have PLEG auto start/stop the light when the door is open at night.

In addition I can think of multiple solutions to address your problem … Not sure which will work for you:

  1. You can setup the PLEG to NOT turnoff the light if you turn the light on first (to let the dog out).
  2. You can setup the PLEG to use a longer timeout if you turn the light on manually (to let the dog out).
  3. You can have the PLEG not turn the light off while the door is open (because the dog is out).
  4. A more sophisticated version might be:
    a) Auto On/Off when door opens (Same as all above)
    b) Manual On/Off when light comes on first before door is opened.
    c) Auto Off with a longer delay if I flick the lights on/off/on before I open the door.
  5. Variations on the above would be to flick the lights off/on after auto-on to leave on for a manual off or a longer auto-off.

the only thing I get on Input Tab : Opening pleg_Inputs and on action tab the same

and

and in the event screen : Program Logic Event Generator : Install Program Logic Core Plugin

@RichardTSchaefer, that did the trick

Then I suggest that you:

Install Program Logic Core Plugin

This is needed by both the Program Logic Event Generator and the Program Logic Timer Switch plugins.

Good day,

Thank you for writing this very necessary plugin.

Okay, so I’ve got a Paradox EVO alarm currently integrated and working correctly.

I have a regular ‘vanilla’ scene that arms the system in “Stay” mode, upon sunset. What I’d like to do, is use your app’s condition field to cause it to only do this if the system is disarmed. Reason being, is if I am away, and the system is in “Away” mode, I don’t want it to revert to “Stay” mode simply because it gets dark.

I am having difficulty figuring out how to write this condition properly. I have read the documentation on Conditions for Program Logic Event Generator, and Program Logic Core, and can’t figure out how to go about this. Your description is stellar, but I wonder if some more examples might help my puny brain.

Thanks in advance!

I’ve just installed the Program Logic Event Generator, followed swiftly by the Program Logic Core plugin and am suffering from the same issue as @Peter, 3 posts above.

If I click on the Inputs tab, I get “Opening plug_Inputs…”, and when I click on the Actions tab, I get “Opening pleg_Actions…”. These messages are never replaced with anything useful.

I’ve uninstalled and reinstalled the plugins, and rebooted Vera, but the issue remains.

Any ideas?

Thanks

Ian

A simple rule to follow when adding any new device or plugin to Vera.
(Wish it was not so!)

  1. Reload Vera (Upper right corner)
  2. Reload the browser window. (Reload this Page in Chrome, Refresh in IE)