We have moved at community.getvera.com

Author Topic: PLEG Basics - An Introduction to the Program Logic Event Generator  (Read 156509 times)

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #480 on: November 30, 2017, 04:43:10 am »
Sequence expressions only look at the timestamps and NOT the values.

So  (T1OrT2Expr; T3 < 10:00)   could be true even if  all three values are false.

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #481 on: November 30, 2017, 07:12:17 am »
Sequence expressions only look at the timestamps and NOT the values.

So  (T1OrT2Expr; T3 < 10:00)   could be true even if  all three values are false.

So, are you saying all I actually need is (T1OrT2Expr, T3 < 10:00) and M_Night  to get an action when t3 and one of the others have been true within 10 minutes.  no need for the other beginning portion of the statement?

by the way, my test last night and it's real use this morning sort of worked.  The results were not perfect but I dont have time to see why yet.  my question above may answer it though.

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #482 on: November 30, 2017, 09:35:38 am »
I believe it does work, at least well enough for me to play with and get right. 

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #483 on: November 30, 2017, 10:21:17 am »
The sequence expression could have been true 10 hours ago when M_Night becomes true the condition will become true.

One of the inputs will have to become true for the sequence expression to go false.

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #484 on: November 30, 2017, 12:09:14 pm »
The sequence expression could have been true 10 hours ago when M_Night becomes true the condition will become true.

One of the inputs will have to become true for the sequence expression to go false.

I'm confused. in a status report PLEG tells me if the expression is true or not. so if it did not become true within 10 minutes of seeing M-Night becoming true, or vice versa, wouldnt the condition remain false?  I thought since it knows if a condition/expression is true or not that it would know instead of knowing that a condition had once become true.

Doesnt the <10:00 limit it to only if they have become true within 10 minutes of each other?

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #485 on: November 30, 2017, 05:20:28 pm »
M_Night is not in the Sequence expression ... it's in the logic part of the expression.


Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #486 on: November 30, 2017, 05:42:24 pm »
M_Night is not in the Sequence expression ... it's in the logic part of the expression.

AH! I get it. If the sequence becomes true, how does it become not true then?

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1224
  • Karma: +15/-5
  • Black Cat Control Systems
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #487 on: November 30, 2017, 07:23:01 pm »
If the sequence is not "in sequence" then it is not and cannot be true.

I find it's easier working with complex conditions to break them down into smaller elements so you can easily test which works and which doesn't.

(T1OrT2xprE; T3 < 10:00) and M_Night

initially I would create a condition for T1OrT2xprE & T3 < 10:00 define them as cT and cT10 then once you have the logic working you can combine them as cT;Ct10 and M_Night



Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #488 on: November 30, 2017, 11:37:47 pm »
I think I have a working solution, it's ready to go into practice tomorrow morning to see if it works on a production environment instead of artificially triggering.  One foreseeable snag is if those triggers are activated as m_night becomes true....

Is there a way to also add the condition that m_night must have been true for at least X period of time before it can be a true condition?

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1224
  • Karma: +15/-5
  • Black Cat Control Systems
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #489 on: November 30, 2017, 11:41:48 pm »
try (M_Night>xmins)
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #490 on: December 01, 2017, 11:59:14 am »
try (M_Night>xmins)

Yeah....when I try that it throws an error on reload

Program Logic Event Generator[9] : (M_NIGHT > 30:00): Invalid Value token: 30:00

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #491 on: December 01, 2017, 12:26:56 pm »
M_NIGHT and (M_NIGHT;NOW > 30:00)

I think this works.

Offline Priest

  • Full Member
  • ***
  • Posts: 223
  • Karma: +9/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #492 on: December 04, 2017, 07:59:01 am »
Well, I ran with it for a couple days.... I think it is working.  The scenario worked this morning....ish

I really need to set up my Vista alarm panel and get motions over on to it rather than relying on the z-wave ones. I had some things work, then not work, then work again....I think it has to do with the way the zwave motion is spotty on reliability.  I also need to figure out why having tasker trip devices through AuthomationHD worked perfectly every time on my old phone, and now it doesnt on the new phone.  I may just have to trip devices with it through Imperihome instead and see if that is more reliable.

Offline Davit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #493 on: December 24, 2017, 03:31:25 pm »
Hello guys.

Paid for Pleg license and now trying to automate my gate closure based on the car passing by the IR security sensors.
To accomplish that, i have hooked up fibaro universal sensor's two inputs to the gate. So, first sensor will trip when the gate is open and the second when there is an obstacle (car) between the gate's IR sensor.
Now, i'm trying to create an action that will close the gate when
1. gate is open AND
2. the time between the IR sensor tripped and then untripped is more than 3 seconds (i.e. car passed, not person or a dog).

i got two triggers - tIR_SensorTripped and tIR_SensorUntripped

This should be something simple with a sequential expression, but i can't seem to find the proper way to get the point 2 work. So the following expression never gets true:

tIR_SensorTripped AND (tIR_SensorTripped; tIR_SensorUntripped > 00:00:03)

How can i fix this?

Thanks for your help
D.

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1224
  • Karma: +15/-5
  • Black Cat Control Systems
Re: PLEG Basics - An Introduction to the Program Logic Event Generator
« Reply #494 on: December 24, 2017, 05:51:19 pm »
Try (Now>00:00:03)


Probably not the best way to do this as Now evaluates every minute, likewise your sensor would probably have a time out period which could  cause problems with your logic. Really a 3 sec timer is preferable.


If it doesn't work as expected attache a pdf of the Status report so we can get the whole picture of what is going on rather than a snippet.
« Last Edit: December 24, 2017, 05:54:19 pm by zedrally »
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.