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

Posted

Jan,

All QA's on ER6, ER5 QA's are deleted.

Need to concentrate to smooth the actions off the HC3 and implementing YahueV2.

Can't tell if it works okay due to HC3 shut off last night some external power problem in the media.

All errors almost tackled.

For convenience perhaps the orange marking in debug back  if QA is started.

The error reporting is magnificent! 

At this moment there is not too much movement at the apartment, is this the cause of low load on the HC3 but I see:

processor usage very low has never been on that level, basic 15% regular peeks 30%  incidental 60% and before basic 30-40% peeks 80%

Memory seems almost the same as  before start level 42% instead of 48%

I hope it will return the not used buffer back to the system instead of consuming it.

If no interference from me I need to restart at max 450 hours because off drastic delay execution.

So proficiat with your Eventrunner6!!

Will come back to solve a few more errors  who are blocked at the moment 

  • Like 1
Posted

Jan, look at the concept below please. 

Please login or register to see this code.

 

  • Topic Author
  • Posted

    🚀 EventRunner 6 - Release v0.0.27

    Changes in v0.0.27

    •  Feature: add Earth Hour functionality to automation recipes rules
    • ♻️ Refactor: improve rule handling logic for variable assignments
    • 🐛 Fix: correct error message in parser for unexpected statements

    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 308087e

  • Topic Author
  • Posted
    27 minutes ago, Neo Andersson said:

    Jan, look at the concept below please. 

    Please login or register to see this code.

     

     

    Please login or register to see this code.

    Please login or register to see this code.


    Seems to work. Is callback or query undefined or nil?

  • Topic Author
  • Posted

    🚀 EventRunner 6 - Release v0.0.28

    Changes in v0.0.28

    •  Feature: add Earth Hour functionality to automation recipes rules
    • ♻️ Refactor: improve rule handling logic for variable assignments
    • 🐛 Fix: correct error message in parser for unexpected statements
    • 🐛 Fix: speed time log message

    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 80edfb8

  • Topic Author
  • Posted (edited)

    In v0.0.28 we can speed up time...

    Please login or register to see this code.

    This rule sets up an Earth Hour logic, turning off some lights, waiting an hour then turning them back on the state they had.
    When the script starts it posts event for the coming earth hour dates.
    We also create a FakeLamp property class, so we can test the logic, turning on/off saving state etc, without having to flicker real lights in the house.
    The FakeLamps behave like devices and we can use the same :property functions to control them.

    So, the logic works, how can we be sure it's triggering correctly?
    Well, we can run the ER engine in speed time. ER intercepts all setTimeout and setInterval and speed through them, updating the simulated time.
    To run with speed we do

    Please login or register to see this code.

    er.speed(hours) will run the emulator in speed for the hours specified.
    To be sure we reach earth hour in March next year we speed for 250 days...
    The log:
     

    Please login or register to see this code.

    ...and it behaves as we expected.
    The reason we use fake devices instead of real devices is of course also that the lights would flicker as we would turn on/off the lights rapidly...
    The log is from the HC3, and we have the real time followed by the simulated time, before the log.
    So we run some 6 months in 1 second :-) 

    Edited by jgab
    Posted
    4 hours ago, jgab said:

     

    Please login or register to see this code.

    Please login or register to see this code.


    Seems to work. Is callback or query undefined or nil?

    no i logged them out, they both are defined..

    I will change the approach i thinkl..dont want to waste your time for hunting this down...thanks

  • Topic Author
  • Posted (edited)

    Have you considered developing on a pc/mac ? Eventrunner runs well in Plua 

     

    Edited by jgab
    • Like 1
    Posted

    Jan,

    Please login or register to see this code.

     

    Posted

    Jan,

    Please login or register to see this code.

     

  • Topic Author
  • Posted

    🚀 EventRunner 6 - Release v0.0.29

    Changes in v0.0.29

    •  Feature: add nextDST function for daylight saving time calculation
    • ♻️ Refactor: improve setTimeout handling for long durations
    • 🐛 Fix: ensure timers are properly tracked in rule execution

    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 53a4288

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

    Jan,

    Please login or register to see this code.

     

    I think I fixed the "timeout after inf" bug in v0.0.29

     

    However, the second error doesn't seem to be linked to the rule you show?
    The error is about
    $Bezetting_Keuken.Vrij == ...
    and it returns nil?
    Do you have a Rule 147 with that statement?

    Posted (edited)

    Jan, thanks I am happy it's a bug because all QA's except arming does't do what they should do.

     

    attempt to index a nil value (local 'v'): eq ["gvar","Bezetting_Keuken"] ["const","Vrij"] (disabling)

     

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    Please login or register to see this code.

    Parser: Expected statement but got expression at pos 38

    Edited by Sjakie
    merged
  • Topic Author
  • Posted (edited)
    33 minutes ago, Sjakie said:

    Jan, thanks I am happy it's a bug because all QA's except arming does't do what they should do.

     

    attempt to index a nil value (local 'v'): eq ["gvar","Bezetting_Keuken"] ["const","Vrij"] (disabling)

    Please login or register to see this code.


    THAT's a BUG! Thanks, fixed in v0.0.30. It crashed because $Bezetting_Keuken is not defined or returns nil. IT shouldn't crash and the test should return false.

    Please login or register to see this code.

    Has the case in the wrong place, must be case || ...
    Did you mean
     

    Please login or register to see this code.

    Please login or register to see this code.

    Parser: Expected statement but got expression at pos 38

    Missing case ... end

     

     

    Comments inline.

     

    Score: 2-1 to me :-) 
    Seriously, I really appreciate that you struggle with this - we detect errors that would have passed by unnoticed. 👍

    🚀 EventRunner 6 - Release v0.0.30

    Changes in v0.0.30

    • 🐛 Fix: handle nil values in marshallFrom function
    • ♻️ Refactor: update variable structure in rules 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 282dc91

    Edited by jgab
    • Like 1
    Posted

    Jan, you are very welcome happy to do something back!.

    I will keep ER6 running and with your help it will come to a good end.

    probally due to many "hidden" errors in ER5 it's a kind of mess now. Unfortuanally we have a grandchild in to stay a few days so I am a bit limited

  • Topic Author
  • Posted
    Just now, Sjakie said:

    Jan, you are very welcome happy to do something back!.

    I will keep ER6 running and with your help it will come to a good end.

    probally due to many "hidden" errors in ER5 it's a kind of mess now. Unfortuanally we have a grandchild in to stay a few days so I am a bit limited

    No, that's fortunate - grandchildren :-) 

    What you could do is PM me some QAs with rules (no sensitive credentials?) and I could have a look at it. Your massive scenes are really a test for EventRunner and has always been :-) 
    So, I work while you play with the grandchildren.

  • Topic Author
  • Posted (edited)

     

    Please login or register to see this code.

    This little ER QA, generates rules, 1000 rules, that looks like below

    Please login or register to see this code.

    So it flips a triggervar 'x' to run 1000 rules and time it. 
    So, we get the time it takes to run 1000 rules from a trigger.

    Please login or register to see this code.

    0.1 - 0.2 ms for 1001 rules to get triggered by an event and run - pretty ok on a HC3. Now they don't do that much work in this case but it tells something about the efficiency of the event/triggering mechanism.
    Because rules never run until an event is seen that is relevant for the rule, we can really have thousands of rules.
    Note, while this test was running I had an average of 20% cpu across the cores (and then I'm running all the other stuff), with spikes of ~50% every second on one of the cores. Probably when the trigger run, as the peaks disappear when I stop the QA.

    Edited by jgab
    • Like 1
  • Topic Author
  • Posted (edited)

    and I had to test on ER5.
    I only auto created 100 rules. To run them all (actually 101) took on average 1 sec.

    Please login or register to see this code.

    Extrapolating we get that ER6 is about 66x faster :-) 
    Note, I got an around 70-80% cpu while it run, that came down when I stopped the QA.

    Edited by jgab
    • Like 1
  • Topic Author
  • Posted (edited)

    ER6 has a new builtin function 

    Please login or register to see this code.

    that returns the epoch time (os.time()) of the next daylight time saving.

    It can make sense to setup a rule like

    Please login or register to see this code.

    This because rules like

    Please login or register to see this code.

    will be off an hour at DST day. The reason is that the time is calculated every midnight, and this is calculated as 15*3600 seconds after midnight. But at DST the real 15:00 jumps an hour forward or backward. It actually goes for all setTimeout set by the system, if the delay is calculated to run on an absolute time.
    So, the simplest approach is to just restart the QA at DST. All rules start up again and all timers are set with the new right time...

    Edited by jgab
    • Like 1
    Posted

    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

     

     

    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...