Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

  • Topic Author
  • Posted
    4 hours ago, Brors94 said:

    Hi @jgab 
    Amazing to read that Eventrunner 6 is about x66 times faster then the event 5 version! :D

    What is it making the diffrence if I may ask? 🤔

     

    And how is the "eventlib" I am inn Love with is buildt compared to eventrunner 5 and 6? :D

    In ER5, I compiled EventScript to instructions for a virtual machine (also implemented in Lua).
    It's pretty sophisticated, flexible and, and reasonable fast for ER type of tasks - and I was also kind of in love with the idea of a vm...

    Now I compile to "Lua" functions directly.
    x. "assign" is one lua function, an "add" is another etc. and they are chained together to execute the code with a technique called CPS, continuation passing style. The code produced is a little worse than if one would hand code the ER rule in lua (using something like eventlib), ut very much more effective that having an vm interpreter level in-between like in ER5.

     

    eventlib requires a bit more lua coding skills, In EventScrip, rules are written in a very concise way to express triggers, scheduling, and time reasoning.
    That's why I'm using it myself for my daily automation tasks.

     

    It's straight forward to extend ER with your own lua functions etc - it could be used as the core engine for tailor made QAs with their own UIs - but of course an overhead of ca 130kb (which in year 2025 is not that much...)

    Posted (edited)
    17 minutes ago, jgab said:

    eventlib requires a bit more lua coding skills, In EventScrip, rules are written in a very concise way to express triggers, scheduling, and time reasoning.
    That's why I'm using it myself for my daily automation tasks.

     

    It's straight forward to extend ER with your own lua functions etc - it could be used as the core engine for tailor made QAs with their own UIs - but of course an overhead of ca 130kb (which in year 2025 is not that much...)


    Thanks for the explaination :D

    Follow up question :D 
    when I tried to use ER 4 or 5 (I dont remember) to make QAs with uis, I feel it overloaded the HC3 when I had serval of them running. Not just 1 "ER" that controlled alot of QAs. 

    But with the ER6 you mean I could use that instead of the eventlib? 🤔😄

     

    Edited by Brors94
  • Topic Author
  • Posted (edited)

    🚀 EventRunner 6 - Release v0.0.31

    Changes in v0.0.31

    •  Feature: Refactor and enhance EventRunner 6 functionality
    •  🐛 FixAdded new features and improvements in the builtins, compiler, parser, props, rule, and tests modules.
    •  🐛 FixIntroduced a custom Weather property object with various weather-related properties and triggers.
    •  🐛 FixImproved error handling for global variables and property resolution.
    •  🐛 FixEnhanced logging options for rule events and improved documentation for EventScript.
    •  🐛 FixUpdated rule handling logic and added support for new syntax in the parser.
    •  🐛 FixAdded tests for new features and ensured existing functionality remains intact.
    • 📚 Docs: update ToDo list with completed tasks
    • 🐛 Fix: id:prop assignment when id is number
    • 🐛 Fix: add warnings for undefined GV and runtime errors
    • 📚 Docs: update Recipes.md for clarity and accuracy
    • 🐛 Fix: correct time format for light scheduling rules
    • 🐛 Fix: update Earth Hour section title for spelling
    •  Feature: add restart rule for Daylight Savings Time adjustments
    • 🐛 Fix: correct comparison operator in light activation rule
    • ♻️ Refactor: increase loop iterations in stress test

    Generated automatically from git commits

    📥 Download

    • GitHub Releases: 

      Please login or register to see this link.

    • Direct .fqa files: 

      Please login or register to see this link.

      , 

      Please login or register to see this link.

    📚 Documentation

    • Full Documentation: 

      Please login or register to see this link.


    This release was automatically generated from commit 266fc8b

    Edited by jgab
  • Topic Author
  • Posted (edited)

    An interesting case:
    I helped @Sjakie to see how his ER5 rules could port to ER6.

    There's 2 areas of problems...

    1. There are stuff in ER5 that doesn't exist in ER6.

    2. ER6 still have bugs as it has not been tested extensively yet.

     

    So, he has 8 ER6 QAs, running a total if 1315 rules, and using 257 devices of 30 different types...
    When he run his ER5 rules in ER6 he got a lot of errors, due to the reasons above....

     

    So, I created a support file, instantiating fake devices for the 257 devices (he gave me a list that I parsed automatically) - the 30 different types could be covered by ~6 different virtual ER6 devices (sharing same methods, temperature, lux, dimmer all have getValues etc.)

    Also setup fake global variables that were used by his rules.

     

    I run his QAs offline in Plua and could quickly see where ER6 was buggy, or he was using unsupported features (and he had some of his own bugs too).

     

    It was about a mornings work, all 8 QAs load without giving errors

    - I found a slew of bugs in ER6

    - I got some good ideas how to improve ER6 for usability (no better feedback than trying to run a QA with 222 rules and trying to understand what's going on...)

     

    So, it doesn't mean that now his rules will do what he expects of them . debugging the logic is another matter 

    ...but I got invaluable feedback on ER6 - so I'm a happy man :-) 

    Edited by jgab
    • Like 2
  • Topic Author
  • Posted

    🚀 EventRunner 6 - Release v0.0.32

    Changes in v0.0.32

    • 🐛 Fix: improve error handling in eval function
    • 🐛 Fix: update property access syntax in parser
    • ♻️ Refactor: enhance rule logging with warning prefix

    Generated automatically from git commits

    📥 Download

    • GitHub Releases: 

      Please login or register to see this link.

    • Direct .fqa files: 

      Please login or register to see this link.

      , 

      Please login or register to see this link.

    📚 Documentation

    • Full Documentation: 

      Please login or register to see this link.


    This release was automatically generated from commit 7845913

    Posted

    ER6 looks promising :) I'm still on ER4 :) but I would like to migrate to ER6.

    Could you pls show me a few examples how to work with remotes - ie. rule that will work if any button willl be pressed, rule for press specific button, rule for long press specific button ...

    Thanks

     

    Posted (edited)
    23 minutes ago, petrkl12 said:

    ER6 looks promising :) I'm still on ER4 :) but I would like to migrate to ER6.

    Could you pls show me a few examples how to work with remotes - ie. rule that will work if any button willl be pressed, rule for press specific button, rule for long press specific button ...

    Thanks

     

     

    I guess this is what you look for? 🤔 (some of it) :D 

    Please login or register to see this link.

     


     

     

    Edited by Brors94
    Posted (edited)

    ok you mean this:

     

    Please login or register to see this code.

    perfect, thanks

     

    and for any key from remote or long press ?

    Edited by petrkl12
    Posted

    I have this rules:

    Please login or register to see this code.

    but result is

    Please login or register to see this image.

    /monthly_2025_09/image.png.73fa845ceca36fe77f24bb72aad4043c.png" />

     

    Posted (edited)

    another issue with rules:

     

    Please login or register to see this code.

    error: Rule has no triggers 'trueFor(timeLightsOff,HT.Pracovna.PohybPracovna:safe) => lightsPracovna:off;lo..'

     

    how to use variable timeLightsOff?

    Edited by petrkl12
  • Topic Author
  • Posted (edited)
    15 hours ago, petrkl12 said:

    I have this rules:

    Please login or register to see this code.

    but result is

    Please login or register to see this link.

     

    Please login or register to see this code.

    So, :central returns the centralSceneEvent value as-is in a backward compatible way.
    However, if you apply it on an table of remotes you get a table back with {nil, nil, ..., event, nil, nil} with the event from the remote that sent the event.
    There is the :id property that we can chain that returns the deviceID of the device that generated the event. Then when we apply :central on that we get the key values...
    However, there is a new prop, :key that returns a more "advanced" result. It returns the table {id=<id>,attr=<attr>} so we can test :key.id == x
    The :key value also "automatically" converts to a string so we can test against the whole :key value as a string "<key>:<attr>" as in the second example.

     

    15 hours ago, petrkl12 said:

    another issue with rules:

     

    Please login or register to see this code.

    error: Rule has no triggers 'trueFor(timeLightsOff,HT.Pracovna.PohybPracovna:safe) => lightsPracovna:off;lo..'

     

    how to use variable timeLightsOff?

    Ooooh, that was a nasty bug. Fixed in v0.0.37
    Thanks, for spotting it!

    Edited by jgab
    • Like 1
    • Thanks 1
    Posted

    Please login or register to see this code.

    [08:33:02] [ERROR] [QUICKAPP500]: [Rule:130]: ["var","efmt"]: Expected function, got: nil (disabling

  • Topic Author
  • Posted

    Please login or register to see this code.

    is not implemented in ER6 (like elog). 

    Posted

    @jgab this rule doesn't work 

    Please login or register to see this code.

     

    Posted

    Please login or register to see this code.

     

    Posted

    it works :) Thanks 

  • Topic Author
  • Posted
    11 hours ago, petrkl12 said:

    it works :) Thanks 

    wait(+/00:00:05) and wait(00:00:05) happens to be the same now. wait to 5s from now, and wait 5s...

    Currently wait will just wait the seconds specified, and it doesn't support "long times".

    Time constants like 00:00:05 are compiled to just a number, the seconds. So, 00:01:00 becomes 60 etc.
    These are what I call "short times"

    However the +/00:00:05, t/15:00, n/10:00 are "long dates", a full epoch time (what we get from os.time()).
    At the moment wait treats all times as short numbers and add it to the current time. So +/00:00:05 becomes 
    current time + current + 5s for the wait command... which is a bit long...
    Anyway, next version of ER6 will support long times given to wait (like ER5 did). It's quite practical to being able to wait to a specific
    time, like wait(t/15:00) -- wait to 15:00, without having to calculate the delay.
    So, if wait gets a large number it will consider it a long time, a small number (less then 3600*24*14) will be considered a short time...

    • Thanks 1
    Posted (edited)

    How to do it this in ER6?

     

    Please login or register to see this code.

     

    and how to triger and read value from this propert in ER6 ?

     

    Edited by petrkl12
    Posted

    Jan I saw 3 errors in debug error....... disabling

    I modified one and save the QA.

    In Debug window I select >>>Error >>> Empty screen

  • Topic Author
  • Posted (edited)

    🚀 EventRunner 6 - Release v0.0.40

    Changes in v0.0.40

    •  Feature: add support for dynamic custom event triggers
    • 🐛 Fix: correct logic for async wait time adjustment
    • 🐛 Fix: ensure proper handling of debug information in mergeDbg
    • 🧪 Test: add tests for new event trigger functionality
    •  Feature: enhance tutorial with basic functionality section
    • 📚 Docs: add forum post helper for release announcements
    • 🐛 Fix: update global variable handling in builtins
    • 🐛 Fix: improve global variable retrieval in compiler
    • ♻️ Refactor: streamline alarm property checks in props
    • 🐛 Fix: refine source trigger debug logic in utils
    • 🧪 Test: add alarm event handling in tests

    Generated automatically from git commits

    📥 Download

    • GitHub Releases: 

      Please login or register to see this link.

    • Direct .fqa files: 

      Please login or register to see this link.

      , 

      Please login or register to see this link.

    📚 Documentation

    • Full Documentation: 

      Please login or register to see this link.


    This release was automatically generated from commit a9d7769

    11 hours ago, petrkl12 said:

    How to do it this in ER6?

     

    Please login or register to see this code.

     

    and how to triger and read value from this propert in ER6 ?

     

    "dynamic event triggers", e.g. table's that are not constants, were skipped - I have fixed that so your trigger will work. v0.0.40

    The match variables are available with heir names as local vars, so valSt, in your case, $valSt would be a reference to a fibaro global with name valSt.

    Also fixed so that wait(+/00:00:05) works

    6 minutes ago, Sjakie said:

    Jan I saw 3 errors in debug error....... disabling

    I modified one and save the QA.

    In Debug window I select >>>Error >>> Empty screen

    Ehh, I need more info about what's going on...

    Edited by jgab
    • Thanks 1

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...