PLUGIN: Rules Engine - V0.19.2

[quote=“konradwalsh, post:60, topic:189418”]@vosmont

This really is exceptional work and makes this significantly easier…
Please keep up the good work

@all
we should raise a bounty to motivate vosmont to keep going… this is going to make our lives much easier[/quote]

@konradwalsh, Thanks a lot for your encouragement !

@all,
I am making a big code refactoring, due to the problems detected on modification of rules.
Lots of bugs have been fixed and I hope I will commit the v0.08 in few hours.

No concern on my motivation… further to these bugs, my Karotz began roaring at 2 am that the door had remained open… my wife put a little pressure for it to be fixed :slight_smile:

Version 0.08 is available :

  • Big refactoring (still in progress)
  • Fix bug with device without service on legacy Vera
  • Fix bug on rule disarming erased when rules are modified
  • Add events “conditionStart” and “conditionEnd”
  • Add description on group of actions
  • Retrieve timestamp from linked variable (BatteryDate for BatteryLevel for example)
  • After xml injection, id of the new rules can be suppressed (they will be computed by the plugin)
  • Editing a rule only reload this rule

Known bug :

  • When you delete a rule, you will have to restart the Luup engine.
    There’s a desynchronisation with the xml file.

Great work…!!!

is version 0.08 on Github yet, I can’t seem to find it?

Sorry, I had just commited locally (I’ve forgotten to sync)…

It’s ok now

Vosmont, many thanks. Now to get my programming skills up to date, last used VBasic in excel 25 odd years ago!!! have done some PLEG work on Vera but mainly Cut and Paste. Have begun moving scenes and plugins from my Veraplus and Veraedge to OpenLuup on a raspberry pi 2 (just ordered Pi 3 for a little more speed).
Most of us hobbyists rely on the likes of yourself and Akbooer and amg0 to expand our capabilities, so once again Many thanks

David

does this matter?

3/5/2016, 8:31:23 PM Desynchronization: id #NaN of the rule at position 3 in the xml file is not the expected id #6. You should not save. ? 3/5/2016, 8:31:23 PM Desynchronization: id #NaN of the rule at position 2 in the xml file is not the expected id #5. You should not save.

Yes.
Perhaps have you delete a rule ?
You should reload the luup engine to resynchronize.

I’m just about to commit the version 0.09, which fix this bug.

cool…

so far it has been rock solid…

i am preferring this over pleg and scenes…

version 0.09 is available :

  • Code refactoring
  • Fix bug with deleting a rule
  • Show errors in history
  • Add icon for disabled rules
  • Fix bug on watch events not cleared on rule edit
  • Fix bug on enabling rule
  • Fix on a bug event conditionStart
  • Fix a bug with informations of rules lost at luup restart (e.g. disabled state)

Thanks for the updates

Sent from my ONE A2003 using Tapatalk

There’s a hot-fix for recurent actions (that are not stopped when the rule stop)

What is the purpose of - is acknowledgeable

When you have a rule with reminder actions (while the rule is active, these actions are done every x minutes), you can aknowledge this rule, and the reminder actions will be discarded (without changing the status of the rule).
When a rule is aknowledgeable, you have a new icon available.
The idea is : there’s a warning, you have noticed it and you want to ignore it.

Is there any documentation for the Rules Engine? The Actions are relatively straightforward if you can write scenes or use PLEG, but I’m finding the conditions a little confusing; for instance what are the arguments in "time is between hh:mm:ss and hh:mm:ss on days of week ( )? Thanks

For the moment, there’s not really a documentation.
This plugin was first some scripts in LUA that I used for my Home Automation.
Then I have added an UI to manage the editing of the rules.

So it’s in still in construction… a documentation would be quickly deprecated.

I’m trying to put tooltips on blocs in the UI, to explain them.
Since I’ve discovered mutations in Blockly UI, I’m trying too to simplify the blocks (use the gearing icon to change the block)

For time conditions, the block is not finished and has no mutator.
The parameters are the parameters of function luup.call_timer (http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_call_timer).
For days of week, if this input is empty, the condition will be filled for all the days of the week. Otherwise, you have to put the list of days for which the condition is filled (monday, thuesday → 1,2)

Thanks Vosmont, I’ll do some further research (ie Google) starting with the micasa wiki.

David

I’m liking what I’m seeing here, a lot of thought and dedication into making Vera into something that they (Vera) can’t do themselves.

I take my hat off to you Vosmont.

Paired up[font=verdana][size=1em] with Amg0’s AltUI and akbooer’s openLuup it presents an elegant, simple yet workable UI something that Vera find it impossible to offer to user’s.[/size][/font]

The dev’s at MIOS should hand their heads in shame.

Off topic, has anyone worked out how Sequences could be added in Blocky, it appears that this would be all that rounds off a fantastic Plugin.

Thanks zedrally :slight_smile:
What do you mean by sequences ?

^^^

Best explained by reading Sequence Expressions in PLEG Basics.
http://forum.micasaverde.com/index.php/topic,21603.0.html

An invaluable Conditional Tool.