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

Jan,

overloop.pir is one motionsensor.

Used in :

<Rule.eval([[badKamer.deur:breached & badKamer.doucheDeur:breached =>

            log('Check - badKamer.deur:breached %s',badKamer.deur:breached); 
            log('Check - badKamer.doucheDeur:breached %s',badKamer.doucheDeur:breached); 
            log('Check - overLoop.pir:breached %s',overLoop.pir:breached);
            log('Check - overLoop.pir:safe %s',overLoop.pir:safe);
        || overLoop.pir:breached >> openVanBuitenDeurBadKamer=true;
             $SanitairBadKamer='Bezet'; badKamer.Badkamer:on; zolder.mechVentLaag:on;
             myLog('douche deur open openVanBuitenDeurBadKamer -  true  -- GV BadkamerB is BEZET');
        || overLoop.pir:safe >> openVanBuitenDeurBadKamer=false
            $SanitairBadKamer='Vrij'; badKamer.Badkamer:off; zolder.mechVentLaag:off;
            myLog('douche deur open openVanBuitenDeurBadKamer -  false -- GV badkamer is VRIJ');
                ]])>

add in this case it should be safe >>I was in the bathroom

 

  • Topic Author
  • Posted
    On 2/9/2021 at 12:21 PM, Sjakie said:

    Jan,

    overloop.pir is one motionsensor.

    Used in :

    <Rule.eval([[badKamer.deur:breached & badKamer.doucheDeur:breached =>

                log('Check - badKamer.deur:breached %s',badKamer.deur:breached); 
                log('Check - badKamer.doucheDeur:breached %s',badKamer.doucheDeur:breached); 
                log('Check - overLoop.pir:breached %s',overLoop.pir:breached);
                log('Check - overLoop.pir:safe %s',overLoop.pir:safe);
            || overLoop.pir:breached >> openVanBuitenDeurBadKamer=true;
                 $SanitairBadKamer='Bezet'; badKamer.Badkamer:on; zolder.mechVentLaag:on;
                 myLog('douche deur open openVanBuitenDeurBadKamer -  true  -- GV BadkamerB is BEZET');
            || overLoop.pir:safe >> openVanBuitenDeurBadKamer=false
                $SanitairBadKamer='Vrij'; badKamer.Badkamer:off; zolder.mechVentLaag:off;
                myLog('douche deur open openVanBuitenDeurBadKamer -  false -- GV badkamer is VRIJ');
                    ]])>

    add in this case it should be safe >>I was in the bathroom

     

    No, this doesn't make sense. unless the pir is breach just between the log messages being printed but that's seems unlikely. Do you always get that strange log result?

    Posted

    Jan,

    Thanks,

    Situation bathroom; door and pir - entrance; pir

    I was in the bathroom and started to leave the bathroom and noticed the light was acting strange.

    Till now I only have seen it once the passed 24 hours all was okay.

    //Sjakie

     

    Posted

    Jan,

    Correct me if Iam wrong.

    The behaviour of the HC3 with ethernet connection is difference as HC2 it will connect again after loosing signal.

    Last night my ISP had a breakdown and there for need to manual restart my router.

    Can HC3 do that if connection is lost for lets say 15 min? If yes how to implement with a wallplug?

    Thanks in advance for the excellent service,

    //Sjakie

     

    Posted

    Hi, 

     

    Making progress with the setup, looking forward to start more challenging things this week end

    some (stupid) questions, yet I could not find / work out the answer..

     

    - I would like the 4th line of the code below to actually work, meaning, activate the Night mode if all motions are safe for 30 mins, only between 22h and 6h30. But it immediately activate "Night" at 22h even if motions are not safe since 30 mins. I guess I've done something terribly wrong..

    Please login or register to see this code.

    - I tried to have each of these rules to simply log something (the status of the &DayTime variable) each time they are triggered, but always get an error. I believe I do not handle properly the "& log('something') part. What would be the correct way to write it?

     

    - I would like to set up a rule that changes the value to which a Fibaro Dimmer would go ON depending on &DayTIme, if and only when triggered by a manual switch. This, without actually putting the dimmer ON. If this feasible?

     

    Thanks a lot for the support!

     

  • Topic Author
  • Posted (edited)
    8 hours ago, ndelaet said:

    Hi, 

     

    Making progress with the setup, looking forward to start more challenging things this week end

    some (stupid) questions, yet I could not find / work out the answer..

     

    - I would like the 4th line of the code below to actually work, meaning, activate the Night mode if all motions are safe for 30 mins, only between 22h and 6h30. But it immediately activate "Night" at 22h even if motions are not safe since 30 mins. I guess I've done something terribly wrong..

    Please login or register to see this code.

    - I tried to have each of these rules to simply log something (the status of the &DayTime variable) each time they are triggered, but always get an error. I believe I do not handle properly the "& log('something') part. What would be the correct way to write it?

     

    - I would like to set up a rule that changes the value to which a Fibaro Dimmer would go ON depending on &DayTIme, if and only when triggered by a manual switch. This, without actually putting the dimmer ON. If this feasible?

     

    Thanks a lot for the support!

     

    There are 4 types of rules

    • @rules. They schedule the rule to run at specific times. 
      • @10:00 run at 10:00
      • @{10:00,sunset+00:10} runs at 10:00 and 10min past sunset. We use {...} to list several times
      • A specific for @ rules is to add the key 'catch' that runs the rule if the time has past when the QA starts up.
      • So, in your case you can't use catch with trueFor...
    • @@rules that run rules at specific intervals
      • @@00:05 runs a rule every 5 minutes
      • @@+00:05 runs a rule every 5min starting at even 5min.
    • Triggers rules
      • Ex. 66:isOn & 55:isOff => ...
    • Event rules
      • #myEvent => ...

    You can mix trigger and event rules but a '@' or '@@' will only trigger on times or intervals.

    In trigger rules if we want to only trigger at specific times we typically use time interval tests like 'sunrise+00:10..15:00' or day or month tests etc.

     

    4th rule would be

    Please login or register to see this code.

     

    log can use string formatter the same way as Lua's string.format.

    You can then log

    Please login or register to see this code.

    However, you can make a separate rule that log the DayTime when it changes

    Please login or register to see this code.

    This will log the state when other rules change DayTime too.

     

    It's general not possible to make a dimmer start at a given value. (Hue lights can be set to a startup value).

    My strategy is to detect if the lamp is turned on and then immediatly dim it down. Not a perfect solution but it's quick enough so it doesn't completely destroy your night vision :-)

    Please login or register to see this code.

     

    Edited by jgab
    Posted

    Hi Jan, 
    Thanks a lot, very helpful!

    kr

    Posted

    Jan,

    Is it normal practice that HC3 restarts?

    //Sjakie

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

    Jan,

    Is it normal practice that HC3 restarts?

    //Sjakie

    No

    Posted

    Jan, thanks will try to see what is causing it.

     

    Is it possible ER can give a notification if a device is deadand or batery empthy?

    I know Fibaro send message if batery level is below x, they flood my inbox, I have more faith in your solution.

    If yes how to implement?

    Thanks in advance,

    //Sjakie

    Posted

    Hi Jan, 

    A few more (quick) questions

    - I would like a motion sensor to trigger a light, but I would like a person to be able to override this by manually switching off the lamp. If the user manually switchs it off, I would like the rule to be switched off for like 10 min (to avoid the motion sensor to immediately switch the lamp on again). Is this possible?

    - Is there a simple "wake up" script running on ER4? ie: to wake up in the morning with lights increasing slowly over a period of 30 min, and sonos music playing a defined tune?

    - Is there an easy way to integrate a sonos system in the ER4?

    - sometimes, I observe a "lag" in the execution of the rule, of up to 2 sec. What could be the cause? Is there something I can do to optimize this? I'm not running any scene on my HC3, only ER4, and global polling interval is 300s

    Thanks a lot for any ideas!

  • Topic Author
  • Posted
    58 minutes ago, ndelaet said:

    Hi Jan, 

    A few more (quick) questions

    - I would like a motion sensor to trigger a light, but I would like a person to be able to override this by manually switching off the lamp. If the user manually switchs it off, I would like the rule to be switched off for like 10 min (to avoid the motion sensor to immediately switch the lamp on again). Is this possible?

    Please login or register to see this code.

     

     

    58 minutes ago, ndelaet said:

    - Is there a simple "wake up" script running on ER4? ie: to wake up in the morning with lights increasing slowly over a period of 30 min, 

    If you have a dim light you can do

    ...also works now with the :dim property {sec,dir,step,curve,start,stop}

    rule("@sunrise => lamp:dim={5*60,1,1,'linear',0,99)")

     

    58 minutes ago, ndelaet said:

    and sonos music playing a defined tune?

    - Is there an easy way to integrate a sonos system in the ER4?

    call a Sonos QA with fibaro.call(SonosID,"play") etc...

    Please login or register to see this code.

     

     

    58 minutes ago, ndelaet said:

    - sometimes, I observe a "lag" in the execution of the rule, of up to 2 sec. What could be the cause? Is there something I can do to optimize this? I'm not running any scene on my HC3, only ER4, and global polling interval is 300s

    How do you observe the lag?

    Difference between the incoming trigger being logged and the log that the rule is executing?

    I'm asking because sometimes it's just the HC3 that is very slow at sending/receiving z-wave events. When my code does a fibaro.call(88,"turnOn") because a rule says 88:turnOn, I do it and hope that the HC3 executes it fast enough - nothing I can do.

    When a sensor is breached, I pick it up as soon as it hits the HC3 /refreshStates queue. 

     

     

    58 minutes ago, ndelaet said:

    Thanks a lot for any ideas!

     

    Posted
    33 minutes ago, jgab said:

    luxsensor = 99 switch = 109 Util.triggerVar('flag',false) --  declare 'flag' to be a script variable that can trigger rules when it changes value rule("luxsensor:value < 200 & !flag => switch:on") -- if low light and flag is false turn on light rule("switch:isOn & switch:manual >= 0 => flag=true") -- if switch turned on manual then set flag to true --- device:manual returns seconds since it was last changed manually or < 0 if it was changed by script rule("trueFor(00:10,flag) => flag=false") -- when flag been true for 10min turn off flag


    Thanks looks great!

    When trying to implement I get this 

     

    Please login or register to see this code.

     

    (I've changed the 'flag' for 'lightManOffCuisine' everywhere)

    I guess I've not put the Util.triggerVar() in the right place in the main loop..?

     

    35 minutes ago, jgab said:

    How do you observe the lag?

    Difference between the incoming trigger being logged and the log that the rule is executing?

    I'm asking because sometimes it's just the HC3 that is very slow at sending/receiving z-wave events. When my code does a fibaro.call(88,"turnOn") because a rule says 88:turnOn, I do it and hope that the HC3 executes it fast enough - nothing I can do.

    When a sensor is breached, I pick it up as soon as it hits the HC3 /refreshStates queue.

     

    I think the issue is indeed with the HC3 Z Wave; the lag is between the action being logged, and the actual action being launched by the device. Especially for the motion sensors: sometimes 1-2 seconds can pass before the light is actually on...

     

     

  • Topic Author
  • Posted (edited)
    10 hours ago, ndelaet said:


    Thanks looks great!

    When trying to implement I get this 

     

    Please login or register to see this code.

     

    (I've changed the 'flag' for 'lightManOffCuisine' everywhere)

    I guess I've not put the Util.triggerVar() in the right place in the main loop..?

     

     

    I think the issue is indeed with the HC3 Z Wave; the lag is between the action being logged, and the actual action being launched by the device. Especially for the motion sensors: sometimes 1-2 seconds can pass before the light is actually on...

     

     

    Sorry, that was an error. The function to define a trigger variable is Util.defTriggerVar

    So:

    Please login or register to see this code.

     

    Edited by jgab
    Posted

    Working perfectly, thank you.

    I would like to state again that I've never had a home system working soo smoothly and reliably, thanks to the ER4.

    I now have approx 100 rules running, and all is working perfectly. It was easy to set up (for someone like me who knows almost nothing about coding), it's easy to maintain... Quite light in terms of resources... Really great.

    I will try to set up some push notifications to my mobile app in my next round of improvements... Will certainly have more questions!

    Thanks again for such a great development!

    Posted

    Goodmorning Jan,

    <rule("#se-start => 2:msg='HC3 rebooted'; 20:email='HC3 rebooted'; myLog('HC3 Booted up Is in scene beveiligen')")>

    This rule doest notice me if:

    -by admin menu restart

    - by admin menu backup

    The action part is working idf I use @14:00

    Please advice,

    //Sjakie

    Posted

    Jan,

    To give some sensors  a different if>>then option to arm  in the arming scene I like to use this rule, is that possible?

    but =arm generates an error if I changes in == no error.

    I thought in the trigger part ==  and in action =?

    Also the #listSensorStautus doest show  the correct state of the device.

     

    <Rule.eval([[hal.kamerBeneden:isOff & alarmApp.beveiligenComplex:isOn & $VerwarmingVriesStand=='Nee' =>

            bijKeuken.deur:armed==true; log('Bijkeuken deur is - beveiligd')]])>

    <  rule([[#listSensorStatus => log('AANWEZIGSENSORS'); for id,_ in pairs(aanwezigSensors) do log('%s = %s, %s',idname(id),id:armed & 'armed' | 'disarmed',id:safe & 'safe' |'breached'end;>

     

    Please advice,

    //Sjakie

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

    Jan,

    To give some sensors  a different if>>then option to arm  in the arming scene I like to use this rule, is that possible?

    but =arm generates an error if I changes in == no error.

    I thought in the trigger part ==  and in action =?

    Also the #listSensorStautus doest show  the correct state of the device.

     

    <Rule.eval([[hal.kamerBeneden:isOff & alarmApp.beveiligenComplex:isOn & $VerwarmingVriesStand=='Nee' =>

            bijKeuken.deur:armed==true; log('Bijkeuken deur is - beveiligd')]])>

    <  rule([[#listSensorStatus => log('AANWEZIGSENSORS'); for id,_ in pairs(aanwezigSensors) do log('%s = %s, %s',idname(id),id:armed & 'armed' | 'disarmed',id:safe & 'safe' |'breached'end;>

     

    Please advice,

    //Sjakie

    HC2 or HC3?

    Posted

    Hello again, 

     

    So after more in depth testing, it seems that... It does not work as well as I thought ;)

    This rule in particular never seems to turn to "true" even when switch are manually activated:

     

    rule("lightPlafSaM:isOff & lightPlafSaM:manual >= 0 => lightManOffCuisine=true"-- if switch turned off manual then set lightManOffCuisine to true
     
    any clue?
     
    Thanks!
  • Topic Author
  • Posted
    8 hours ago, ndelaet said:

    Hello again, 

    So after more in depth testing, it seems that... It does not work as well as I thought ;)

    This rule in particular never seems to turn to "true" even when switch are manually activated:

    rule("lightPlafSaM:isOff & lightPlafSaM:manual >= 0 => lightManOffCuisine=true"-- if switch turned off manual then set lightManOffCuisine to true
    any clue?

     

    Try add this rule

    Please login or register to see this code.

    and see if it reports 'Manual' or 'Script' when. you flip the switch manual

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