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, keep it on hold working with Joep on it.

daystart_power_import_t1_kwh' that is quickAppVariable or globalVariable? >>quickAppVariable

 

Link to comment
Share on other sites

  • Topic Author
  • On 8/27/2022 at 9:57 AM, Sjakie said:

    Good morning Jan,

    I have some difficulties to get it work.

    From Joep Verhaeg his P1 monitor QA I want to use some values

    Please login or register to see this code.

    This comes from QA 1840 as String variable it is listed in >>Variables (but not listed in Global Variables) >>> daystart_power_import_t1_kwh
    how to use in ER?
    Thanks in advance,

     

    If daystart_power_import_t1_kwh,daystart_power_import_t2_kwh, and TotalGas are your quickAppVariable

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    4 hours ago, ChristianSogaard said:

    Hi Jan  Thank you for providing ideas and fixes :-)

    I have chosen to go a little other direction.

     

    I shared a little of my HTab used in EV4.

    Perhaps you can show how within EV4 remove an entry from this local HTab ?

     

    Example 

    • remove 1000 from rooms.all in local HTab
    • ADD 1000 to rooms.all to local HTab

     

     

    Please login or register to see this code.

     

    I think this way should be easier for me to manage

    Link to comment
    Share on other sites

    Jan,

    Please login or register to see this code.

    Yes they are QuickAppVariable  in QA 1953, the value of those items are listed in QA 1953 Variables/ string variable

    In ER QA 1905 i use

    Please login or register to see this code.

    But it don't show the value

    Link to comment
    Share on other sites

  • Topic Author
  • 10 hours ago, Sjakie said:

    Jan,

    Please login or register to see this code.

    Yes they are QuickAppVariable  in QA 1953, the value of those items are listed in QA 1953 Variables/ string variable

    In ER QA 1905 i use

    Please login or register to see this code.

    But it don't show the value

    No you can't access quickApppVariables from another QA that way. $$ is only for the quickAppVariables in the ER QA.

    Either

    Please login or register to see this code.

     

    or, make a trigger for them that sets variables in ER

    Please login or register to see this code.

    and use them as regular variables in your rules

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    I think I see some values t1 and t2

     

    If I want to use them it does't work variable not found.

    Please login or register to see this attachment.

    Edited by Sjakie
    added picture
    Link to comment
    Share on other sites

    Hehe fixed after long trying.

    There where it created the value I made also a Global Variable and now I see my total usage off Electricity.

    Thanks for your support Jan as always amazing and fast!!!!

    Link to comment
    Share on other sites

    Hi. Perhaps a very trivial question, but still ..
    how to describe the rule so that it works every 6 months 3 days in a row at 09.00 ... or at least harshly say: 01.09 and then at 01.03 at 09.00 ...

     

    such a simple implementation does not work (((
    rule([[ @09:05 & /01/09/ & /02/09/ & /03/09/ =>.....bla bla bla
      

    Link to comment
    Share on other sites

    Good morning Jan,

    I calculate on Wednesday the usage of gas and electricity.

    Can I store the calculated value GV Energy_Elec_year in a automated created GV?

    is it possible to automate in creation Global Variable;

    Please login or register to see this code.

    I want to know and store every week the usage of utilities to compare and warn if its out of the deviation 

    Edited by Sjakie
    Link to comment
    Share on other sites

  • Topic Author
  • 12 hours ago, fastvd said:

    Hi. Perhaps a very trivial question, but still ..
    how to describe the rule so that it works every 6 months 3 days in a row at 09.00 ... or at least harshly say: 01.09 and then at 01.03 at 09.00 ...

     

    such a simple implementation does not work (((
    rule([[ @09:05 & /01/09/ & /02/09/ & /03/09/ =>.....bla bla bla
      

    Please login or register to see this code.

     

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Sjakie said:

    Good morning Jan,

    I calculate on Wednesday the usage of gas and electricity.

    Can I store the calculated value GV Energy_Elec_year in a automated created GV?

    is it possible to automate in creation Global Variable;

    Please login or register to see this code.

    I want to know and store every week the usage of utilities to compare and warn if its out of the deviation 

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    there is another question..
    there is a rule that tells us in the telegram about the high water level in the lake... the implant reads NO contact from the float...
    everything works well, but it happens that a strong wave and a float give the SAFE mode once and then after a few minutes BREACHED... and then the system gives us the same message several times a day...
    here is my rule:
    rule([[once(trueFor(00:30,waterUp:breached) ) => $WaterLevel='NORM';
           fibaro.call(201, 'sendMessage', fmt('Rive water in the lake is normal'), -653771009)
           ]])

    the question itself: how to make the rule work OR
    1) only once before changing the status (protection against false positives)
    2) or at least limit the draw once a day!

    Link to comment
    Share on other sites

  • Topic Author
  • 55 minutes ago, fastvd said:

    there is another question..
    there is a rule that tells us in the telegram about the high water level in the lake... the implant reads NO contact from the float...
    everything works well, but it happens that a strong wave and a float give the SAFE mode once and then after a few minutes BREACHED... and then the system gives us the same message several times a day...
    here is my rule:
    rule([[once(trueFor(00:30,waterUp:breached) ) => $WaterLevel='NORM';
           fibaro.call(201, 'sendMessage', fmt('Rive water in the lake is normal'), -653771009)
           ]])

    the question itself: how to make the rule work OR
    1) only once before changing the status (protection against false positives)
    2) or at least limit the draw once a day!

    So, the question boils down to what "a few minutes" are. If it's safe for 5 hours, do you want a new message then? or is a a whole day?

     

    What you can do is create your own trigger variable that watch the waterUp sensor.

    Please login or register to see this code.

    In this case it needs to be safe for 15min to turn the triggervar 'waterNormal' to false.

    (I think this would work - haven't tested it myself).

    ...and you don't need the once. Typically you don't need once for true/false expressions as the rule never triggers if something becomes true multiple times in a row anyway.

    The usefulness of once is if you have a value and wants to trigger once if the value pass a certain threshold.

    Ex.

    rule("once(lux:value > 200) => lamp:off")

    Here we don't want to run the rule when the lux is 200, 210, 223, 300, ... but only the first time it becomes true.

    Link to comment
    Share on other sites

    7 hours ago, jgab said:

    Итак, вопрос сводится к тому, что такое «несколько минут». Если это безопасно в течение 5 часов, вы хотите получить новое сообщение? или целый день?

     

    Что вы можете сделать, так это создать свою собственную переменную триггера, которая следит за датчиком WaterUp.

    Please login or register to see this code.

    В этом случае должно быть безопасно в течение 15 минут, чтобы триггерная переменная «waterNormal» стала ложной.

    (Я думаю, что это сработает - сам не проверял).

    ... и вам не нужно один раз. Обычно вам не нужен один раз для выражений true/false, так как правило никогда не срабатывает, если что-то становится истинным несколько раз подряд.

    Использование Once полезно, если у вас есть значение и вы хотите сработать один раз, если значение превысит определенный порог.

    Бывший.

    правило("один раз(люкс:значение > 200) => лампа:выкл")

    Здесь мы не хотим запускать правило, когда люкс 200, 210, 223, 300, ... но только в первый раз, когда оно становится верным.

    The following is meant...I am simulating the situation:
    1) the water level rose, the float closed the NO contact and our implant successfully read it, our sensor is in BREACHED mode
    2) The trueFor rule helps us perfectly, but ONLY the FIRST time... it means that if at this moment there is just a wave and the sensor is BREACHED then SAFE, then trueFor until the sensor is firmly in BREACHED for 30 minutes
    3) but it happens that, so to speak, the AVERAGE position of the float + wave....and then our sensor seems to have been BREACHED for 40 hours, and here there was a wave for 2-4 seconds and the sensor went to SAFE and then returned
     in BREACHED...30 minutes pass and the system gives us a message again that the water level has changed...
    4) how to describe so that the rule is true ONLY if 30 min BREACHED, but before that SAFE was more than 5 min... something along these lines...

     

    Please login or register to see this attachment.

    Edited by fastvd
    Link to comment
    Share on other sites

    on the screen you can see: right now the float is in a neutral position all day and fixes once SAFE and once BREACHED... and in fact from 18:36 if there is no more waves, the rule will work and say that there is no water level (SAFE mode)... but if, say, at 20.00 there will be wind/wave again, the sensor will go to BREACHED again for a few minutes ... although in fact the level has not changed ... that's what I mean)

    You need to describe the rule as follows: TRUE if it has been BREACHED for 30 minutes, but last(in fact 30 minutes ago) SAFE was more than 15 minutes...

    Edited by fastvd
    Link to comment
    Share on other sites

  • Topic Author
  • Yes, but doesn't this work?

    Please login or register to see this code.

    Our waterNormal will only be false if the sensor been safe for 15min.

    When the sensor is breached the waterNormal is immediately true

     

    Then we have another rule that looks at waterNormal and sends a message when it's been true for 30min.

    If the sensor is safe less than 15min it will not change waterNormal and thus not trigger a new message.

     

    Shouldn't you send a message if sensor been safe for >15min? Like "water high"?

    Link to comment
    Share on other sites

    22 minutes ago, jgab said:

    Yes, but doesn't this work?

    Please login or register to see this code.

    Our waterNormal will only be false if the sensor been safe for 15min.

    When the sensor is breached the waterNormal is immediately true

     

    Then we have another rule that looks at waterNormal and sends a message when it's been true for 30min.

    If the sensor is safe less than 15min it will not change waterNormal and thus not trigger a new message.

     

    Shouldn't you send a message if sensor been safe for >15min? Like "water high"?

    you didn't understand...
    I actually have your rule, just in a different version:


    rule([[once(trueFor(00:30,waterUp:breached)) => $WaterLevel='NORM';
           fibaro.call(201, 'sendMessage', fmt('The water level in the lake is normal'), -653771009)
           ]])
       
       rule([[once(trueFor(00:30,waterUp:safe)) =>$WaterLevel='DOWN';
           fibaro.call(201, 'sendMessage', fmt('The water level in the lake is BELOW normal'), -653771009)
           ]])

    AGAIN: it happens that the water level is not YET high, but STILL not low...the float is in the middle position...and then YOUR rule, MY rule will give FALSE, or rather DUPLICATE messages that level :
    1) if the water increases gradually, the message will say that the level is below the level (float in SAFE mode)
    2) if the water falls, the message will be that the float is above the level (BREACHED mode)

    And in these days we will call it NEUTRAL DAYS - it will allow us to cut off duplicate messages until the float no longer floats and changes the SAFE-BREACHED-SAFE-BREACHED mode every 5 min

    The condition I see is:
    if during 30 minutes BREACHED and the last position was SAFE for more than 5-10 minutes, then the rule is TRUE! How to use the LAST PROVISION?

    Edited by fastvd
    Link to comment
    Share on other sites

    Jan, I am lost a bit.

    Please login or register to see this code.

    show rule is true further nothing in debug and no setting value in GV

    If I use instead of @09:19 wait(5) it show the lines (not in color) but also no values in GV.

    What is wrong?

    Edited by Sjakie
    Link to comment
    Share on other sites

  • Topic Author
  • Yes, believe I understand. Maybe I switched the values.

    The important part is to have this extra trigger variable 'waterNormal' that only turns false when sensor is safe for 15 min, but turns true immediately when sensor is breached.

     

    If I run this test program (device 77 is a binary switch so I can control it myself)

    Please login or register to see this code.

    I get the output

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • 52 minutes ago, Sjakie said:

    Jan, I am lost a bit.

    Please login or register to see this code.

    show rule is true further nothing in debug and no setting value in GV

    If I use instead of @09:19 wait(5) it show the lines (not in color) but also no values in GV.

    What is wrong?

     

    I can't see any error with the code - for me it works well.

    Are you sure you defined the GVs with the right names? Are you looking at the right log tab filter in the HC3 console?

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