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



jgab

Recommended Posts

  • Topic Author
  • 21:armed==false => ...

    or

    21:disarmed => ...

    Link to comment
    Share on other sites

    Jan,

    This goes wrong and I don't know why?

    Please login or register to see this code.

    Why I get value false?

    Used value   'Aan' or 'Uit'

    Plaese advice,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • I don't understand your log.

    You say the rule is

    Please login or register to see this code.

    but your log output says

    Please login or register to see this code.

    so they must clearly be from another rule, as the log starts with "Aangemaakt..."

    Link to comment
    Share on other sites

    Sorry in the meantime I modified all logs, GV gemaakt replaced bij Aangemaakt

    Problem is the $Sec_Beveiligen = 'false' I checked all QA's and nowhere is used $Sec_Beveiligen = 'false'

    Link to comment
    Share on other sites

    Jan, this afternoon HC3 restarted by itself.

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    New version 0.81 with a new experimental feature - user action events.

     

    When someone interacts with a device in the app there are events emitted with the device and userid.

    Ex. a com.fibaro.multilevelSwitch device with id 756.

    When the user with id 917 turn on, off and changes dimming we get the events

    Please login or register to see this code.

     

    Which means that we can create a rule like

    rule("#user{id=917,value='action',data={id=756,actionName='turnOn'}} => log('Ann turned on the light')")

     

    Beware that the normal event 

    Please login or register to see this code.

    is also emitted.

    Also the order of the events seems to not be predictable. I've seen the #device event being fired after the #user event.

     

    Anyway, will experiment more with it to see how it can be used.

    Edited by jgab
    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • Some more observations.

    The #user event is always sent, even if the device already has the state (as opposed to how the #device event behaves)

    Trying on the HC3 it seems like the #user event always comes before the #device event - however can't guarantee it.

    Link to comment
    Share on other sites

    HI Jgab 

     

    doesn't work in version 0.81

     

    The rules shown below

     

    ========================================================================

     

    rule("@{00:00,catch} => $WeekDay = weekdays[os.date('*t').wday];  log('Set GV into %s',$WeekDay)")

     

      Util.defTriggerVar("Lbathcounter",0)
      rule([[Livingbath_door:safe & @@00:00:10 =>    Lbathcounter=Lbathcounter+1; log('Light turned on %s times',Lbathcounter)]])
      rule([[Livingbath_door:breached & @@00:00:10 & Lbathcounter >= 1 => Lbathcounter=Lbathcounter-2; log('Light turned on %s times',Lbathcounter) ]])
      rule([[Lbathcounter < 1 => post(#livingBathventOff)  ]])
      rule([[Lbathcounter >= 1 => post(#livingBathventOn)  ]])
      rule("trueFor(00:10,Livingbath_sensor:safe & Livingbath_door:value) & !inlivingBathroom =>  Lbathcounter=0")
      rule("#livingBathventOn =>||Livingvent:isOff >>  wait(00:00:05); Livingvent:on; log('LivingBathroom is Vent On!')")
      rule("#livingBathventOff =>||Livingvent:isOn >>  wait(00:00:05); Livingvent:off; log('LivingBathroom is Vent Off!')")

    Link to comment
    Share on other sites

  • Topic Author
  • Ok, what doesn't work more specifically?

    Did it work in 0.80? or what version did it work in? Nothing have changed in the last versions that effects the rules you have.

    Please login or register to see this code.

    Just looking at the rules I'm not sure I understand the logic with the counter, but you may be doing something clever above my head ;-) 

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Ok, what doesn't work more specifically?

    Did it work in 0.80? or what version did it work in? Nothing have changed in the last versions that effects the rules you have.

    Please login or register to see this code.

    Just looking at the rules I'm not sure I understand the logic with the counter, but you may be doing something clever above my head ;-) 

     

     

    work in 0.79 version

     

    rule("@{00:00,catch} => $WeekDay = weekdays[os.date('*t').wday];  log('Set GV into %s',$WeekDay)")  => Catch not working

     

     

    ======================================================================================

     

    Util.defTriggerVar("Lbathcounter",0)  

    rule([[@@00:00:10 & Livingbath_door:safe =>    Lbathcounter=Lbathcounter+1; log('Light turned on %s times',Lbathcounter)]])
    rule([[@@00:00:10 & Livingbath_door:breached & Lbathcounter >= 1 => Lbathcounter=Lbathcounter-2; log('Light turned on %s times',Lbathcounter) ]])

     

    when the door is closed

    Count is incremented by +1

    when the door is open

    Count decreases by -2


    rule([[Lbathcounter < 1 => post(#livingBathventOff)  ]])
    rule([[Lbathcounter >= 1 => post(#livingBathventOn)  ]])
    rule("trueFor(00:10,Livingbath_sensor:safe & Livingbath_door:value) & !inlivingBathroom =>  Lbathcounter=0")
    rule("#livingBathventOn =>||Livingvent:isOff >>  wait(00:00:05); Livingvent:on; log('LivingBathroom is Vent On!')")
    rule("#livingBathventOff =>||Livingvent:isOn >>  wait(00:00:05); Livingvent:off; log('LivingBathroom is Vent Off!')")

     

    If the count is less than 1, the light is off.

    Lights up when count is greater than or equal to 1

     

     

    ======================================================================================

     

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Your catch rule works fine for me (0.81), and I can't see any code has been touched since 0.79 that could affect this.

    Can you try to add

    _debugFlags.dailys=true

    and see if you get a message, "Rescheduling daily ..." ?

     

    And secondly, try 

    rule("@{00:01,catch} =>

    just to see if there is a problem with exactly midnight...

     

    I assume you are running on HC3 and not HC3 Lite? ER4 doesn't run (correctly) on HC3 lite due to the 32bit ints.

    Edited by jgab
    Link to comment
    Share on other sites

    Jan, regret to inform you in Updater I don't have 0.81.

    0.8 is the highest.

    Strange if others have 0.81

    Version 5.110.15

    //Sjakie

    Edited by Sjakie
    add data
    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Jan, regret to inform you in Updater I don't have 0.81.

    0.8 is the highest.

    Strange if others have 0.81

    Version 5.110.15

    //Sjakie

    You need to click the refresh button. 

    It should say

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Please login or register to see this code.

    ok sorry.

    Version 0.81 error

    Don't have it in 0.80

    Please login or register to see this code.

    //Sjakie

    Edited by Sjakie
    add data
    Link to comment
    Share on other sites

  • Topic Author
  • 43 minutes ago, Sjakie said:

    Please login or register to see this code.

    ok sorry.

    Version 0.81 error

    Don't have it in 0.80

    //Sjakie

     

    Yep, that was a real bug.

    Fixed in v0.82 that I just uploaded.

    Link to comment
    Share on other sites

    Jan error solved!

    But a new one occured

    Please login or register to see this code.

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 7 hours ago, Sjakie said:

    Jan error solved!

    But a new one occured

    Please login or register to see this code.

    //Sjakie

    I think that you are running an old version (not v0.82). It's the same error on the same line as the previous error you reported. 

    Link to comment
    Share on other sites

    You are right.

    Updater skip sometimes a QA wierd all my QA's start with ER in the name.

    //Sjakie

    Link to comment
    Share on other sites

     

     

    Please login or register to see this code.

     

    Edited by Sjakie
    its working
    Link to comment
    Share on other sites

    i searched this forum for the last hour - after a multilevel switch type that if i recall correct the @jgab introduced. Anyone recall or can point my the the post ? - 

    Link to comment
    Share on other sites

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