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
12 godzin temu, jgab napisał:

 

Sorry, should be :central instead of :scene

 

Please login or register to see this code.

Both, KeyId and KeyAttribute are empty:


[DEBUG] 12:11:04: KeyId:%s, KeyAttribute:%s
 

 

 

  • Topic Author
  • Posted
    8 minutes ago, domin12 said:

    Both, KeyId and KeyAttribute are empty:

    [DEBUG] 12:11:04: KeyId:%s, KeyAttribute:%s

     

    Good news, it triggers.

    Try this

     

    Please login or register to see this code.

    • Thanks 1
    Posted
    2 minuty temu, jgab napisał:

    Good news, it triggers.

    Try this

     

     

    Please login or register to see this code.

    :) 

    [DEBUG] 12:22:40: KeyData:{"type":"property","deviceID":1233,"value":{"keyAttribute":"Pressed","icon":{"path":"fibaro/icons/com.fibaro.FGPB101_black/com.fibaro.FGPB101-1Pressed_black.png","source":"HC"},"deviceId":1233,"keyId":1,"timestamp":1607512960},"_sh":true,"propertyName":"CentralSceneEvent"}

  • Topic Author
  • Posted
    6 minutes ago, domin12 said:

    :) 

    [DEBUG] 12:22:40: KeyData:{"type":"property","deviceID":1233,"value":{"keyAttribute":"Pressed","icon":{"path":"fibaro/icons/com.fibaro.FGPB101_black/com.fibaro.FGPB101-1Pressed_black.png","source":"HC"},"deviceId":1233,"keyId":1,"timestamp":1607512960},"_sh":true,"propertyName":"CentralSceneEvent"}

     

    Ok, sorry, The rule that log the key values should look like

    Please login or register to see this code.

     

    This rule should work, if you have a 'lamp'...

    Please login or register to see this code.

     

    • Thanks 1
    Posted
    8 minut temu, jgab napisał:

     

    Ok, sorry, The rule that log the key values should look like

    Please login or register to see this code.

     

    This rule should work, if you have a 'lamp'...

    Please login or register to see this code.

     

    Perfect, Thank You

    Posted

    Hello Jan,

     

    I am very satified with your proposal!

        Rule.eval([[#knipperenAan =>
            for _,id in pairs(kerstVersiering) do id:on; wait(00:00:01) end; 
            for _,id in pairs(kerstVersiering) do id:off; wait(00:00:01) end; 
            post(#knipperenAan);
                log('kerst verlichting knipperen - Loopt')
                ]])
    It let to blink our Christmaslight.

    How to kill post(#knipperenAan)?

    Or is there a better solution?

    Thanks in advance,

    //Sjakie

    Posted

    Please login or register to see this code.

     

     

    The above part with saving the lamps' individual state doesn't work for me, none of the lamps go back to their previous state when I switch back to to Home after being Away. Any idea on what can be wrong? My other code with specific random toggling of the lights when Away works fine (so the global Home_Away variable works fine). 

  • Topic Author
  • Posted
    14 hours ago, Hans_Raven said:

    Please login or register to see this code.

    The above part with saving the lamps' individual state doesn't work for me, none of the lamps go back to their previous state when I switch back to to Home after being Away. Any idea on what can be wrong? My other code with specific random toggling of the lights when Away works fine (so the global Home_Away variable works fine). 

     

    Hmm, it seems like the code for table assignment fell off when converting ER3->ER4. Because you are using ER4?

    I have pushed a new version v0.5fix36 - restart if you have autoupdate enabled.

    Posted
    On 12/11/2020 at 12:04 PM, jgab said:

     

    Hmm, it seems like the code for table assignment fell off when converting ER3->ER4. Because you are using ER4?

    I have pushed a new version v0.5fix36 - restart if you have autoupdate enabled.

    Thanks!

     

    No, I use an old version of EventRunner3 for HC2 so I will update to the latest version as a starting point. 

     

    Please login or register to see this code.

     

    Posted

    Error after this update

     

    Version v0.5fix36

     

    2020-12-13] [11:00:06 pm] [ERROR] [QUICKAPP1532]: in Rule:34[$PresentState=='Home'  & bedmotion:breached =>...]: {"err":"attempt to get length of a number value","ERR":true,"src":"Rule:34[$PresentState=='Home'  & bedmotion:breached =>...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"color\"]]'"}[2020-12-13] [11:01:13 pm] [DEBUG] [QUICKAPP1532]: [true]>>'Rule:25[$PresentState=='Home' & officemotion:breached => ...]'[2020-12-13] [11:01:13 pm] [ERROR] [QUICKAPP1532]: in Rule:25[$PresentState=='Home' & officemotion:breached => ...]: {"err":"attempt to get length of a number value","ERR":true,"src":"Rule:25[$PresentState=='Home' & officemotion:breached => ...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"color\"]]'"}

     


      rule("officedeskLight={of.Office_Rgbw1,of.Office_Rgbw2}; officemotion=of.Aeotec_Motion; officeLight=of.Office_Light ")
      rule("officetimer = 00:05")  
      rule([[$PresentState=='Home' & officemotion:breached => 
        || 22:00..23:00 >> officedeskLight:value=50; officedeskLight:color={0,255,0,0}
        || 23:01..00:00 >> officedeskLight:value=50; officedeskLight:color={0,119,155,0}
        || 00:01..01:00 >> officedeskLight:value=20; officedeskLight:color={129,70,0,0}
        || 01:01..02:00 >> officedeskLight:value=20; officedeskLight:color={215,0,255,0}]])
      rule([[$PresentState=='Home' & trueFor(officetimer,officemotion:safe) & 22:00..03:10 => officedeskLight: value=5]]) 
      rule("@03:20   =>  officedeskLight:off")   

     

     

     

      rule("bedmotion=br.Bed_Motion; Bedlamp={br.Bed_Blub1,br.Bed_Rgbw}") 
      rule("bednight = 00:05")
      rule([[$PresentState=='Home'  & bedmotion:breached =>
         || 21:00..02:00    >>Bedlamp:value=50; Bedlamp:color={227,143,6,0}
         || 02:10..03:00-1  >>Bedlamp:value=30; Bedlamp:color={227,143,6,0}
         ]])
      rule([[$PresentState=='Home' &  trueFor(bednight,bedmotion:safe) & 21:00..03:00-1 => Bedlamp:value=5]])
      rule("@03:00   =>  Bedlamp:off")    

     

  • Topic Author
  • Posted
    5 hours ago, minsad79 said:

    Error after this update

     

    Version v0.5fix36

     

    2020-12-13] [11:00:06 pm] [ERROR] [QUICKAPP1532]: in Rule:34[$PresentState=='Home'  & bedmotion:breached =>...]: {"err":"attempt to get length of a number value","ERR":true,"src":"Rule:34[$PresentState=='Home'  & bedmotion:breached =>...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"color\"]]'"}[2020-12-13] [11:01:13 pm] [DEBUG] [QUICKAPP1532]: [true]>>'Rule:25[$PresentState=='Home' & officemotion:breached => ...]'[2020-12-13] [11:01:13 pm] [ERROR] [QUICKAPP1532]: in Rule:25[$PresentState=='Home' & officemotion:breached => ...]: {"err":"attempt to get length of a number value","ERR":true,"src":"Rule:25[$PresentState=='Home' & officemotion:breached => ...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"color\"]]'"}

     


      rule("officedeskLight={of.Office_Rgbw1,of.Office_Rgbw2}; officemotion=of.Aeotec_Motion; officeLight=of.Office_Light ")
      rule("officetimer = 00:05")  
      rule([[$PresentState=='Home' & officemotion:breached => 
        || 22:00..23:00 >> officedeskLight:value=50; officedeskLight:color={0,255,0,0}
        || 23:01..00:00 >> officedeskLight:value=50; officedeskLight:color={0,119,155,0}
        || 00:01..01:00 >> officedeskLight:value=20; officedeskLight:color={129,70,0,0}
        || 01:01..02:00 >> officedeskLight:value=20; officedeskLight:color={215,0,255,0}]])
      rule([[$PresentState=='Home' & trueFor(officetimer,officemotion:safe) & 22:00..03:10 => officedeskLight: value=5]]) 
      rule("@03:20   =>  officedeskLight:off")   

     

     

     

      rule("bedmotion=br.Bed_Motion; Bedlamp={br.Bed_Blub1,br.Bed_Rgbw}") 
      rule("bednight = 00:05")
      rule([[$PresentState=='Home'  & bedmotion:breached =>
         || 21:00..02:00    >>Bedlamp:value=50; Bedlamp:color={227,143,6,0}
         || 02:10..03:00-1  >>Bedlamp:value=30; Bedlamp:color={227,143,6,0}
         ]])
      rule([[$PresentState=='Home' &  trueFor(bednight,bedmotion:safe) & 21:00..03:00-1 => Bedlamp:value=5]])
      rule("@03:00   =>  Bedlamp:off")    

     

    Thanks, v0.5Fix37 pushed.

    Posted
    6 hours ago, jgab said:

    Thanks, v0.5Fix37 pushed.

    Thanks very fast update Works

    Posted

    Hello Jan,

    I do something wrong but dont know what.

            Rule.eval([[hal.locatieGezin:isOff => 
            || (@23:15 & wday('sun')) >> post(#nightLightsOff); log('licht uit locatieGezin afwezig en rond 23 uur');
            || @23:20 & wday('mon') >> post(#nightLightsOff); log('licht uit locatieGezin ...............
                        ]])

    This rule is executed at the moment hal.locatieGezin:isOff independant from time, extra () doest help.

    PLease advice,

    //Sjakie

    Jan, sorry to solve I know I will add the time in trigger and the post with delay.

  • Topic Author
  • Posted

    The syntax is a bit wrong.

    To make it clearer you can split it into 2 rules.

    The question os what you want with the time test? When the hal.locatieGezin is turned off it is most likely not exact 23:15 etc. Do you mean after 23:15? Then you test now >= 23:15

    Please login or register to see this code.

     

     

    Posted

    Jan, Thanks!

    Just to know what is the end time if not specified?

    Please login or register to see this code.

    Posted

    Jan,

    This morning I was surprised that my main curtain just opend half???

    It never has happend before. 

    Debug showed curtain open.

    Is my asumtion right?

    -if curtain is not closed he reports open and vice versa

    -lights respond if curtain is open but in reality they respond if curtain goes open

     

    Please enlight me

    Can I change cmd to open 100%?

    Thanks in advance,

    //Sjakie

    Posted

    I start migrating all my scenes to Event Runner 4 

    This works for Children of Hue - but was wondering if there is a more optimal way of doing this . This was i think I will end up with at least 250 rules. 

    Can I for example group the rules with pressed or pressed2 into one rule(per matrix)

     

    Please login or register to see this code.

     

  • Topic Author
  • Posted (edited)
    On 12/25/2020 at 11:13 AM, ChristianSogaard said:

    I start migrating all my scenes to Event Runner 4 

    This works for Children of Hue - but was wondering if there is a more optimal way of doing this . This was i think I will end up with at least 250 rules. 

    Can I for example group the rules with pressed or pressed2 into one rule(per matrix)

     

    Please login or register to see this code.

    Yes, it becomes many rules. In principle you only need the triggering rule per matrix device, what to do with what key combo can be taken from a table - similar to the scene version.

    We also create a helper lua function (callLamp) that do all the work - easier in Lua than in EventScript.

    On 12/24/2020 at 9:01 AM, Sjakie said:

    Jan,

    This morning I was surprised that my main curtain just opend half???

    It never has happend before. 

    Debug showed curtain open.

    Is my asumtion right?

    -if curtain is not closed he reports open and vice versa

    -lights respond if curtain is open but in reality they respond if curtain goes open

     

    Please enlight me

    Can I change cmd to open 100%?

    Thanks in advance,

    //Sjakie

    You can check and see what "value" property the device is set to. Is it ~50? I guess 0 and 99 is the min and max values for closed and opened.

    Edited by jgab
    • Like 1
    Posted (edited)

    Dear @jgab, it has been a while since I have looked at this topic and wow, your work has really expanded and matured :) 

    I am still using v1.4, which is ancient compared to what happened here in the meantime; it still runs like a charm btw :)

     

    I am building a new use case in which I need a scene to be triggered when event B follows event A within 1 minute. If B happens without A or B happens before A, something else should happen. Can your framework handle that? (NB I am still running HC2)

     

    Thanks!

    Edited by 3JL
  • Topic Author
  • Posted
    9 hours ago, 3JL said:

    Dear @jgab, it has been a while since I have looked at this topic and wow, your work has really expanded and matured :) 

    I am still using v1.4, which is ancient compared to what happened here in the meantime; it still runs like a charm btw :)

     

    I am building a new use case in which I need a scene to be triggered when event B follows event A within 1 minute. If B happens without A or B happens before A, something else should happen. Can your framework handle that? (NB I am still running HC2)

     

    Thanks!


     

    Please login or register to see this code.

    The tricky part is the last rule that needs to have a test that is false when the second rule's test is true.

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