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 (edited)
8 minutes ago, jgab said:

 

 

Yes, but I was expecting the log when the allZWaveDevice variable was created.

The line that prints the info for each device

Please login or register to see this code.

I do not understand where I should see such a log! that's all that was in the console before the rule worked! maybe you still need to enable additional logging somewhere?

 

Please login or register to see this attachment.

this?

Please login or register to see this attachment.

Edited by fastvd
Posted
maybe it's easier to manually create a list of the necessary devices with names you understand and break a simple rule?
 
  rule("deads_dev={lampAbab1,lampBedr1,lampKab1,lampChild1}")
   --------------
   rule([[deads_dev:isDead => 
   for _,id in ipairs(deads_dev) do id:isDead & log('Device %s is dead ',id:name) end  
   ]])  
Posted
On 10/10/2022 at 4:25 PM, fastvd said:
maybe it's easier to manually create a list of the necessary devices with names you understand and break a simple rule?
 
  rule("deads_dev={lampAbab1,lampBedr1,lampKab1,lampChild1}")
   --------------
   rule([[deads_dev:isDead => 
   for _,id in ipairs(deads_dev) do id:isDead & log('Device %s is dead ',id:name) end  
   ]])  

Jan, how can this rule be edited so that we receive a report when the connection is restored? ...can't figure out the syntax(((

 

In fact, this rule worked for me, but I have to write them for each device... which is not very convenient...
rule("once(tempOzero:isDead & power_220v )=> fibaro.call(teleg_fastvd, 'sendMessage', fmt('CONTROL: no communication with the water level in the lake'), -700919895)")
rule("once(!tempOzero:isDead & power_220v)=> fibaro.call(teleg_fastvd, 'sendMessage', fmt('CONTROL: COMMUNICATION WITH LAKE WATER LEVEL RESTORED'), -700919895)")

 

Posted

any idea?

  • Topic Author
  • Posted
    On 10/10/2022 at 2:55 PM, fastvd said:

    I do not understand where I should see such a log! that's all that was in the console before the rule worked! maybe you still need to enable additional logging somewhere?

    this?

     

    No, it's printed when the QA starts up.

    The reason that I asked is that we could see if you had wave devices that were children but still had .parentId set to nil - which would be a bug.

     

    Could it be that it is so that you never run the code that creates the allZwaveDevice variable?

     

    Can you post here or PM me yor 'main' file so we can see how you start things pop and define the rules?

  • Topic Author
  • Posted

    Please login or register to see this code.

     

    In this case the power_220v variable should not be a trigger variable - just a ordinary variable.

     

    • Like 1
    Posted

    Jan, how do we calculate, for example, the average daily temperature? Let's say to collect data at 6 in the morning, at 12 noon, at 6 in the evening and at 12 at night?

  • Topic Author
  • Posted
    On 10/20/2022 at 9:13 PM, fastvd said:

    Jan, how do we calculate, for example, the average daily temperature? Let's say to collect data at 6 in the morning, at 12 noon, at 6 in the evening and at 12 at night?


     

    Please login or register to see this code.

    Gives you average temp in the variable 'averageTemp, and it resets every morning.

    Please login or register to see this code.

    Gives you a rolling average of the last 4 measurements 

     

    • Thanks 1
    Posted

    Can I use EventRunner4.fqa in each room? Is there any problem

    Posted

    You can but it's not handy to do.

    Split your house in floors or Light, security, Geofence/ occupation, General or devices

    In this way you have for a large house only a few QA's

    Posted

    Jan, tell me how to round a number to tenths?
    and then I have a report on the average temperature on the floor with 6 decimal places)
    here is my rule:
      --5.2) Air bath+TP
    Util.defTriggerVar("temp_midle_banya1",0)
    Util.defTriggerVar("temp_midle_banya2",0)
    ---
    rule("tempsensors_banya1={255,246}") --air
    rule("tempsensors_banya2={230,231,233}") -- TP
      rule([[#notify_tempBanya =>
       temp_middle_banya1 = sum(tempsensors_banya1:value)/size(tempsensors_banya1);
       temp_middle_banya2 = sum(tempsensors_banya2:value)/size(tempsensors_banya2);
       log('Average air temperature in the bathhouse = %s°C, TP= %s°C,',temp_midle_banya1,temp_midle_banya2);
       fibaro.call(teleg_group, 'sendMessage', fmt('Morning report: average temperatures in BANA: air = %s°C, TP = %s°C,',temp_midle_banya1,temp_midle_banya2), -653771009)
      ]]).start()

    Posted
     %s°C,  change in
    0 dec>> %.f °C',
    1 dec>> %.1f °C',
    Posted
    1 hour ago, Sjakie said:

    You can but it's not handy to do.

    Split your house in floors or Light, security, Geofence/ occupation, General or devices

    In this way you have for a large house only a few QA's

    But is there a way to kill or stop the running rule?

    Posted

    Yep there is search here in this topic timer or cancel timer

    • Like 1
    Posted
    10 minutes ago, Sjakie said:

    Yep there is search here in this topic timer or cancel timer


    Thank you !

    Posted
    7 hours ago, fastvd said:

    Jan, tell me how to round a number to tenths?
    and then I have a report on the average temperature on the floor with 6 decimal places)
    here is my rule:
      --5.2) Air bath+TP
    Util.defTriggerVar("temp_midle_banya1",0)
    Util.defTriggerVar("temp_midle_banya2",0)
    ---
    rule("tempsensors_banya1={255,246}") --air
    rule("tempsensors_banya2={230,231,233}") -- TP
      rule([[#notify_tempBanya =>
       temp_middle_banya1 = sum(tempsensors_banya1:value)/size(tempsensors_banya1);
       temp_middle_banya2 = sum(tempsensors_banya2:value)/size(tempsensors_banya2);
       log('Average air temperature in the bathhouse = %s°C, TP= %s°C,',temp_midle_banya1,temp_midle_banya2);
       fibaro.call(teleg_group, 'sendMessage', fmt('Morning report: average temperatures in BANA: air = %s°C, TP = %s°C,',temp_midle_banya1,temp_midle_banya2), -653771009)
      ]]).start()

    ???

    Posted

    If I want to run the rule 1 minute after every full hour, what could it look like?
    It seems the rule runs every hour from when the scene started?

     

     rule("@@01:00:00 => check()")

    Posted
    rule([[wait(60 - now % 60); eval("@@00:01 => post(#MINUTE)")]])
        rule([[wait(3600 - now % 3600); eval("@@01:00 => post(#HOUR)")]])   
    combined:
     rule([[wait(3600 - now % 3660); eval("@@01:00 => post(#HOUR)_plus")]])   
     
        rule("#MINUTE => log('At the minute!')")
        rule("#HOUR => log('At the hour!')")
    combined:
    rule("#HOURplus => log('At the hour plus one minute!')")
     
  • Topic Author
  • Posted (edited)

    The simplest is probably (1 minute after every full area)

    Please login or register to see this code.

     

    Edited by jgab
  • Topic Author
  • Posted
    On 10/25/2022 at 7:13 PM, fastvd said:

    ???

    Yes, it's like @Sjakie posted.

    Please login or register to see this code.

     

    • Like 1

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