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
4 hours ago, Sjakie said:

Jan how I can stop a QA (not ER6) from running instead of deleting it?

 

Simple, you just add function to reset, something like:

Please login or register to see this code.

But that of course works if you use this to setup looping of the QA part of code:ž

Please login or register to see this code.

But then I guess this is not the case in using Event Runner X?

BTW I have dozen of Quick apps looping on this solution and CPU and RAM usage is still low, and can stop part of them all of of them by simply sending command from control quick app, same as then restart them. Is that possible with event Runner?

 

Sorry if I'm asking stupid question :-P 

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

     

    Simple, you just add function to reset, something like:

    Please login or register to see this code.

    But that of course works if you use this to setup looping of the QA part of code:ž

    Please login or register to see this code.

    But then I guess this is not the case in using Event Runner X?

    BTW I have dozen of Quick apps looping on this solution and CPU and RAM usage is still low, and can stop part of them all of of them by simply sending command from control quick app, same as then restart them. Is that possible with event Runner?

     

    Sorry if I'm asking stupid question :-P 

    I think he means stopping someone else’s QA from ER. The short answer is no, unless the coder of the QA checks the .enabled device struct key at startup - but very few do….

     

    (ER do check the key itself)

    • 2 weeks later...
    Posted (edited)

    in EventRunner6/doc/add-ons.md, you define how to use separated modules for defining variables and rules

    I have not yet understood what means the 'loader' data in the function

    Please login or register to see this code.

    Seems to be quite different from  EventRunner5.

     

    I am trying to use the same modules I have made for EventRunner5

    Edited by Christb
    Posted

    Jan,

    default gateway HC3 192.168.50.1

    emergency gateway. 192.168.1.1

    if HC3 is on emergency gateway need restart to get default gateway

     

    Please login or register to see this code.

    hc3api.post('/service/reboot',{recovery=false}; >>>> ERROR Expected table, got: nil - ["var","hc3api"].["const","post"] (disabling)

    Or is there a better way to do?

    • 3 weeks later...
    Posted
    On 12/19/2025 at 6:38 PM, Christb said:

    in EventRunner6/doc/add-ons.md, you define how to use separated modules for defining variables and rules

    I have not yet understood what means the 'loader' data in the function

    Please login or register to see this code.

    Seems to be quite different from  EventRunner5.

     

    I am trying to use the same modules I have made for EventRunner5

     

    Having a similar issue making it work. 

     

    In main() I have: 

    Please login or register to see this code.

     

    And my module called "u_myRules" looks like: 

     

    Please login or register to see this code.

     

    This gives the following error :

     

    Please login or register to see this code.

     

    What am I doing wrong? 

    Thanks for any thoughts. Jeroen 

    Posted
    On 9/1/2025 at 1:38 PM, jgab said:

    Here is a ER5 compatible module system - put it in a QA file. It defines a global lua function loadModules.
    From main do

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    Im struggleing to make it work

    I did read this doc - 

    Please login or register to see this link.

     

    and the forum for a successful example, - anyone ?:-)  

     

    Please login or register to see this image.

    /monthly_2026_01/image.png.15bb24f3600f9e93977e513490e0581f.png" />

     

    Please login or register to see this attachment.

     

     

    Please login or register to see this attachment.

    Posted

    @jgab Hi Jan,
    we are a few people that are a little stuck with using the Enhanced Module System add-on, please help us with a working example
    Tack så mycket :-)

  • Topic Author
  • Posted

    Yes, will post something tomorrow...

    • Like 1
    • Thanks 1
  • Topic Author
  • Posted (edited)

    The module system was untested and buggy, I have updated it now.
    If you just want to load rules from other files, you can use a QA file with 
     

    Please login or register to see this code.

    and in main do
     

    Please login or register to see this code.



    If you need something similar to the module system in ER5 where you can set the load priority of the modules you can add to main (ex. after QuickApp:onInit()... )
     

    Please login or register to see this code.

    and in your module file do
     

    Please login or register to see this code.


     
     

    Edited by jgab
    • Thanks 1
    Posted
    23 minutes ago, jgab said:

    The module system was untested and buggy, I have updated it now.
    If you just want to load rules from other files, you can use a QA file with 
     

    Please login or register to see this code.

    and in main do
     

    Please login or register to see this code.



    If you need something similar to the module system in ER5 where you can set the load priority of the modules you can add to main (ex. after QuickApp:onInit()... )
     

    Please login or register to see this code.

    and in your module file do
     

    Please login or register to see this code.


     
     


    is U_ still the template to use for naming ? 

    Please login or register to see this attachment.

    Posted


     

    Hi Jan

    Im sorry for being slow - but there is some basics i still dont get
    16.01.2026] [14:06:16] [ERROR] [QUICKAPP2398]: ./include/main.lua:25: attempt to call a nil value (global 'loadLibrary')

     

     

     

     

     

    [

    Please login or register to see this attachment.

    Please login or register to see this attachment.


     

    Please login or register to see this attachment.



     

  • Topic Author
  • Posted (edited)

    Sorry, it's 

    fibaro.loadLibrary

    fixed in previous post.

    Well, ER6, don't have an update mechanism yet. But name the file with a starting underscore and I will skip them when updating in the future.

    There is an ERUpdater QA but I'm unsure how it handles things - let me come back on that. 
    But a good scheme is to name it with an underscore - if ERUpdater don't skip those files I will fix it.

    It turns out that ERUpdater only updates the existing EvenRunner files so your files can be named anything except the standard ER files. But have a leading underscore just to be safe for future updates of ERUpdater

    Edited by jgab
    Posted
    12 minutes ago, jgab said:

    Sorry, it's 

    fibaro.loadLibrary

    fixed in previous post.

    Well, ER6, don't have an update mechanism yet. But name the file with a starting underscore and I will skip them when updating in the future.


    Im pretty sure a file cant start with a underscore, but in EV5 it was u_

    Posted

    Jan, where to look?

    Please login or register to see this code.

     

    Posted (edited)
    23 minutes ago, Sjakie said:

    Jan, where to look?

    Please login or register to see this code.

     

    share the rule .-)  seems you are logging / posting a string ,meaning somting in "demo" or 'demo'  and you dont need the quotes

    Edited by ChristianSogaard
    P
    Posted

    @ChristianSogaard, I don't have a rule only error notification that's why I have no clue where to look.

    Posted (edited)
    12 minutes ago, Sjakie said:

    @ChristianSogaard, I don't have a rule only error notification that's why I have no clue where to look.

    I guess  somewhere you’re calling log() like one of these:

    log("auto blocked until %d", "12345")     -- string, not number
    log("%d", fibaro.getGlobalVariable("X"))  -- globals are strings
    log("id=%d", tostring(id))                -- tostring makes it a string

    %d means integer (decimal integer) in string.format (asking for a number, not a text)
    string.format("%d", 42)     -- OK
    string.format("%d", "42")   -- ERROR
    string.format("%s", "42")   -- OK

    Edited by ChristianSogaard
    P
    Posted (edited)

    I got it working now - Thank you Jan :-)
    i know your way / thoughts of how this should get implemented is better, but i couldn't figure out how to, so if you could make a guide for as i was 5, ill prefer you way with the priorities

     

    function QuickApp:onInit()
    local er = fibaro.EventRunner(self)
    self:debug(er)
    self:updateView('info','text',tostring(er))
    er.start()
    end

     

     

    Addon/library file (per room)

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

     

    Please login or register to see this attachment.

     

    Please login or register to see this code.

     

    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: EventRunner6 v0.0.53
    [17.01.2026] [11:49:10] [DEBUG] [EV6]: REG Kitchen
    [17.01.2026] [11:49:10] [DEBUG] [EV6]: REG Bathroom
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: =========== Loading rules ================
    [17.01.2026] [11:49:10] [DEBUG] [EV6]: QuickApp:main() start -> running libraries
    [17.01.2026] [11:49:10] [DEBUG] [EV6]: EXEC Kitchen
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: Rule 1 triggers:
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: #Interval{"id":1}
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: [Rule:1] @@00:01 => log('1 minute check Kitchen')
    [17.01.2026] [11:49:10] [DEBUG] [EV6]: EXEC Bathroom
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: Rule 2 triggers:
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: #Interval{"id":2}
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: [Rule:2] @@00:01 => log('1 minute check bathroom')
    [17.01.2026] [11:49:10] [DEBUG] [EV6]: QuickApp:main() after libraries
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: 7 1774746000
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: Rule 3 triggers:
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: #restart{}
    [17.01.2026] [11:49:10] [DEBUG] [QUICKAPP2398]: [Rule:3] #restart => plugin.restart()
    [17.01.2026] [11:49:10]

     

     

     

     

     

     

     

    Edited by ChristianSogaard
    P
    • Like 1
    Posted

    @ChristianSogaard thanks!

    Will become a bit difficult with 280 rules in that QA

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