Program Logic Event Generator Plugin

Yes it is (and I forgot about that li’l gem :))

But that doesn’t explain why BLightsOn results in the same error message… :frowning:

And after having deleted one of the PLEG devices I had created, the device info remained in the Vera config, causing warnings & messages.

If you open the Automation → Triggers tab … You can find the old triggers. You can delete them there.
Vera does not provide a call to the plugin when you delete a device to allow me to clean up related information.

I though I put logic to detect this and correct it when you create a NEW PLEG or PLTS device.
If you delete all your triggers before deleting a PL?? device … you will not have a problem.

[quote=“RichardTSchaefer, post:42, topic:173496”]I though I put logic to detect this and correct it when you create a NEW PLEG or PLTS device.
If you delete all your triggers before deleting a PL?? device … you will not have a problem.[/quote]

I have to delete all triggers for all PL* devices before deleting a PL device & then recreate from scratch?

No just delete the triggers for the particular PL device you want to delete … before you delete the PL device itself. It should be pretty quick … just walk down the list clicking delete.

It should not hurt anything … a few ms of lost computer time … if you do not … it will just have noise in the log file.

A beta update to PLEG has been provide.
See the topic [url=http://forum.micasaverde.com/index.php/topic,13421.0.html]http://forum.micasaverde.com/index.php/topic,13421.0.html[/url] for details.
Fixes bug with using timer inputs in a boolean expression.

I’m starting to wonder whether I’m a complete moron…

I had 2 PLEG devices created. I deleted the triggers that were not associated with the (single) functioning PLEG device. Then I deleted the 2nd PLEG device (the one that’s not been working). And created a new one, which was given a new device number as well.

After creating the following triggers and conditions, I still get the status message seen below.

Program Logic : ItsWinter AND NOT t1BasementOff: Invalid Value token: T1BASEMENTOFF

Triggers:

Name	t1BasementOff	
Description	Lights Off Status - Basement: Triggered while virtual switch is on
Name	ItsWinter	
Description	 House: Summer Mode is turned off

Condition:

EnableBMHeat = ItsWinter AND NOT t1BasementOff

And under Advanced:

ConditionMap = [‘EnableBMHeat’,‘ItsWinter AND NOT t1BasementOff’]
TriggerStatusMap = { }

Maybe backup to last nights backup and start again …

Maybe also make sure there is no extra spaces, tabs, new lines, … after the variable names in the input editor.
I thought I checked for that … but maybe I did not.

Maybe start with the default input names …
See if it works that way …
You can rename your variables later in the input editor … it will update the condition expressions for you.
I a thinking that there is some strange non visible non ascii character that it’s hitting.

Start with a simple expression:
EnableBMHeat = ItsWinter
Then:
EnableBMHeat = t1BasementOff
Then:
EnableBMHeat = ItsWinter AND t1BasementOff

See if you can narrow down where the problem is.

[quote=“RichardTSchaefer, post:48, topic:173496”]Maybe also make sure there is no extra spaces, tabs, new lines, … after the variable names in the input editor.
I thought I checked for that … but maybe I did not.

Maybe start with the default input names …
See if it works that way …
You can rename your variables later in the input editor … it will update the condition expressions for you.
I a thinking that there is some strange non visible non ascii character that it’s hitting.

Start with a simple expression:
EnableBMHeat = ItsWinter
Then:
EnableBMHeat = t1BasementOff
Then:
EnableBMHeat = ItsWinter AND t1BasementOff

See if you can narrow down where the problem is.[/quote]

Spent the past 24 hours “fixing” vera. Renamed every scene & device to ensure none of them started with a digit (and took the opportunity to standardize my naming conventions). Deleted triggers created for PLEG, then the PLEG devices themselves. Deleted the PLCore device & then rm’ed the PLEG files in /etc/cmh-ludl/. Rebooted my Vera3 and started by installing PLCore & PLEG.

Created the first PLEG device and created 2 triggers (leveraging the Google Latitude & the Combination Switch plugins to create a presence “sensor”). This device has 2 triggers: HouseOccupied= ComboSwitch for “present” is active and HouseUnOccupied= ‘NOT HouseOccupied’.

Then created a 2nd PLEG device & created 4 triggers (also leveraging the Combination Switch plugin).

Triggers:

AllLightsOff_1st = Triggered when CombSwitch is on (which it is when all of the lights it monitors are ‘off’)
AllLightsOff_2nd = Same as above trigger but for 2nd floor lights
AllLightsOff_Basement = Same as above trigger but for basement lights
IsWinter = Triggers whenever the SummerMode vSwitch is off.

Restarted a number of times w/o any error messages, etc.

Then I created a condition (well, I created 3). And I got the same error message (“Invalid Value token”) again.

At this point, I’m thinking there’s a bug in PLEG (or PLCore). For some reason, the ConditionMap variable doesn’t get updated correctly (it always contains ‘[]’ when this error occurs). And from then on, it seems to be impossible to create any new working condition in any new PLEG device.

Not sure how/where you save the data (beyond in the devices themselves), but if it’s stored somewhere persistent (other than in the devices), that data store appears to be corrupted in my case(s).

Sorry, you misunderstood my message.
PLEG, or PLTS can not have it’s variable names start with a number.
This poses no restrictions on the Vera Device names.

I.e. you can have a Vera Device called “1st Floor Hall Light”
If you bind this to a variable in PLTS or PLEG you could bind this to a variable called:
“FirstFloorHallLight” … “1stFloorHallLight” would be illegal.

Send me a personal message … I will send you my contact message and you can call me … we should be able to work this out over the phone.

[quote=“RichardTSchaefer, post:50, topic:173496”]Sorry, you misunderstood my message.
PLEG, or PLTS can not have it’s variable names start with a number.
This poses no restrictions on the Vera Device names.[/quote]

No I didn’t. I was just making absolutely certain there was no way for my device/trigger/scene names to cause an issue with PLEG :slight_smile:

Will PM you.

Program Logic Event Generator: all phones OFF (if is true - turn OFF all devices in home)

INPUTS:
http://i.imm.io/UqoC.png

Condition:
all_phones_OFF = (phone_kate_ON;phone_kate_OFF;Now > 20) AND (phone_s2_ON;phone_s2_OFF;Now > 20)
or
(phone_kate_ON;phone_kate_OFF > 20) AND (phone_s2_ON;phone_s2_OFF > 20)
tried both Conditions - every not helped :frowning:

Program Logic Event Generator: any phone ON (if is true - turn ON all devices in home)

INPUTS:
http://i.imm.io/UqoI.png

Condition
any_phone_ON = phone_s2_ON OR phone_kate_ON

“phone s2” and “phone kate” are Ping Sensor plugins which ping every 5 sec. Sometimes it return false. I would like that “all phones OFF” will be TRUE if no ping from both phones for 20 sec. What I need to fix? It’s turn OF and ON a lot of times…

The following is correct:

all_phones_OFF = phone_kate_OFF and (phone_kate_OFF;Now > 20) AND phone_s2_OFF and (phone_s2_OFF;Now > 20)

The problem is that an expression with NOW is only evaluated every minute.
So it could take anywhere from 20 to 1:20 after the last phone off before this condition evaluates to true.

The reason that:
(phone_kate_ON;phone_kate_OFF;Now > 20)
does not behave as expected is that the timing is 20 seconds from phone_kate_ON not 20 seconds from phone_kate_OFF.

Thanks! Try it…

And what is correct for return back to home after for example 3 hours away any of 2 persons?

any_phones_ON = (phone_kate_ON and (phone_kate_OFF;Now > 10800)) OR (phone_s2_ON and (phone_s2_OFF;Now > 10800))

Right?

If it’s the Same PLEG than add the condition:

SomePhoneBackHome = (phone_kate_ON and (phone_kate_off; phone_kate_on > 3:00:00)) or (phone_s2_ON and (phone_s2_off; phone_s2_ON > 3:00:00))

This should respond immediately when one of the phones returns after indicating absent for more than 3 hours;

Thanks! I’ll try tomorrow and write results :wink:

p.s.

What is different between:
GarageClosed;GarageOpened;NOW > 30:00
and
GarageClosed;GarageOpened > 30:00
?

What is different between: GarageClosed;GarageOpened;NOW > 30:00 and GarageClosed;GarageOpened > 30:00 ?
The sequence expression with semi-colon separated elements requires that the elements must have been true in the specified order and the time from first element to last element must meet the conditions. It does not look at the current true/false status of the elements, only their time.

GarageClosed;GarageOpened;NOW > 30:00
Will fire 30 minutes after GarageClosed if the Garage is currently opened.
The garage could have been closed for 1 minute and then reopened. 30 minutes later it will trigger.
This is equivalent to:
GarageOpened and (GarageClose;Now > 30:00)
(This is only equivalent because (GarageOpened == Not GarageClosed))

GarageClosed;GarageOpened > 30:00
Will only fire if the Garage is opened after being closed for 30 minutes;

Hi Richard

This is a great initiative. Thank you very much for your plugins and they are extremely useful.

I see that PLEG Arm/Bypass mode is currently not working in the scenes. Could you please let me know if there is a fix going to be there soon?

Is it possible to use the Arm/Bypass in the condition itself similar to inputs? That way I disable or enable the PLEG triggers directly.

Thanks
Barath

Already done. Awaiting MCV approval.

See: [url=http://forum.micasaverde.com/index.php/topic,13421.0.html]http://forum.micasaverde.com/index.php/topic,13421.0.html[/url]
Only the actions are controlled by the Arm/Disarm state.

With Actions you can get rid of the external scenes and the triggers needed to link the Scenes to the PLEG. It’s much cleaner to have the inputs, condition logic, and action(Scene commands) all in one place.

The plugin allows two types of triggers to external scenes:
When condition XXX is satisfied.
When condition XXX is satisified and is Armed
The second one does not work because of a MCV bug. I have a patch (and have provided it to MCV).

Using the Device Property you can put the Arm/Disarm status in your condition expressions.

Thank You!! Looking forward to the release. Please let us know when MCV approves.