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

ERUpdater I saw the present version ER qa listed, excellent thanks!

Posted (edited)

In case of error during reading of rules (ie. some device is nil) - ER6 stop working with error message.

Is it possible to only show error(s) and continue to reading rest of rules and ER6 will continue to work ?

Edited by petrkl12
Posted (edited)

Jan,

Please login or register to see this code.

Manny errors:

Please login or register to see this code.

 

ERUpdater set older versions under a button, the list becomes verry long.

Is there a possibility to subscribe so we can get a notification there is a new update?

Edited by Sjakie
add error/ ERUpdater
  • Topic Author
  • Posted
    2 hours ago, Sjakie said:

    Jan,

    Please login or register to see this code.

    Manny errors:

    Please login or register to see this code.

     

    ERUpdater set older versions under a button, the list becomes verry long.

    Is there a possibility to subscribe so we can get a notification there is a new update?

    The first error is from inside of fibaro's own code. Is it ER6 or ERUpdater?

    It seems to be from fibaro.getType(deviceId). I don't use that function in my code. Do you?

    The second error implies that hal.Hal_Verlichting is either an empty table or a 
    non strict array. e.g. it contains key=value elements like discussed in your earlier post.

    Yes, ERUpdater is going to be updated...

    Posted

    JAN, fibaro.getType(deviceId) is correct ,now I know what caused the error >> removed.

    Cleaning all my QA's removing stuff what not helps for a better automation.

    For lights I use xy for color and still bro and transition time what else to use> fibero.call?

     

    Posted

    @jgab maybe bug in wnum ? 

    Please login or register to see this code.

     

    error:

    26.09.2025] [07:08:00] [ERROR] [QA_ER6_1551]: [Rule:5]: ["var","wnum"]: Expected number, got: nil (disabling)[26.09.2025] [07:08:00] [ERROR] [QA_ER6_1551]: [Rule:5]: attempt to perform arithmetic on a nil value (local 'arg1'): mod ["var","wnum"] ["const",2] (disabling)

  • Topic Author
  • Posted
    On 9/25/2025 at 8:42 AM, Sjakie said:

    Jan, fibaro.getType(deviceId) is correct now I know what caused the error >> removed.

    Cleaning all my QA's removing stuff what not helps for a better automation.

    Is there an alternative for using bri and transitiontime except setting in the HUE bridge?

     

    What Hue QA are you using?

    🚀 EventRunner 6 - Release v0.0.43

    Changes in v0.0.43

    • ♻️ Refactor: add optional name property to rule creation
    • ♻️ Refactor: improve clarity of rule data structure
    •  Feature: add wnum function to computed variables
    • ♻️ Refactor: clean up GVAR function by removing commented code
    • ♻️ Refactor: improve rule index handling
    • ♻️ Refactor: enhance error handling in executeSetProp function
    • ♻️ Refactor: update device creation path handling in createDevice function
    • ♻️ Refactor: update rule execution logic for clarity

    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 e82bd67

  • Topic Author
  • Posted

    We can give names to rules now by adding an extra string as first argument

    Please login or register to see this code.

    we can also do 

    Please login or register to see this code.

    adding the name as an option last. The first example will just move the string to the name options...

    The rule will log as

    Please login or register to see this code.

    1 hour ago, petrkl12 said:

    @jgab maybe bug in wnum ? 

    Please login or register to see this code.

     

    error:

    26.09.2025] [07:08:00] [ERROR] [QA_ER6_1551]: [Rule:5]: ["var","wnum"]: Expected number, got: nil (disabling)[26.09.2025] [07:08:00] [ERROR] [QA_ER6_1551]: [Rule:5]: attempt to perform arithmetic on a nil value (local 'arg1'): mod ["var","wnum"] ["const",2] (disabling)

    Yep, wnum was not implemented - is now in v0.0.43

    • Thanks 1
    Posted (edited)

    Jan after update version v0.0.43 in all ER6 QA's. All aa's stopped.

    Please login or register to see this code.

     

    Still using COH

    Edited by Sjakie
    add COH
  • Topic Author
  • Posted

    raw get error fixed in v0.0.44

    Posted

    Jan,

    1:armed == true | 1:armed == false does not work in ER 6 as you mentioned it's working.

    As you can see in debug QA590 is ER6 and QA 598 ER5

    Please login or register to see this code.

     

    Posted (edited)

    @jgab

    is to possible to add variable (ie. logRule) where will be save rule number + rule name incl. some icons. I would like to use to my log to know which rule is running

     

    current state:

      rule("wait(00:00:10); log('Starting rule')", name={"Test rule"})

    27.09.2025] [11:18:46] [DEBUG] [QA_ER6_1551]: Starting rule

     

    new state:

      rule("wait(00:00:10); log(logRule..'Starting rule')", name={"Test rule"})

    [27.09.2025] [11:21:46] [DEBUG] [QA_ER6_1551]: 🎬 [Rule:77 Test rule]: Starting rule

     

    Edited by petrkl12
    Posted

    Jan, 

    Please login or register to see this code.

    Can I add something to get rid of those errors in all QA's for operating lights in COH?

  • Topic Author
  • Posted (edited)
    22 hours ago, petrkl12 said:

    @jgab

    is to possible to add variable (ie. logRule) where will be save rule number + rule name incl. some icons. I would like to use to my log to know which rule is running

     

    current state:

      rule("wait(00:00:10); log('Starting rule')", name={"Test rule"})

    27.09.2025] [11:18:46] [DEBUG] [QA_ER6_1551]: Starting rule

     

    new state:

      rule("wait(00:00:10); log(logRule..'Starting rule')", name={"Test rule"})

    [27.09.2025] [11:21:46] [DEBUG] [QA_ER6_1551]: 🎬 [Rule:77 Test rule]: Starting rule

     

    So, technically, 

    Please login or register to see this code.

    is not a rule. It has no '=>' defining a rule. It's just an statment being evaluated.

    So the options to name it has no effect, as nothing is "remembered" after the expression is evaluated.

    Expressions like these are useful to setup initial values, or trigger rules at startup etc.

    Normally, when the rule function evaluates a statement, it prints the value it returns.

    So ex. 

    Please login or register to see this code.

    will produce 2 log statements
     

    Please login or register to see this code.

    the first being the er log statement, and the second being what the rule(...) evaluated to. In this case it's because log('Hupp'), besides logging it to the console also return the string it logged, so the rule("log('Hupp')") will also return Hupp

    Usually it's convenient to see the result value of a statement, but we can turn it off with

    Please login or register to see this code.

    In this case we will only get one 'Hupp' logged.

    If all your expression do their own logging and you don't care about the return result you can turn it off in er.opts,
    ex.

    Please login or register to see this code.

    or you can make your own expr function, that works like rule but for expressions and turns off the result

    Please login or register to see this code.

     

    When defining rules, it's a different matter.
    Most of the logging of a rule is controlled by the er.opts table.
    See 

    Please login or register to see this link.

    We can control what to log and what icons/emoji to prefix these logs with.

    Some of these opts flags can be functions, and if defined, are called instead of the standard print function. This means ex. that we can have our own function to print when a rule is started. Or we use it as a hook, and just print the standard message and then record somewhere that the rule has started.

    One "hook" I see is missing is when a rule is defined. It always logs using the rule._rule.ruleDefPrefix emoji.

    So, I have added in v0.0.45 the flags er.opts.defined that is by default true and will log rule defined. If false no log.
    If a function will be called with the rule object. There one could add some recording that rule was defined or whatever, and then log.
    If the function returns false/nil ER will continue to log the rule defined with the default message. If it returns true ER will assume that the function decides how to log the defined function (or not).

    Also, in v0.0.45, there is a local variable 'rule' being the rule running.
    Ex.

    Please login or register to see this code.

     

    37 minutes ago, Sjakie said:

    Jan, 

    Please login or register to see this code.

    Can I add something to get rid of those errors in all QA's for operating lights in COH?

    You are defining a table like

    Please login or register to see this code.

    where bar is nil.

    It can be a misspelling in the HT table. Ex

    Please login or register to see this code.


    Here HT.barr is misspelled HT.bar. HT.barr don't exist and evaluates to nil.
    See if you can recognize the tables from the IDs and where in the code they are defined.

    Edited by jgab
    Posted

    Jan, your newest version 

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    45 minutes ago, Sjakie said:

    Jan, your newest version 

    Please login or register to see this code.

     

    Sorry, fixed in 0.0.46

    Posted

    @jgab, @petrkl12 Thanks both of you to tackle this error.

    Please login or register to see this code.

    Confusing for me was Hue_room with 4 lights gave 4 faults.

    strange token in HomeTable re-added the lights after restore did the trick.

    Posted

    In ER5 I had a rule trigger for a remote of the form:

     

    rule([[key = vremote:key =>
    || key == '1:Pressed' >> hL.index = stepUp(hL.index, tS); hL.devices:value = nextValue(hL.index, hL.curve, hL.low, hL.high, tS)
    || key == '2:Pressed' >> hL.index = stepDown(hL.index, tS); hL.devices:value = nextValue(hL.index, hL.curve, hL.low, hL.high, tS)
    || key == '1:HeldDown' >> hL.devices:on; log('isOn hL'); hL.index = currentStep(hL.devices[1]:value, hL.curve, hL.low, hL.high, tS)
    || key == '2:HeldDown' >> hL.devices:off
    ...

     

    With action statements in a case statement. I can see that I need to modify the case statements(s) with an explicit case ... end. The trigger generates an error of "Compiler: 'assign' not allowed in trigger expression at pos 1"

     

    I can't work out the syntax to trigger on any key press. Is that possible or do I need to have a rule per key:attribute 

  • Topic Author
  • Posted

    You can't have an assignment in the condition/test. This works

    Please login or register to see this code.

     

    Posted

    If I use that I get Rule has no triggers 'vremote:key => local key = vremote:key; case || key == '1:Pressed' >> hL.index..'

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