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

Jan,

How to change icon on ER QA?

Please advice,

//Sjakie

Link to comment
Share on other sites

Jan, any idea?

[03.06.2021] [19:10:04] [ERROR] [QUICKAPP1307]: refreshStates:End of file

 

Link to comment
Share on other sites

  • Topic Author
  • 11 hours ago, Sjakie said:

    Jan, any idea?

    [03.06.2021] [19:10:04] [ERROR] [QUICKAPP1307]: refreshStates:End of file

     

    The call to the /refreshStates API (to get triggers) return an error.

    Why I don't know but it is not fatal for the code and it will try again (in 1 second),

    So an single instance of this error will just delay triggers 1s,

    If you get a lot of these errors (>10) in a row you can start to worry that your HC3 doesn't feel too good - or is over worked... 

    Link to comment
    Share on other sites

    Saw these messages also:

    [02.06.2021] [10:36:57] [ERROR] [QUICKAPP96]: refreshStates:Connection reset by peer

    [02.06.2021] [16:36:57] [ERROR] [QUICKAPP96]: refreshStates:Connection reset by peer

    [02.06.2021] [17:06:57] [ERROR] [QUICKAPP96]: refreshStates:End of file

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    The call to the /refreshStates API (to get triggers) return an error.

    Why I don't know but it is not fatal for the code and it will try again (in 1 second),

    So an single instance of this error will just delay triggers 1s,

    If you get a lot of these errors (>10) in a row you can start to worry that your HC3 doesn't feel too good - or is over worked... 

    Jan,

    my HC3 is a kind of "over worked" CPUall 4 100% >> restore version 3 weeks ago and updated all QA's with latests modifications.

    CPU behaviour back to normal?>>>around 30 % and mem usage 27% by restart growing to 60% after longer uptime.

     

    I saw this error in all QA's >>now I understand that I had a delay about 7 seconds (Each QA 1 sec)

    If I restart I dont see this error(s) anymore.

    Thanks for explanation,

    //Sjakie

    Link to comment
    Share on other sites

    @MARCUSP.I.L

    I have a few QA's more!

    Perhaps I could combine a bit more but for me this workable.

    As advice if you are starting I find the usage of colors in debug very handy for incase you need to trouble shoot.

     

    Please login or register to see this code.

      Rules
    1 Grond floor 182
    2 Living (Light & curtains) 95
    3 Guest rooms 104
    4 First floor and sanitair mech fan 137
    5 HUE outside 137
    6 Arming and alarm 197
    7 Heating 43

    Total                895

     

    Succes,

    //Sjakie

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Sjakie said:

    @MARCUSP.I.L

    I have a few QA's more!

    Perhaps I could combine a bit more but for me this workable.

    As advice if you are starting I find the usage of colors in debug very handy for incase you need to trouble shoot.

     

    Please login or register to see this code.

      Rules
    1 Grond floor 182
    2 Living (Light & curtains) 95
    3 Guest rooms 104
    4 First floor and sanitair mech fan 137
    5 HUE outside 137
    6 Arming and alarm 197
    7 Heating 43

    Total                895

     

    Succes,

    //Sjakie

     

    Yes, you can use colors or different debug tags.

    You do have a *lot* of rules, and I guess a lot of devices.

     

    So, in general a lot of rules don't matter that much as rules are normally only triggered by incoming events. ER don't need to go through all rules for every incoming event, it just triggers rules that can be affected by the event (meaning that the event can affect the left side of the '=>' in the rule. Ex. devices and globals appearing in the left side of the rule).

     

    However, a lot of devices usually means a lot of events when polling /refreshStates. This means that the loop that polls /refreshStates and select relevant rules are pretty busy - which of course can lead to cpu loads.

     

    Every ER QA runs its own polling of /refreshStates and with a lot of events it will create cpu load. @sjakie, you have 7 of them and I haven't been doing that many. I will see if I can do a test with multiple ER QAs and come up with some idea on how #instances of ER drives cpu load.

     

    One could also think about dividing up rules between QAs,  so that rules that need fast triggering (like sensors turning on a light when entering a room) are in one QA that polls /refreshStates. That QA would also be responsible to trigger on events and send them to other QAs.

    All other ER QAs could then turn off /refreshStates polling and get their events from the first QA. 

    The ER rules in the latter QAs would react slower but it may not be that important.

     

    Anyway, I will start thinking about this and see if I can come up with something.

     

     

    Link to comment
    Share on other sites

    Jan,

    The 7 QA's is also born for an easy way of life!

    I had problems with heating so I seperated it from another QA.

    20Living light and curtains more or less the same problems with curtains >>>>

    { I hope it is solved now? I used fa Rule.eval([[@sunset  & curtain.front:isOpen =>  curtain.front:closed]])

    the issue here is if curtain was not on end position it did not functioning well.

    Now I use independent of the position Rule.eval([[@sunset  =>  curtain.front:value= 100]])}

    3)Guest rooms>> no chance on  interference by other devices so I seperated this part.

    4)First floor, sanitair and central fan is a combination off 3 QA's (bathroom, mech. fan, kitchen and toilet

    5)HUE outside is the every 10 sec changing of color was a big load on CPU HC3 but no I found some bad things in the rules and finalize it >>>>was running every 10 sec 24/24!

    6)Arming and alarm I combined in one QA>>>8 partitions

    7)Heating also a problem for a longer time >>solved

     

    At this point I could combine some smaller QA's but HC3 runs not to bad at all. So is there a good argument to combine?

    For me the deviding of devices in QA is logical to follow.

     

    PIR's are used to detect of a person is in or out a room >> lights on/off except livingroom and kitchen, they will not being switched off only on. Bedtime switch them off.

     

    What do I have?

    Around 90 Zwave devicess

    Around 40 HUE lights and your QA

    QA Logitech HUB

    QA Media and QA small one Sonos

    QA OWM

     

    Manual switches only kitchen is being used by my director all other lights are operated by HA.

    In below graphical:

    first peak is saving QA number 5

    second is arming scene QA number 6

     

    Jan I hope it will give you a better picture of my HC3 load and please advice shall I combine more or leave it as it is?

     

    Please login or register to see this image.

    /monthly_2021_06/afbeelding.png.6098018fb781f4cd28eac9e8fc5d30c7.png" />

     

     

    //Sjakie

    Link to comment
    Share on other sites

    Hei Jan, been working with eventrunner 3 for a few days now, experimenting with various setups. Great fun.. There was one problem i hadn't foreseen when planning my rules for outside lights and perhaps someone might point me in the right direction in solving this problem ?

    I want to control outside lights for my kids rooms and want them to come on at sunset , set value to 50% one hour after sunset, and set value to 30% two hours after sunset. Turn off at 21.30 Mon-Thur and turn off 23.00 fri,sat. This of course will work fine during the winter months here in Norway but not now during the spring and summer. Sunset yesterday was 22.45. How might i drop the winter rules and cancel turning on lights when sunset is after 21.30 and is there a way to have rules follow the changing sunset times throughout the year ?? I was first thinking about setting variables, one  for sunset , sunset +1 hour , sunset +2 hours etc and have these variables controlling what turns on and off. 

     

    Basically to find a way that eventrunner 3 can track the changing sunset/ sunrise times and adjust function thereafter , 

    ie: Light id 100: 

    Turn on at sunset during the winter and set values 1 and 2 hours after sunset.

    Turn on at sunset during the spring and drop value 2 hours after sunset.

    Don't turn on if sunset is after 21.30 during the summer .

    And gradually repeat the procedure as we head back into winter again.

    I have other outside lights that also follow the set up for my kids rooms but with slightly later off and set value times.

     

    Trying to find a way to automate the time schedule without having to manually adjust turn on , set value times.

    I hope i have managed to explain myself properly and perhaps someone might send a link to something i can read or try out ??

    Otherwise i am delighted with eventrunner and am reading and experimenting when i have time.

     Thanking you in advance

     

    Thanks Sjakie for your reply , i am using HC2 so QA'S won't work.

    Edited by MARCUSP.I.L
    Link to comment
    Share on other sites

  • Topic Author
  • 6 hours ago, MARCUSP.I.L said:

    Hei Jan, been working with eventrunner 3 for a few days now, experimenting with various setups. Great fun.. There was one problem i hadn't foreseen when planning my rules for outside lights and perhaps someone might point me in the right direction in solving this problem ?

    I want to control outside lights for my kids rooms and want them to come on at sunset , set value to 50% one hour after sunset, and set value to 30% two hours after sunset. Turn off at 21.30 Mon-Thur and turn off 23.00 fri,sat. This of course will work fine during the winter months here in Norway but not now during the spring and summer. Sunset yesterday was 22.45. How might i drop the winter rules and cancel turning on lights when sunset is after 21.30 and is there a way to have rules follow the changing sunset times throughout the year ?? I was first thinking about setting variables, one  for sunset , sunset +1 hour , sunset +2 hours etc and have these variables controlling what turns on and off. 

     

    Basically to find a way that eventrunner 3 can track the changing sunset/ sunrise times and adjust function thereafter , 

    ie: Light id 100: 

    Turn on at sunset during the winter and set values 1 and 2 hours after sunset.

    Turn on at sunset during the spring and drop value 2 hours after sunset.

    Don't turn on if sunset is after 21.30 during the summer .

    And gradually repeat the procedure as we head back into winter again.

    I have other outside lights that also follow the set up for my kids rooms but with slightly later off and set value times.

     

    Trying to find a way to automate the time schedule without having to manually adjust turn on , set value times.

    I hope i have managed to explain myself properly and perhaps someone might send a link to something i can read or try out ??

    Otherwise i am delighted with eventrunner and am reading and experimenting when i have time.

     Thanking you in advance

     

    Thanks Sjakie for your reply , i am using HC2 so QA'S won't work.

     

    I understand, I'm raised in Umeå in Sweden and there the sun never goes down some days in the summer. Now in Stockholm it's a bit more resonable and we have sunset ~22:00 at the moment.

     

    So, there are a couple of ways to do this.

    -----------------------------------------------------------------------

    1. Rules conditioned on sunset

    Please login or register to see this code.

    We have to make sure that the rules are mutually exclusive so we test 

    before winter, between winter and summer, and after summer.

     

    -----------------------------------------------------------------------

    2. You could also combine the rules with the "|| <test> >> <actions>" construct. It's like a chained if-then-elseif-then-elseif-then...

     

    Please login or register to see this code.

     

    -----------------------------------------------------------------------

    3. You can divide up the rules in sections and enable them with another rule

     

    Event.SECTION = 'winter'. -- All rules. after. this will be added to section winter

    rule("@sunset  => ...turn on light
    rule("@sunset+01:00  => ...set value 1
    rule("@sunset+02:00 => ...set value 2

     

    Event.SECTION = 'springAutum'  -- All rules. after. this will be added to section springAutum

    rule("@sunset  => ...turn on light
    rule("@sunset+01:00 => ...set value 1

     

    Event.SECTION = 'summer'   -- All rules. after. this will be added to section summer

    rule("@sunset  =>. log('Too late, no lights turned on')")

     

    Event.SECTION = nil -- No more sections

     

    -- Enable rules depending on sunset.  

    -- enable(section,true) will enable section and disable all other defined sections

    -- enable(section, false) will enable section and leave other sections as they are

    rule([[@{00:00,catch} => 

       || sunset <  17:00 >> enable('winter', true)

       || sunset <  21:30 >> enable('springAutum', true)

       || sunset >=  21:30 >> enable('summer', true)

    ]])

     

     

     

    Link to comment
    Share on other sites

    Jan I do something wrong.

    Please login or register to see this code.

    To minimize messaging I started to use complete (0) in my case 20

    If 20 get armed I want also in alrm panel all lights on>>green.

    If I arm 20 it will start with 26,27,28 (no time delay) will arm but a few seconds later disarm.

    I dont have any rule for specific disarm those partitions.

    Fa to arm 26

    Please login or register to see this code.

    Trigger are common.

    What do I miss?

    //Sjakie

    Link to comment
    Share on other sites

    Something, somewhere went wrong!

    If arming scene had a breached device alarm was triggered and making a lot of noice>>> great!!

    Unfortuanally it also restarted the QA, the last debugs where normal.

    I restored an older version adapt and modified reduced 250>>200 rules should that be the problem.

    After one alarm the QA stays on so I hope the problem is gone.

    The number of messages is back to a minimum.

    Thanks for your support,

    //Sjakie

     

    Link to comment
    Share on other sites

    Hei again Jan, i wonder if you might have some ideas on how to fine tune sunset/ sunrise rules. I have tried various setups using rules/ test-action / and sections using the months of the year, Jan -Dec.  The problem now ( or idea) is to fine tune the rules for each day of the month. Now in June the sunset/sunrise times change by 17 minutes from June 1 to June 30.

    In July it is 50 minutes , August 90 minutes and so on....

    By using Winter-Spring-Summer i found that the timings are hard to calculate , as the sunset periods are constantly changing and it's hard to find and estimate value.

    I looked at the idea of having rules with sunset times for each day  of the month as value but it seems somewhat cumbersome to have 365 rules ?

    Is it possible to enter sunset/sunrise values for each month , in a table fex, and have rules or conditions that call this table  ?

     

    For example: @sunset ==(from June 1 to June 18 )(table of sunset-sunrise times) => do several actions

                           @sunset ==(from June 18 to June 30 ) => do several actions

     

    and as the year moves on:

                            @sunset ==August 1-5 (table of sunset-sunrise times) => turn on, dim after sunset, etc

                            @sunset ==August 5-10 (table of sunset-sunrise times) => turn on, dim after sunset, dim 30 min  after sunset, etc

                            @sunset ==August 10-20 (table of sunset-sunrise times) => turn on, dim after sunset, dim 1 hour after sunset, etc

                            @sunset ==August 20-31 (table of sunset-sunrise times) => turn on, dim after sunset, dim 2 hours after sunset, etc

     

    and so forth throughout the year..

      This might seem light a little overkill but i am trying to adjust actions based on days/months when the sunset/sunrise values differ by a big enough margin that has effects on timing and overlapping. 

     

    It is hard to test my ideas in emulator as the test time is 200 hours. Perhaps there is a setting that allows longer running time ?

    I hope i have managed to explain myself and thank you once again for your invaluable help.

    Otherwise the eventrunner is working like a charm and i see many other applications that i will try for my setup.

    Thanks again                                 

    Edited by MARCUSP.I.L
    Link to comment
    Share on other sites

    @MARCUSP.I.L,

    I use to differenciate sunrise/sunset

    Please login or register to see this code.

    In this rule in combination with weather if its cloudy %

    The time interval I use often in combination with sunrise or sunset.

    I can understand the deviation if you use only sunset/sunrise in january and juli.

    //Sjakie

    Link to comment
    Share on other sites

    Jan,

    If I use

    Please login or register to see this code.

    it will not work for a post?

    Do I need to use a way around?

    Please login or register to see this code.

    Or do you have a better solution?

    Thanks,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 19 hours ago, MARCUSP.I.L said:

    Hei again Jan, i wonder if you might have some ideas on how to fine tune sunset/ sunrise rules. I have tried various setups using rules/ test-action / and sections using the months of the year, Jan -Dec.  The problem now ( or idea) is to fine tune the rules for each day of the month. Now in June the sunset/sunrise times change by 17 minutes from June 1 to June 30.

    In July it is 50 minutes , August 90 minutes and so on....

    By using Winter-Spring-Summer i found that the timings are hard to calculate , as the sunset periods are constantly changing and it's hard to find and estimate value.

    I looked at the idea of having rules with sunset times for each day  of the month as value but it seems somewhat cumbersome to have 365 rules ?

    Is it possible to enter sunset/sunrise values for each month , in a table fex, and have rules or conditions that call this table  ?

     

    For example: @sunset ==(from June 1 to June 18 )(table of sunset-sunrise times) => do several actions

                           @sunset ==(from June 18 to June 30 ) => do several actions

     

    and as the year moves on:

                            @sunset ==August 1-5 (table of sunset-sunrise times) => turn on, dim after sunset, etc

                            @sunset ==August 5-10 (table of sunset-sunrise times) => turn on, dim after sunset, dim 30 min  after sunset, etc

                            @sunset ==August 10-20 (table of sunset-sunrise times) => turn on, dim after sunset, dim 1 hour after sunset, etc

                            @sunset ==August 20-31 (table of sunset-sunrise times) => turn on, dim after sunset, dim 2 hours after sunset, etc

     

    and so forth throughout the year..

      This might seem light a little overkill but i am trying to adjust actions based on days/months when the sunset/sunrise values differ by a big enough margin that has effects on timing and overlapping. 

     

    It is hard to test my ideas in emulator as the test time is 200 hours. Perhaps there is a setting that allows longer running time ?

    I hope i have managed to explain myself and thank you once again for your invaluable help.

    Otherwise the eventrunner is working like a charm and i see many other applications that i will try for my setup.

    Thanks again                                 

     

    Ok, I think that having 365 rules are not manageable from a human perspective. Having different rules for different date intervals is more manageable. 

    Myself I adjust the rules depending on what hours sunrise/sunset hours happens - because the rules depend on the light outside but also the family's behaviours. However, it much simpler then what you seems to be aiming for.

     

    The previous example I gave you adjusted winter/summer etch depending on what time sunset/sunrise happened, and then had different rules for each of them (grouping them in segments). You could divide up segments depending on date intervals to instead of sunset hour.

     

    Maybe not exactly what you need but another function that may be helpful is this

    Please login or register to see this code.

    It will calculate 2 variables, sunriseDiff and sunsetDiff, that contains the difference in minutes for sunrise and sunset over 30 days (15 days before and 15 days after current date). The number of days can be adjusted with the constant sunDiffDays. The result is expressed in minutes (+/-).

     

    This can be used in adjusting rules depending on how fast sunrise is changing in the period.

     

    But lets continue this discussion...

    24 minutes ago, Sjakie said:

    Jan,

    If I use

    Please login or register to see this code.

    it will not work for a post?

    Do I need to use a way around?

    Please login or register to see this code.

    Or do you have a better solution?

    Thanks,

    //Sjakie

    You want to log when woonKamer.gordijnOpRit:isOpen ?

    rule("woonKamer.gordijnOpRit:isOpen => log('#C:orange#Check - woonKamer.gordijnOpRit:isOpen %s',woonKamer.gordijnOpRit:isOpen)")

     

    Or??

     

    Your log statement is outside the Rule.eval[...] ??

     

    I do not understand the second example. Please clarify.

    Link to comment
    Share on other sites

    Jan, sorry if I do check it will work excellent for devices, GV, and defTrigger.

    I want also some check on post

     

    Please login or register to see this code.

    My way : If post(#opStaan)

    create:

    Please login or register to see this code.

    Now I can have  a check on post (#opStaan)

    Or do you have something better?

    //Sjakie

    Link to comment
    Share on other sites

    Thanking you both for your quick response, i really appreciate it. I will look at all suggestions and see if i can find a medium that works best for me.

     

    I like the idea of sunDiffDays  and/ or  rule eval with clouds because the light changes quickly here in Norway after summer . I might have to assess my ideas a little but i wanted to change the values of outside lights over a period of time after sunset up til midnight , especially through the spring, autumn and the winter. I have a lot of outside lights, many of them directly above large windows facing bedrooms, living room etc. The garden is scattered with 5 separate lighting zones , some are in planting areas , some are walkways etc. 

    I really enjoy working on this as eventrunner has has so many possibilities and testing is quite easy.

    Jan, is there a link that gives me more insight into what is under the hood in eventrunner ? I dont remember seeing anything previously about sunDiffDays ? Just wondering what else is available in the program? 

    Anyway, thanking you once again for all of your ideas and for finding the time to respond,  i thank you..

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Jan, sorry if I do check it will work excellent for devices, GV, and defTrigger.

    I want also some check on post

     

    Please login or register to see this code.

    My way : If post(#opStaan)

    create:

    Please login or register to see this code.

    Now I can have  a check on post (#opStaan)

    Or do you have something better?

    //Sjakie

    So you want to check if you have posted the event #opStaan ?

    This rule trigger if event #opStaan is sent and sets the variable opStaan

    Please login or register to see this code.

    ...and then if variable opStaan is set you log

    Please login or register to see this code.

     

    ..but why don't do it in once rule?

    Please login or register to see this code.

     

    If you want to use the trigger var opStaan you need to set it false also otherwise it will not trigger (it only trigger when it goes from true to false or false to true)

    Link to comment
    Share on other sites

  • Topic Author
  • 35 minutes ago, MARCUSP.I.L said:

    Thanking you both for your quick response, i really appreciate it. I will look at all suggestions and see if i can find a medium that works best for me.

     

    I like the idea of sunDiffDays  and/ or  rule eval with clouds because the light changes quickly here in Norway after summer . I might have to assess my ideas a little but i wanted to change the values of outside lights over a period of time after sunset up til midnight , especially through the spring, autumn and the winter. I have a lot of outside lights, many of them directly above large windows facing bedrooms, living room etc. The garden is scattered with 5 separate lighting zones , some are in planting areas , some are walkways etc. 

    I really enjoy working on this as eventrunner has has so many possibilities and testing is quite easy.

    Jan, is there a link that gives me more insight into what is under the hood in eventrunner ? I dont remember seeing anything previously about sunDiffDays ? Just wondering what else is available in the program? 

    Anyway, thanking you once again for all of your ideas and for finding the time to respond,  i thank you..

     

    It's easy to use Lua functions from ER rules. The sunDiff function is a Lua function that uses the Util.sunCalc function.

    ER has a number of Lua function that it uses for internal usage and some of them are accessible in Util.*

    Util.sunCalc is used every midnight to calculate the sunrise/sunset variables. The reason I use my own function is that the builtin sunrise/sunset functions in the HC3 (and HC2) sometimes don't update the sunrise/sunset variables until 00:30-01:00...

    Also, Util.sunCalc(time) can calculate the suntimes for any date in the future or past.

    In ER you have sunrise, sunset, dawn, and dusk as variables and the latter can be better in some cases.

    rule("@dawn => log('Starting to get some light before the sun rises')")

    rule("@dusk => log('When it gets completely dark')")

     

    rule("@22:00 & sunset..dusk => lamp:value=50") --Turn on lights 50% at 22:00 if between sunset and dusk

    rule("@22:00 & now >= dusk => lamp:value=100") --Turn on lights 100% at 22:00 if after dusk

     

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