We have moved at community.getvera.com

Author Topic: PLEG Next Gen UI  (Read 28059 times)

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
PLEG Next Gen UI
« on: March 11, 2016, 09:39:22 am »
Folks,
  I am at the beginning of a new development cycle for PLEG.
  My intentions are to be much more graph oriented.
  It will be UI7 only and will likely open it's OWN window for editing.
   
  See the attached demo snapshot.

 I will use the output of the graph editing to make significant performance improvements.
1) I will pre-compile all of the condition graphs.  (Currently I parse and eval each condition) each time any input changes.  Now it will execute LUA code directly for each condition evaluation.
2) I will use the graph to ONLY eveluate conditions that are effected by changes in the specified input.
3) You will be able to attach actions when an INPUT to the actions (is true, is False, or changes (boolean or any other value) with a REPEATS option.
     You will be able to attach actions directly to an INPUT without needed to create a trivial condition.
     Since you can connect to ANY change ... you can use the Same Condition and Action to turn on/off a light.  Using the value of the condition in the Argument of action
      i.e. a  SetTarget   with a value of ({ConditionValue})

The graph will also be able to be used for Analysis of your logic (i.e. a different view of the Status Report)
1) It will be annotated with the State and TimeStamps of all inputs and Conditions.
2) It will have the ability to focus on an Input (and see only the graph that is effected by it) or a Condition (and see only it's graph back to all inputs and downstream actions and conditions).
3) From the Graph you will still be able to DoItNow on schedules and Actions.

I also plan to remove the need to RESTART LUA  on editing.  It will re-init itself as changes are made.

For Alpha Testing:
Just upload the attached files to your Vera (APPS -> Develop Apps -> LUUP Files -> Upload)
(You down't need the Demo.png file!)
You need to restart Vera after upload the .json file. Remove the .txt extension from the .js file.

This will add another option at the end of the PLEG panel (Scroll down).

Every thing is in the "Edit" panel. You should be able to inter-operate between the two editors, but I would refresh the browser if you want to go back to the OLD editor.

NOTE: I renamed the .js file since the initial release. You will need to re-download both files.
Remove the ".txt" from the J_PLC.js.txt  to upload to Vera.
Pick one of the .json files and Remove the -XXX from the name to upload to Vera.
You will have to download J_PLC.js.txt from: https://drive.google.com/file/d/0B3koQ6Ncw6jdWVFIZjBqOUxwVjA/view?usp=sharing

This file is too big for the Forum ... I have included dependent javascript files inside it to make it easier to test.
« Last Edit: May 08, 2016, 05:32:10 pm by RichardTSchaefer »

Offline sebby

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +15/-3
Re: PLEG Next Gen UI
« Reply #1 on: March 11, 2016, 09:48:09 am »
This looks like it would be fantastic.  One suggestion though, when i think of rules, i kind of view them as a flowchart and maybe following that standard would make a very clean interface (see image).  Just my $.02

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1302
  • Karma: +33/-13
Re: PLEG Next Gen UI
« Reply #2 on: March 11, 2016, 01:15:10 pm »
It all sounds good to me.  I figure I am headed for UI7 sometime over the summer...
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1224
  • Karma: +15/-5
  • Black Cat Control Systems
Re: PLEG Next Gen UI
« Reply #3 on: March 12, 2016, 04:50:11 am »
Most exciting.
I'm hoping that any future developments will include compatibility with amg0 altUI & akbooer's openLuup.
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 konradwalsh

  • Hero Member
  • *****
  • Posts: 566
  • Karma: +19/-6
Re: PLEG Next Gen UI
« Reply #4 on: March 12, 2016, 06:05:57 am »
Competition is good for us...  😜

Sent from my ONE A2003 using Tapatalk


Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Next Gen UI
« Reply #5 on: March 12, 2016, 10:29:57 am »
By putting my UI on it's own panel it should be easier to integrate with AltUI.
There are a couple of other design changes I need to make to run on OpenLUA.
It's my goal to get there.
I will add that to my Next-Gen objectives.

Offline new2me07

  • Jr. Member
  • **
  • Posts: 92
  • Karma: +2/-4
Re: PLEG Next Gen UI
« Reply #6 on: March 12, 2016, 12:56:11 pm »
As someone who cannot save ANYTHING in PLEG on UI7. A dedicated save button and confirmation text would make me sleep easier at night. This might be handled by the no need to restart luup, but confirmations are priceless at this point.

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: PLEG Next Gen UI
« Reply #7 on: March 12, 2016, 01:01:17 pm »
Competition is good for us...  😜

The current events are hot !  :)
From my point of view it's not really competition, the goals are not exactly the same.

There are a couple of other design changes I need to make to run on OpenLUA.

The plugin on openLuup can not use lzoenc format (encrypted), so perhaps it could raise an issue.

Offline korttoma

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +26/-5
Re: PLEG Next Gen UI
« Reply #8 on: March 12, 2016, 02:27:45 pm »
Looking forward to seeing the result of your development Richard!
- Tomas

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1224
  • Karma: +15/-5
  • Black Cat Control Systems
Re: PLEG Next Gen UI
« Reply #9 on: March 12, 2016, 03:17:20 pm »
PLEG & RP2 is the final destination....perfection.
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 KewlRobD

  • Full Member
  • ***
  • Posts: 105
  • Karma: +3/-4
Re: PLEG Next Gen UI
« Reply #10 on: March 12, 2016, 11:31:10 pm »
What I would love to see is some way to import or export via a file. Maybe a CSV or something like that.  Personally I keep my configs in an excel spreadsheet and create new tabs when making changes.  If I need to roll back or have a situation where I need to reset to factory it is very easy to copy and paste the conditions but it would be even better if I could somehow just import a file.  I am not a programmer so really don't know what the possibilities are. 

Offline xeinth

  • Full Member
  • ***
  • Posts: 144
  • Karma: +1/-1
Re: PLEG Next Gen UI
« Reply #11 on: March 13, 2016, 07:07:01 pm »
I think a entry method more akin to a state matrix, using conditions and inputs as the transitions is something worth considering.  Today this is a bit difficult to do, as a state machine implies states are mutually exclusive, and conditions don't necessarily do that.    Fundamentally any 'flow' can be represented as a state machine, but it could be easier to enter as a table and use the graphical flow as more of a visualization. 

Once the state machine is created, actions can be assigned to the states as we do today with conditions...

x

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Next Gen UI
« Reply #12 on: March 13, 2016, 09:05:02 pm »
@xeinth

Do you have an example or a reference ?

I am not sure I fully understand what you are stating.

In particular I am interested in an example that shows how a state matrix simplifies the logic definition.
 

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: PLEG Next Gen UI
« Reply #13 on: March 13, 2016, 09:09:54 pm »
@KewlRobD

PLEG already has an EXPORT and an INPORT for saving a single PLEG's definition. The problem is that it can't be imported to another machine, or after some devices it has referenced are deleted and posible re-created because the export has references to DEVICE IDs for both the INPUTS and the ACTIONS.

I will add to the list to save the export with references by NAME and allow rebinding do a new device ID on INPUT, and if the INPUT is not found it will allow you to specify the new Device Name.

This should solve a number of request to be able to import to another instance and rebind ...


Offline xeinth

  • Full Member
  • ***
  • Posts: 144
  • Karma: +1/-1
Re: PLEG Next Gen UI
« Reply #14 on: March 13, 2016, 10:05:34 pm »
@xeinth

Do you have an example or a reference ?

I am not sure I fully understand what you are stating.

In particular I am interested in an example that shows how a state matrix simplifies the logic definition.

Here is an example I came up with.

https://docs.google.com/spreadsheets/d/1XVdvLu-HxwkF0h-jwe992GqfEqXwuv0biQCkYcAWX40/edit?usp=sharing

Basically the idea is a light tied to a motion sensor, but it only works at night or when the house is in night mode.  A switch can be used to specify an override which extends a minute timeout to 30minutes, but ONLY when in night mode, not when its merely dark outside.  The motion detector can reset the state and resume checking for the current dark/house mode condition to reset the timers.  What makes this a big hard for PLEG today is these states are all mutually exclusive, and you can't get to certain states without progressing thru other first.   It ensures order of operations, if you will.

You'd still need inputs defined on one page, and actions associated to states.  Otherwise you just need to specify the transition table.  This basically recreates the flow you are describing graphically, so perhaps its redundant but at least I wanted to highlight the use case.

x