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

It is also working for me and I have been also able to use my HomeTable to get the device ids for all rooms.

I need now to implement all ER5 rules in ER6...(around 100)

 

The issue I may have are conflicts between ER5 and ER6 as they will run in //!

Anyone knows a better way to prevent it except changing one by one each rule line in ER5 as a comment?

Posted

Make a backup HC3

Just copy your rules in ER6

add in ER5 qa hello and save QA will crash

Tackle each error in ER 6

 

for 100 rules it's not a bigg deal

depends on your rules I estimate 1 hour job

 

 

  • Like 1
  • 2 weeks later...
Posted (edited)
On 1/19/2026 at 1:16 PM, Sjakie said:

Just copy your rules in ER6

add in ER5 qa hello and save QA will crash

I have found a very good way to switch rules from ER5 to ER6 progressively:

Before copying the rules to ER6, I a using the feature er.disable(<names_of_the_group_of_rules): ER5 does not crash so remaining rules in ER5 are still operational.

BTW: this possibility of grouping rules under a name like: local lumOther={rule(....),rule(....)} with er.disable(lumOther 
seems not to be possible in ER6 or I have not read correctly the comprehensive documentation provided on GitHub.

 

It you confirm that grouping rules is no more available in ER6, it will be good to be able to disable a rule by its front string:

rule("lumOther_1","HT.Default_Room.QA_Binary_Switch:isOn => log('Binary Switch is On')")
disable("lumOther_1") and putting the same string to some rules will disable all of them.

 

 

 
Edited by Christb
Posted

Jan, can this warning also tells me which Global variable?

Please login or register to see this code.

 

Posted (edited)
On 9/4/2025 at 8:33 AM, jgab said:

Please login or register to see this code.

Dear @jgab,

I have now completly moved to ER6 using my HomeTable GV and with all rules in ER5 disabled.😃

 

I there a way to get only succesfull rules in the log window?

With the above function, I am getting for a single Walli button pressed for rules 50 to 54:

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 🎬 [Rule:17 lumVestibule_48]: #key{id:369,1:Pressed}

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👎 [Rule:17 lumVestibule_48]

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 🎬 [Rule:20 lumVestibule_51]: #key{id:369,1:Pressed}

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👎 [Rule:20 lumVestibule_51]

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👍 [Rule:50 lumPalier_5]

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👎 [Rule:51 lumPalier_6]

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👎 [Rule:52 lumPalier_7]

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👎 [Rule:51 lumPalier_6]

[04.02.2026] [20:51:43] [DEBUG] [QUICKAPP756]: 👎 [Rule:52 lumPalier_7]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👎 [Rule:51 lumPalier_6]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👎 [Rule:52 lumPalier_7]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👎 [Rule:51 lumPalier_6]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👎 [Rule:52 lumPalier_7]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👎 [Rule:51 lumPalier_6]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👍 [Rule:52 lumPalier_7]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👎 [Rule:53 lumPalier_8]

[04.02.2026] [20:51:44] [DEBUG] [QUICKAPP756]: 👍 [Rule:54 lumPalier_9]

 

Edited by Christb
Posted

Please login or register to see this code.

 

  • Like 1
Posted
8 hours ago, Sjakie said:

Please login or register to see this code.

Unfortunately it is not working as expected, I still have "false" and "true" state for the rule which include trigger of the activated device.

The best result I got is with setting all to false except triggers which give more visible log (true or false).

 

What I want to do is to see only rules that are true after a device change (On/Off).

The reason is the following:

5 Walli switches are managing a single light with a summary QA switch which is the only visible device in Yubïï.

A set of rules are there to upgrade the status of all other Walli and the QA when one switch is activated.

 

The issue I have is that at a random timing, the light is going ON without any device manual action  

Posted (edited)
14 hours ago, Christb said:

Please login or register to see this code.

@jgab It seems that the option declaration at the end of a rule does not override the er.opts defined in 'main'.

 

I have found that I am getting only success log if the above example is written that way:

 

local function check(rule, env, res)
   if res then print(string.format("%s %s",rule.successPrefix,env.trigger)) end
end
er.opts = { started = false, check = check, result = false, triggers = true }

 

which gives for all rules:

[05.02.2026] [11:12:24] [DEBUG] [QUICKAPP756]: 👍 #key{id:369,1:Pressed}

[05.02.2026] [11:12:25] [DEBUG] [QUICKAPP756]: 👍 #device{"id":74,"value":true,"old":false,"property":"value"}

[05.02.2026] [11:12:25] [DEBUG] [QUICKAPP756]: 👍 #device{"id":386,"value":true,"old":false,"property":"value"}

[05.02.2026] [11:15:31] [DEBUG] [QUICKAPP756]: 👍 #key{id:318,1:Pressed}

[05.02.2026] [11:15:33] [DEBUG] [QUICKAPP756]: 👍 #device{"id":370,"value":false,"old":true,"property":"value"}

[05.02.2026] [11:15:33] [DEBUG] [QUICKAPP756]: 👍 #device{"id":386,"value":false,"old":true,"property":"value"}

 

which is much better but I have lost the rule name and ID

I am getting back the rule name in adding it in the 'print' string:😃

 

print(string.format("%s %s %s",rule.name,rule.successPrefix,env.trigger)

 

lumPalier_5 👍 #key{id:369,1:Pressed}

lumPalier_6 👍 #device{"id":370,"value":true,"old":false,"property":"value"}

lumPalier_8 👍 #device{"id":386,"value":true,"old":false,"property":"value"}

 

Edited by Christb
Getting back rule name
  • 1 month later...
Posted

Dear Jan, 

 

The following simple rule does work when I put it in "main", however, when it is placed in a module "u_MyRules" it gives an error

Please login or register to see this code.

 

When in main: 

DEBUG] [QUICKAPP566]: [Rule:3] toiletdeur:breached => ventilatie:on ; wait(00:07) ; ventilatie:off

 

When in u_MyRules: 

[ERROR] [QUICKAPP566]: Rule 3: getprop object is nil: breached ["var","toiletdeur"] 'toiletdeur:breached => ventilatie:on ; wait(00:07) ; ventilatie:off'

 

Same error when I move the variables into the var.HT  = { .... } table 

[ERROR] [QUICKAPP566]: Rule 3: Expected table, got: nil - ["var","HT"].["const","toiletdeur"] 'HT.toiletdeur:breached => HT.ventilatie:on ; wait(00:07) ; HT.ventilatie:off'

 

That said, the rule below does work in "u_MyRules" , so it looks like maybe it got something to do with the ' :breached ' part.

Please login or register to see this code.

 

What am I doing wrong here? 

  • Topic Author
  • Posted
    7 hours ago, JeroenL said:

    Dear Jan, 

     

    The following simple rule does work when I put it in "main", however, when it is placed in a module "u_MyRules" it gives an error

    Please login or register to see this code.

     

    When in main: 

    DEBUG] [QUICKAPP566]: [Rule:3] toiletdeur:breached => ventilatie:on ; wait(00:07) ; ventilatie:off

     

    When in u_MyRules: 

    [ERROR] [QUICKAPP566]: Rule 3: getprop object is nil: breached ["var","toiletdeur"] 'toiletdeur:breached => ventilatie:on ; wait(00:07) ; ventilatie:off'

     

    Same error when I move the variables into the var.HT  = { .... } table 

    [ERROR] [QUICKAPP566]: Rule 3: Expected table, got: nil - ["var","HT"].["const","toiletdeur"] 'HT.toiletdeur:breached => HT.ventilatie:on ; wait(00:07) ; HT.ventilatie:off'

     

    That said, the rule below does work in "u_MyRules" , so it looks like maybe it got something to do with the ' :breached ' part.

    Please login or register to see this code.

     

    What am I doing wrong here? 

     

    Look how 'var' is defined in QUickApp:main(er).
    Typically something like
     

    Please login or register to see this code.

     

    So, your module 'u_MyRules' is sent 'er' as a argument so you should be able to do the same declaration of 'var' there...

    • 3 weeks later...
    Posted

    Jan,

    If I select to update Eventrunner it doest show my installed QA's swell in ERupdater or QA Distmanager 

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

    Jan,

    If I select to update Eventrunner it doest show my installed QA's swell in ERupdater or QA Distmanager 

    It needs to be reasonable new EventRunner6 QAs to be seen - others lack the right uid.
    Works well for me with EventRunner6 QA (0.48)

    Posted

    Jan, .53 here will renew them all.

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

    Jan, .53 here will renew them all.

    Please refresh qaDist, the manifest for EventRunner6 has been updated. Could otherwise clear your main with rules.

    Posted

    Jan,

    Can you please extend the error message with the name of the GV?

    EventRunner6 v0.0.54

    • 2 weeks later...
    Posted (edited)

    Hi Jan,

     

    Is the latest ERUpdater importable? When i attempt to upload file, the HC3 craps out with a 500 error.

     

    The one under .53 does upload but there is a selection bug. There's a possibility the .54 one is corrupted somehow...

     

    thx

    Edited by gurpal2000
  • Topic Author
  • Posted
    On 4/21/2026 at 9:47 AM, gurpal2000 said:

    Hi Jan,

     

    Is the latest ERUpdater importable? When i attempt to upload file, the HC3 craps out with a 500 error.

     

    The one under .53 does upload but there is a selection bug. There's a possibility the .54 one is corrupted somehow...

     

    thx

    You need to use the QA Dist manager....

    Posted (edited)

    Jan,

    v0.0.55

    Please can I have any direction?

    My arming QA is missing something but the question is what?

    I deleted Z_Armed_25 >> that he is printing

    but the other??

    I printed all GV according old post from @10der

    Please login or register to see this code.

     

    All printed GV are present and having text or value

    Please login or register to see this code.

    Thanks in advanced

    Edited by Sjakie
  • Topic Author
  • Posted
    19 minutes ago, Sjakie said:

    Jan,

    v0.0.55

    Please can I have any direction?

    My arming QA is missing something but the question is what?

    I deleted Z_Armed_25 >> that he is printing

    but the other??

    I printed all GV according old post from @10der

    Please login or register to see this code.

     

    All printed GV are present and having text or value

    Please login or register to see this code.

    Thanks in advanced

    Can you PM me the rule file? (main I guess)

    Posted (edited)

    As per suggestion from @jgab 

    Please login or register to see this link.

    , I am just sharing a way to deploy a code/rule change from a self-hosted git (Gitea) using "Github actions", GitOps style. I'm hoping I don't have to explain some of those terms - out of scope.

     

    I wanted to source control my ER6 code (rules) then deploy them straight to HC3 without opening up the HC web interface. I don't tweak these rules often, but I'd like rest of the family to learn to tweak our automations in their own time. Source controlling allows a review (after an 'release' enhancement TBD) and importantly, rollback in case things go wrong.

     

    Disclaimers:

    - This is a bare minimum / demo to get things going.

    - Plenty of improvements can be made; best practices should be applied.

    - Not responsible for trashing your QAs.

    - Credentials should be kept in a secret store/vault not variables.

    - Works On My Machine.

    - This is a "push" approach.

    - You could probably get an MCP + LLM to do all this anyway.

     

    My pre-reqs:

    - HC3 up and running

    - ER6 deployed with QA ID noted

    - ER6 "main" file to be source controlled at least once

    - Gitea installed and can reach HC3 (same subnet, vlan, etc)

    - Gitea Actions already work

    - Gitea Runner has label minimally "zulu-25-full:docker://cimg/openjdk:25.0-node" (i just happen to use this for my other dev work)

     

    Notes

    - Working out the escaping using native commands was a real pain

    - Learnt a lot and nuances between creating a new file vs updating an existing one (thanks to jgab's MCP and qaDist code)

    - I run most of my home infra on incus+docker+opentofu

     

    My project layout:

     

    Please login or register to see this image.

    /monthly_2026_04/image.png.0aace1b25da4c856ef375c9cfb784949.png" />

    main.lua = main below, say

     

    Please login or register to see this attachment.

     

    deploy.yml - example is 

    Please login or register to see this link.

     

    vars like HC3_HOST are variables set globally or at org level within Gitea itself.

     

    image.png.91af3f1e991002f9d02bb13f6d57f4bc.png

     

    image.png.714c54c833d6af83e647bead752f4b16.png

     

    When i commit main.lua, a deploy takes place and in <15 seconds the QA on HC is updated :) 

     

    Hope that's useful.

     

    Regards,

    Edited by gurpal2000
    hyperlink

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