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 (edited)

    The workflow I have to develop EventRunner is very satisfying....

    I develop using

    Please login or register to see this link.

    . This allows me to code and run EventRunner on my PC. Simulating or invoking real devices on the HC3. If a QA works with Plua it works on the HC3 with 99.95% certainty. 

    When I'm happy with the feature/bugfix I run a script that package the code into a .fqa file and pushes it as a new release to GitHub.

    On the HC3, I run the

    Please login or register to see this link.

    that allow users to install a new copy of EventRunner on the HC3, or update an existing EventRunner already installed. It will show the latest 5 releases on GitHub and one can downgrade if something wen wrong.

     

    From the moment I run the release script to when the new QA is available in QA Dist is less than 10 seconds. Because it's so quick I have stopped running tests on the HC3 before creating a release. Instead a create a release and update my test QA on the HC3. If something goes wrong (< 0.05% chance) I quickly fix it and make a new release.

     

    Yesterday, I released 11 versions of EventRunner. Mostly bugfixes after people in the forum posted bug reports. Sometimes I had new release pushed with fixes in under 10 minutes from the report in the forum. And users could quickly update their EvenRunner with the new release and file more bug reports :-) 

    Edited by jgab
    • Like 2
    Posted

    jan

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    1 minute ago, Sjakie said:

    jan

    Please login or register to see this code.

     

    There is no env anymore, use event directly.

    Please login or register to see this code.

     

    3 minutes ago, jgab said:

    There is no env anymore, use event directly.

    Please login or register to see this code.

     

    I added env back in v0.1.34 - just in case people have many rules using it.
    I recommend using the variable 'event' directly, that is bound to the event triggering the rule.

    Posted

    Jan the changed by external is solved. I removed for this debug all "zones", if alone "rooms" it's much better.

    Sorry for the inconvenience.

    100- general for Eventrunner or external

    06- rule to switch light

    Eventrunner notification is good, for value I need to add a delay of 1 sec

    Externally on is okay 

    Off no debug

    Is it possible to add?

     

    Please login or register to see this code.

     

     

  • Topic Author
  • Posted

    ER7 has list comprehensions -

    Please login or register to see this link.

    .
    The latest version allow us to use them as 'primary expression' (v0.1.36)
    This construct allows us to create, transform and filter a list as an expression. 
    It looks like

    Please login or register to see this code.


    Because we can apply a property to a list, ex. {light1,light2}:on in ER, this becomes quite useful.
    Ex.

    Please login or register to see this code.

    Here we collect all x, for x in the list HT.kitchen, but only if the device x is off.
    To the resulting list we apply :on, to turn on the lights.

    It's quite a powerful syntax/mechanism to filter out the devices we want to do something with. A typical use case in home automation.

    Ex. get a list with all devices with low battery

    Please login or register to see this code.

    Here we get all devices and collect the x.id, the deviceId, for each device that has a batteryLevel property and the value is less than 20

    I have to guard the selection with tonumber(x.id:bat) because I have a zwave device (fibaro) that don't have a batteryLevel property, but 
    fibaro.getValue(deviceId,"batteryLevel") returns {modified=0, value = ""} ??? smells like a bug....

    • Like 1
  • Topic Author
  • Posted

    The

    Please login or register to see this link.

    is starting to be readable - proof read and expanded.

    • Like 1
    • Thanks 1
    Posted

    Jan, can QA Dist manager give a message if there is an update available?

    Posted

    @jgab, in ER6, the following was working, it seems not in ER7.

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

    Does the format of check function needs to be hanged?

    I am willing to have only in the log, rules that are trigered with condition = true (👍)

    Posted

    @ChristianSogaard

    There is no env anymore, use event directly.

    Please login or register to see this code.

  • Topic Author
  • Posted
    9 hours ago, Christb said:

    @jgab, in ER6, the following was working, it seems not in ER7.

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

    Does the format of check function needs to be hanged?

    I am willing to have only in the log, rules that are trigered with condition = true (👍)

    In this case the option to have functions in the er.opts table is not implemented. Just true/false at the moment.

    I guess in your example it's the same as having check=true ? 
    or is it something special you want to achieve?

    17 hours ago, Sjakie said:

    Jan, can QA Dist manager give a message if there is an update available?

    No not yet. It's on my todo list.

    • Like 1
    Posted

    Jan, I have zone with 6 lamps, 4x Hue Color Spot, Hue Xamento Spot, Hue White Spot.

    This is happening also with IKEA lamps.

    If switch on by HC3:

    Please login or register to see this code.

    Please login or register to see this code.

     

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

    Jan, I have zone with 6 lamps, 4x Hue Color Spot, Hue Xamento Spot, Hue White Spot.

    This is happening also with IKEA lamps.

    If switch on by HC3:

    Please login or register to see this code.

    Please login or register to see this code.

     

    I see that the rules run over 3 seconds (06:48:21-06:48:24) on the same HC3 switch action?
    Then it can be so that the :manual returns something closer to 0 or 1 for script changes....
    Can you try to change to 

    Please login or register to see this code.

    and see if it works?

    Posted (edited)

    This shows NO external switch on.

    There was a 2 sec delay in the rule to have a correct

    Please login or register to see this code.

    reduced it is now 1 sec

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

    This shows NO external switch on.

    What command do you use to turn them on?

    Posted

    Hue app for external

    HC3 for internal no switches

    Please login or register to see this code.

     

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

    Hue app for external

    HC3 for internal no switches

    Please login or register to see this code.

     

    Yes, but what command from the HC3? 
    :on
    :value=...
    :setDim...
    ?

    Posted (edited)

    They are all in the same style the scene set the brightness. Switching off is value = 0

    Please login or register to see this code.

     

    Edited by Sjakie
    off
    Posted
    13 hours ago, jgab said:

    is it something special you want to achieve?

    When check=true then log displays all rules involved with the state change of a device like below:

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_16: #device{"id":389,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👎 lumVestibule_17: #device{"id":389,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_14: #device{"id":341,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👎 lumVestibule_15: #device{"id":341,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_45: #device{"id":341,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_14: #device{"id":316,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👎 lumVestibule_15: #device{"id":316,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_45: #device{"id":316,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_14: #device{"id":436,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👎 lumVestibule_15: #device{"id":436,"value":true,"old":false,"property":"value"}

    [05.06.2026] [20:14:08] [DEBUG] [QUICKAPP769]: 👍 lumVestibule_45: #device{"id":436,"value":true,"old":false,"property":"value"}

    What I want to do is eliminating logs which are false (👎).

    Since I am using EventRunner 4->6->7, I have a strange issue: the 3 Wallis of LustreB light are going "on" without manual action of any switch or QA.

    I a trying to isolate logs of only the switches and QA involved in the management of this light when the condition is true.

    The rules are:

      --groupe ruleVestibB
        rule("(lumB1-2):central.keyId == 2 & (lumB1-2):central.keyAttribute == 'Pressed' => if lumB1:isOff then LustreB:on  else LustreB:off end",{name="lumVestibule_11"},{group="ruleVestibB"})  
       
    rule("(lumB4-2):central.keyId == 2 & (lumB4-2):central.keyAttribute == 'Pressed' => if lumB1:isOff then LustreB:on  else LustreB:off end",{name="lumVestibule_12"},{group="ruleVestibB"})  
       
    rule("(lumB5-2):central.keyId == 2 & (lumB5-2):central.keyAttribute == 'Pressed' => if lumB1:isOff then LustreB:on  else LustreB:off end",{name="lumVestibule_13"},{group="ruleVestibB"})  
       
    rule("LustreB:isOn => lumQaB:on",{name="lumVestibule_14"},{group="ruleVestibB"})  
       
    rule("LustreB:isOff => lumQaB:off",{name="lumVestibule_15"},{group="ruleVestibB"})     
        
    rule("lumQaB:isOn => if LustreB:isOff then LustreB:on end",{name="lumVestibule_16"},{group="ruleVestibB"}) 
       
    rule("lumQaB:isOff => if LustreB:isOn then LustreB:off end",{name="lumVestibule_17"},{group="ruleVestibB"}) 

        rule("LustreB:isOn => wait(00:45);LustreB:off",{name="lumVestibule_45"},{group="lumToT"})

    The above rules work perfectly when any of the 3 Wallis (lower switch) is manualy activated or the QA when using the Yubîî application.

    I am sure there is a better way to do this, because I have dual log of each rule and I have not find why.

  • Topic Author
  • Posted

    ok, a compromise. v0.1.37.
    opts = { check = ''success" } will only log the success.

    opts = { check = ''failure" } will only log the failures.

    opts = { check = true } will log success & failure

    • Like 1
    Posted

    Jan I get still errors when I fa use --comment in a rule.

    Is it not done anymore in ER7?

     

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