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

mmmhhh  is this true?? No idea where to look! no further info. QA restaring

Please login or register to see this code.

 

Posted
4 minutes ago, KaWi said:

Please login or register to see this code.

 

Please login or register to see this code.

Is wday('last') no longer available?

 

I switched from v0.1.29 back to v0.1.28. There is no error in v0.1.28

Posted (edited)

Please login or register to see this code.

My rule TOD  does't work Avond_Vroeg is >> Early Evening Variable show still >> Late_Afternoon

 

Any quick solve for a QA who is in a loop?

Edited by Sjakie
loop
  • Topic Author
  • Posted
    39 minutes ago, KaWi said:

    Please login or register to see this code.

     

    Please login or register to see this code.

    Is wday('last') no longer available?

    It's not the wday('last') that crashed, it was my fix for tracking :manual.
    I posted v0.1.30 that fixes it.

  • Topic Author
  • Posted
    4 hours ago, Sjakie said:

    Jan, about the restart it's for summer/winter time or did you implement it in ER7?

    Yes, nextDST() is still there.

     

     

    4 hours ago, Sjakie said:

    The external Hue is excellent but perhaps a challenge?

    Please login or register to see this code.

    Zithoek_Verlichting  & Licht_Show  are zones.

    In this example I switch Studio what is a room 

    Can you separate it or is Hue giving the same signal out?


    Ehh, I don't understand. You want check if it's a room or a zone?

    Posted

    okay a room contains lights

    a zone can contain lights from different rooms

    If zone is switched on the correspondent rooms will switch on also in the Hue app.

    In HC3 you  see than several rooms and the zone notify the light is on. So for HC3 in my case I like only to see the zone or rooms who aren't part of a zone to minimize debug lines or as a choice.

    This I see after restart without touching the hue app

    Please login or register to see this code.

     

    Posted

    Please login or register to see this code.

    I can't find what is wrong with this rule

    Posted

    Good Morning,

    I have some trouble with this rule:

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    ID247 is HT.blind_Nr_4

    The rule started if $Present_Kai=='away' and $Present_Katharina=='away'. But it should only check @22:00+rnd and then run.

    I can´t find the fail. In ER5 the rule runs without problems

  • Topic Author
  • Posted (edited)
    1 hour ago, KaWi said:

    Good Morning,

    I have some trouble with this rule:

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    ID247 is HT.blind_Nr_4

    The rule started if $Present_Kai=='away' and $Present_Katharina=='away'. But it should only check @22:00+rnd and then run.

    I can´t find the fail. In ER5 the rule runs without problems

    Sorry, rules with @daily triggers and normal triggers are always a bit tricky to get right and I always save it to last to implement... this time I forgot. This caused your rule to trigger when 247 was changed state.
    Anyway, now in v0.1.32 it is fixed 🤞

     

    1 hour ago, Sjakie said:

    Please login or register to see this code.

    I can't find what is wrong with this rule

    You have an 'end' last in the rule that doesn't belong there.

    Edited by jgab
    Posted
    15 minutes ago, jgab said:

    Sorry, rules with @daily triggers and normal triggers are always a bit tricky to get right and I always save it to last to implement... this time I forgot. This caused your rule to trigger when 247 was changed state.
    Anyway, now in v0.1.32 it is fixed 🤞

    Thank you very much for the help.😀

  • Topic Author
  • Posted (edited)

    When a rule condition becomes true it's actions is executes

    Please login or register to see this code.

    While the action part runs no other rule can run until the action finish. Lua is a single threaded language.

    However, if we include a wait(seconds) in the action, the rule is suspended and other rules can run meanwhile.

    Please login or register to see this code.

    With the wait, it logs A,C,B
    without the wait the log would be A,B,C

    wait is implemented by starting a setTimeout to run the rest of the rule after the wait.

    Timers the rule start with setTimeout is recorded with the rule. Also if we do a post for the future, a timer is started and recorded.

    Please login or register to see this code.

    This run triggers when a sensor is breached, turn on a lamp and post an event to turn off the lamp after 5min.
    Here we must remember the timer reference post returns so we can cancel ev. timer when the sensor is breached.
    This is because we typically want to extend the period the lamp is on if the sensor is breached again while the lamp is on.

    This is such a common pattern, so we can tell the rule to cancel all it's timers when the rule is triggered again.

    Please login or register to see this code.

    The 'single' keyword cancels all timer the rule have started earlier when triggered again, in this case the eventual post. No need to track the ref ourself and cancel it.

    With 'single' we can make this rule even simpler.

    Please login or register to see this code.

    The 'single' keyword will cancel the timers, so if an earlier invocation of the rule was sleeping in the wait(00:05) it will be canceled. So, we get the "extend lamp time when sensor breached again" logic in a simple way.

    All of these examples do turn on the light even if the light is already on. Normally, that is not a problem, but otherwise it's easy to add a check for that.

     

    Edited by jgab
    Posted

    Jan, since HC2 I use fa:

    pir:breached | radar:isOn | door:isOpen => $Occupation = 'Yes'. So as long as $Occupation don't change all stay the same

    halfway using HC3  I use pir:breached | radar:isOn | door:isOpen => action. Now everytime one of the trigger is triggered it result in action.

    Does this make sense?

     

    Just to show ER7 is running a few resources:

    7 QA's with around 1100 rules

    62 Z-Wave devices

    70 Hue devices

     

     

    remark I know it's an open door but I still notice it if HC3 memory is climing;

    RAM is growing it's not giving back if used

    short after restart 44% - 4% -  31% - 21%

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Posted

    Jan,

    Since HC2 I use:

    pir:breached | radar:isOn | door:isOpen => $Occupation = 'Yes'.   $Occupation == 'Yes' => several actions

     

    One year ago I switched: pir:breached | radar:isOn | door:isOpen =>action

    Does that make a difference or better to use the GV as trigger for follow up?

     

    ER7

    6 QA's

    62 Z-wave devices

    70 Hue lights

    Posted

    No idea what's wrong?

    Please login or register to see this code.

    V0.1.32

    Should this error also be listed in debug window if error is selected??

    Is easier to see all your error instead of scrolling trough each QA??

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

    No idea what's wrong?

    Please login or register to see this code.

    V0.1.32

    Should this error also be listed in debug window if error is selected??

    Is easier to see all your error instead of scrolling trough each QA??

    Are you missing the '=>' ? 
    appPhone.alarm_Ring:isOn => log.yellow('a ....

    Yes, they should be tagged as errors. Fixed that in v0.1.33.

  • Topic Author
  • Posted (edited)
    28 minutes ago, Sjakie said:

    Jan,

    Since HC2 I use:

    pir:breached | radar:isOn | door:isOpen => $Occupation = 'Yes'.   $Occupation == 'Yes' => several actions

     

    One year ago I switched: pir:breached | radar:isOn | door:isOpen =>action

    Does that make a difference or better to use the GV as trigger for follow up?

    If you use 

    Please login or register to see this code.

    the action will run every time any of the triggers change, and at least one of them (not necessarily the one that changed!) is true.


    If you do

    Please login or register to see this code.

    the action will only run when Occupation goes from 'No' to 'Yes'.
    If Occupation is already 'Yes', setting it to 'Yes' again will not trigger the third rule.
    The second rule make sure that when all triggers are false, Occupation is set to 'No'

    Edited by jgab
    Posted

    Jan why you write

    Please login or register to see this code.

    instead off:

    Please login or register to see this code.

    Is your rule better for HC3?

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

    Jan why you write

    Please login or register to see this code.

    instead off:

    Please login or register to see this code.

    Is your rule better for HC3?

    No, but you want to set it to 'No' if none of the triggers are true?
    You could write

    Please login or register to see this code.

    e.g. no trigger is detecting anyone at home.

    ...or did I misunderstand your intention?

    Posted

    Nope correct just curious, thanks.

  • Topic Author
  • Posted
    2 hours ago, Sjakie said:

    Just to show ER7 is running a few resources:

    7 QA's with around 1100 rules

    62 Z-Wave devices

    70 Hue devices

     

    remark I know it's an open door but I still notice it if HC3 memory is climing;

    RAM is growing it's not giving back if used

    short after restart 44% - 4% -  31% - 21%

    Please login or register to see this attachment.

    Please login or register to see this attachment.

     

     

    I think it looks good. In general we shouldn't worry too much about the memory. Linux will try to use as much memory as possible for buffers and cache etc. In your case even the 50% used can be partly released when memory pressure increases if apps are written correctly.

    EventScript is so scalable because it only tries rule that can react on a specific event, when that specific event happens.
    This means you can have thousands of rules (well, memory is a constraint here), and ER will only trigger relevant rules.

    Each rule is inspected what events it can trigger on and a clever hash lookup mechanism maps incoming events to rule signatures, so we can quickly pick out what rules to try.
    Some other system loop through all rules at intervals to see which rules should fire, which of course creates a constant load on the system that grows with number of rules.

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