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

Is there any possibility to create a rule that, when the automatic heating schedule is set to 16 degrees and the temperature outside drops below -10 degrees, will set the temperature to 22 degrees until the temperature is set to 25 degrees according to the schedule, or the outside temperature will rise above -10?

 

My schedule for working day looks like this:

 

Please login or register to see this attachment.

Posted
8 hours ago, jgab said:

 

You need to keep a state of what is 'next' in your list

You could make a list 'object' with this function

Please login or register to see this code.

 

every

Please login or register to see this code.

will return the next value in the list and wrap around

 

 

8 hours ago, jgab said:

 

If many devices of this type is needed it could make sense to do a master QA that creates child devices of selected types.

Than You @jgab:-) ?? 

Posted
11 hours ago, jgab said:

 

You need to keep a state of what is 'next' in your list

You could make a list 'object' with this function

Please login or register to see this code.

 

every

Please login or register to see this code.

will return the next value in the list and wrap around

 

Hi @jgab

 

The wrapper works perfect ?, but my createList{'255,0,0', '255,255,0', '0,0,255', '0,255,0'} gives me issue because of the quotes. that is passed into COH.

'255,0,0' is the value for red - is there an easy fix for having a tabel like this ?

 

Please login or register to see this code.

  

Please login or register to see this code.

 

  • Topic Author
  • Posted (edited)
    23 minutes ago, ChristianSogaard said:

    Hi @jgab

     

    The wrapper works perfect ?, but my createList{'255,0,0', '255,255,0', '0,0,255', '0,255,0'} gives me issue because of the quotes. that is passed into COH.

    '255,0,0' is the value for red - is there an easy fix for having a tabel like this ?

     

    Please login or register to see this code.

      

    Please login or register to see this code.

     

    Edited by jgab
    • Thanks 1
  • Topic Author
  • Posted
    21 hours ago, petrkl12 said:

     

    all rules that are connected:

    Please login or register to see this code.

     

     

     

    It looks like d.red is nil when you do cancel(d.ref)

    If you do a log of the ref value before cancel?

    Please login or register to see this code.

     

    Posted
    14 hours ago, jgab said:

    Please login or register to see this code.

     

     

    On 9/9/2020 at 10:33 PM, jgab said:

     

    With the "new" location trigger one can do rules like this

    Please login or register to see this code.

    The set of rules keep track of the number of people at home, all, some, and none.

    It can trigger rules with the trigger variables 'allAway', 'allAtHome' and 'someAtHome'

    Now 'allAtHome' causes 'someAtHome' to trigger too - it's easy to modify if you want it exclusive.

    When the QA starts locations are unknown - need some more code to lookup current positions.

    Hi @jgab - i have startet using these EV4 rules for my alarm :-)

    For the "When the QA starts locations are unknown - need some more code to lookup current positions." - is there a way to catch up positions when starting the rule, instead og waiting for everyone has left the house, and reentered ?  

  • Topic Author
  • Posted
    27 minutes ago, ChristianSogaard said:

     

    Hi @jgab - i have startet using these EV4 rules for my alarm :-)

    For the "When the QA starts locations are unknown - need some more code to lookup current positions." - is there a way to catch up positions when starting the rule, instead og waiting for everyone has left the house, and reentered ?  

    I guess you could do this at startup to prime the rules

    Please login or register to see this code.

     

    • Thanks 1
    Posted
    1 hour ago, jgab said:

    I guess you could do this at startup to prime the rules

    Please login or register to see this code.

     

    Thank you Jan - Very Cool. -I will test ??

    Posted

    Jan,

    Talking about alarm if I arm the complex it will give error on partition 1 open door/window.

    I cant find any of this devices in partition1.

    If all other partitions are armed I can manually press the button and it will arm without any problem.???

    Partition1 has a delay 15 sec

    Partiton2 has a delay 20 sec

    Partiton3 has a delay 15 sec

    the others no delay

    I add:

    Rule.eval([[alarmApp.beveiligenComplex:isOn & hal.deur:breached =>
                2:msg='Let Op; er staat een hal deur open';
             log('Let Op; er staat een hal deur - open')
                         ]])

    but this shows nothing.

    Please advice,

    //Sjakie

    Posted (edited)
    48 minutes ago, ChristianSogaard said:

    Thank you Jan - Very Cool. -I will test ??

    I tried adding this in EV4 - first and second try gives this. any idea?

    Please login or register to see this code.

     

    Also I tried the swagger an there is a tracking thing per user. that is OFF

    I tried enabling the GEO fencing in the APP  - but it dont change this setting.

     

    Also - can you filter out the superuser here? 

     

    Please login or register to see this image.

    /monthly_2021_01/2021-01-18_13-44-50.png.121de00ca9b85193701ac53b19675c64.png" />2021-01-18_13-43-37.png.4235366932d13df8da0741611078bacd.png

    Edited by ChristianSogaard
    P
    Posted

    Jan,

    Is this something to worry?

    I know its a warning but it will take some time.

    [18.01.2021] [17:26:58] [WARNING] [QUICKAPP798]: Slow events {"type":"januari","_from":801}, 28s[18.01.2021] [17:26:58] [DEBUG] [QUICKAPP798]: onAction: {"actionName":"RECIEVE_EVENT","args":[{"ev":{"_time":1610987193,"type":"winter","_from":801},"type":"EVENT"}],"deviceId":798}[18.01.2021] [17:26:58] [WARNING] [QUICKAPP798]: Slow events {"type":"winter","_from":801}, 25s[18.01.2021] [17:26:58] [DEBUG] [QUICKAPP798]: onAction: {"actionName":"RECIEVE_EVENT","args":[{"ev":{"_time":1610987193,"type":"winter","_from":801},"type":"EVENT"}],"deviceId":798}[18.01.2021] [17:26:59] [WARNING] [QUICKAPP798]: Slow events {"type":"winter","_from":801}, 25s[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: [true]>>'Rule:1[@{catch,05:00} => Util.checkForUpdates()]'[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: No subscriber for {"type":"foo"}[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: wait(5); publish(#foo) = {"type":"foo"}[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: -------- Event stats: 68s------------[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: Triggers:0  0/s[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: Tried   :1  0/s[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: Matched :1  0/s[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: [{"type":"januari"}]>>'Rule:77[#januari | #februari | #maart | #april | #oktober | #november| #december => ...]'[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: koudeMaanden is true[18.01.2021] [17:26:59] [ERROR] [QUICKAPP798]: refreshStates:End of file

    Posted
    W dniu 17.01.2021 o 13:42, michal85pl napisał:

    Is there any possibility to create a rule that, when the automatic heating schedule is set to 16 degrees and the temperature outside drops below -10 degrees, will set the temperature to 22 degrees until the temperature is set to 25 degrees according to the schedule, or the outside temperature will rise above -10?

     

    My schedule for working day looks like this:

     

    Please login or register to see this attachment.

    or maybe it will be easier to move the entire schedule to er4? can you tell me how to set the temperature on the thermostat from the rule level?

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

    Jan,

    Is this something to worry?

    I know its a warning but it will take some time.

    [18.01.2021] [17:26:58] [WARNING] [QUICKAPP798]: Slow events {"type":"januari","_from":801}, 28s[18.01.2021] [17:26:58] [DEBUG] [QUICKAPP798]: onAction: {"actionName":"RECIEVE_EVENT","args":[{"ev":{"_time":1610987193,"type":"winter","_from":801},"type":"EVENT"}],"deviceId":798}[18.01.2021] [17:26:58] [WARNING] [QUICKAPP798]: Slow events {"type":"winter","_from":801}, 25s[18.01.2021] [17:26:58] [DEBUG] [QUICKAPP798]: onAction: {"actionName":"RECIEVE_EVENT","args":[{"ev":{"_time":1610987193,"type":"winter","_from":801},"type":"EVENT"}],"deviceId":798}[18.01.2021] [17:26:59] [WARNING] [QUICKAPP798]: Slow events {"type":"winter","_from":801}, 25s[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: [true]>>'Rule:1[@{catch,05:00} => Util.checkForUpdates()]'[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: No subscriber for {"type":"foo"}[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: wait(5); publish(#foo) = {"type":"foo"}[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: -------- Event stats: 68s------------[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: Triggers:0  0/s[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: Tried   :1  0/s[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: Matched :1  0/s[18.01.2021] [17:26:59] [DEBUG] [QUICKAPP798]: [{"type":"januari"}]>>'Rule:77[#januari | #februari | #maart | #april | #oktober | #november| #december => ...]'[18.01.2021] [17:26:59] [TRACE] [QUICKAPP798]: koudeMaanden is true[18.01.2021] [17:26:59] [ERROR] [QUICKAPP798]: refreshStates:End of file

    Well,  it's a warning. It's not great as it tells us that it takes more than 5s to make a fibaro.call between two QAs.. (remote(...)).

    It can happen at startup due to the QA doing startup things (like checking if there is an update available)

    If the warning is repeated continuously I should be more worried.

  • Topic Author
  • Posted
    13 hours ago, michal85pl said:

    or maybe it will be easier to move the entire schedule to er4? can you tell me how to set the temperature on the thermostat from the rule level?

    I have no experience of thermostats and the Hc3 so I don't really know.

    It's quite easy to retrieve the current setting

    Please login or register to see this code.

    but modifying the current day's current heating setting gives an error (400)

    Please login or register to see this code.

    so, someone needs to figure out how to change it... if possible. ...and then the question is if it affects the current heating setting.

    Posted

    Jan, thanks!

    Is there a possibility that the rule numbers who are showing up in debug can come also in the "text"field of the QA on one way or another?

    Because my QA's  are large I have several log lines to find my way in case of adapting a rule.

    If possible it can clean up my debug out come.

    Or is there another way to go?

    thanks in advance,

    //Sjakie

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

    Jan, thanks!

    Is there a possibility that the rule numbers who are showing up in debug can come also in the "text"field of the QA on one way or another?

    Because my QA's  are large I have several log lines to find my way in case of adapting a rule.

    If possible it can clean up my debug out come.

    Or is there another way to go?

    thanks in advance,

    //Sjakie

    I think the real way to do that. is to tag the logs differently.

    Normally when doing debug/trace the tag is QUICKAPP<ID> and that can be changed by setting the lua variable __TAG.

    The advantage is that in the Log window you can choose to only see debug statements with a given tag - thus filtering out what is interesting. 

    I have chosen not to differentiate with tags in ER4 because I haven't come up with a model that suits all cases.

    However, in ER4 there is a helper function that can debug with a different tag and color and can be used by your rules.

    Please login or register to see this code.

    and then you can filter on tag 'LOG'

    Posted

    Jan, thanks!

    function paste in main just under function Quickapp

    Rule.eval([[@12:37 & doucheRuimteVrij==false => myLog('doucheRuimte - Bezet','red')]])
    Doest show red in debug
     
    //Sjakie
  • Topic Author
  • Posted
    1 hour ago, Sjakie said:

    Jan, thanks!

    function paste in main just under function Quickapp

    Rule.eval([[@12:37 & doucheRuimteVrij==false => myLog('doucheRuimte - Bezet','red')]])
    Doest show red in debug
     
    //Sjakie

    It does, and it does it under the tag "LOG" as it was defined in that way in my previous example.

    Posted

    Jan, stupid me I used the wrong QA number, sorry!

    I must consider to reduce the number of rules because you mentioned I have plenty of them.

    Possibility to combine more rules if trigger is the same, result will be estimated 20 rules.

    Integrate the logs I have for all separate devices:

    Rule.eval([[lightEntree:isOn => log('light entree - On')]])>>> will gain 100-150 rules!

    Jan thanks again for the valuable advice,

    //Sjakie

     

    Posted (edited)
    On 9/4/2020 at 9:54 AM, jgab said:

     

    You could put the variables in a table (HT). ER4 rules can use Lua globals or variables defined with Util.defvars.

    The "if-then" has the format "|| <test1> >> <actions1> || <test2> >> <actions2> ...

    It reads nicer using a multi-line string [[ ..... ]]

    Please login or register to see this code.

    The usage of a table with values allows you to structure your constants like this

    Please login or register to see this code.

    then you can have a variable named 'light' in some other place than db... like kitchen.light

    Hi @jgab i started using this Local HT in my rules.

    Is there a way to import the named already configured in the system?

    An example here is the Garage.g:Scene = 413

    Or is there a way to export the names and deviceIDs, to re-use in EV4. To avoid mistakes when "cloning" more that 100 device names into EV4?.  

    Please login or register to see this image.

    /monthly_2021_01/image.png.5924646e4644d90d32f58eb0bb5b1944.png" />

     

     

     

     

    Please login or register to see this code.

     

    Edited by ChristianSogaard
    P

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