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
On 9/7/2022 at 8:44 AM, fastvd said:

I put this function at the top of the main tab, where all the functions are additional.. and it also gives me an error (((

 

Please login or register to see this link.

sorry for interfering, I know my coding skills are not great at all.

 

How can you have two lines, both setting the allZWaveDevice var ? 

how does this work? Are you just letting number two allZWaveDevice overwrite the first one to safe a variable ?

 

allZWaveDevice = fibaro.util.reduce(
   function(d) return (d.parentId==0 or d.parentId==nil) and d.visible and d.enabled end,
  (api.get("/devices?interface=zwave"))
)
allZWaveDevice = Util.map(function(d) return d.id end, allZWaveDevice)

 

Posted
3 minutes ago, ChristianSogaard said:

sorry for interfering, I know my coding skills are not great at all.

 

How can you have two lines, both setting the allZWaveDevice var ? 

how does this work? Are you just letting number two allZWaveDevice overwrite the first one to safe a variable ?

 

allZWaveDevice = fibaro.util.reduce(
   function(d) return (d.parentId==0 or d.parentId==nil) and d.visible and d.enabled end,
  (api.get("/devices?interface=zwave"))
)
allZWaveDevice = Util.map(function(d) return d.id end, allZWaveDevice)

 

it is not my code...its Jan's )

 

Posted

Jan, 

I was thought that this rule should execute at 08:00 hour but the rule will executed at midnight and at 08:00

How to correct it will only be executed at 08:00 every Sunday?

Thanks!

Please login or register to see this code.

 

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

     

    Please login or register to see this code.

     

     

    You don't use 01/05..28/9 to limit dates. 01/05 looks like a division for ER so the expression becomes 00..00 which triggers at ~midnight.

    The correct format is /month/day/hour:min

    Please login or register to see this code.

     

    Posted
    21 hours ago, fastvd said:

    1090

    ?

    Posted

    well... I asked a question about dead devices))) how to filter so that there are only parental devices?

    Posted

    Jan, thanks for answering and time spent and not to forget your service excellence!

    Posted (edited)

    Jan, I can't find the right way to let it work

    Or must I use a Global Variable as way around to do the trick

    Please login or register to see this code.

    Is there a possibility to show in ER debug if someone arm or disarm alarm with thew Yubii app?

    Please advice

    Edited by Sjakie
    yubii
    Posted

    came another idea that can be added to either the online monitoring or the morning report.
    if there is an opportunity with HC3 to check the availability of the IP device through icmp requests, then it would be possible to add to the morning or online report whether our: IP cameras, access points and any other IP devices are available...
    is this possible in HC3 + ER4?

    Posted

    How to describe the rule so that it works no more than 3 times a day.
    To understand: there is a rule that tells us about dead devices, and such a situation arose that one of the devices is connected, then not...and at this moment there is no technical possibility to look at this reason...that's it and the whole sends 100-200 messages a day...how to limit the rule to, say, 3 pieces?
    rule("tempTC_Zal:isDead & REM_220v:safe=> fibaro.call(teleg_group, 'sendMessage', fmt('CONTROL: there is no communication with TC in the kitchen-studio in O.E.'s house'), -653771009)")

    Posted

    Rule.eval([[@00:00 | @ 08:00 | 16:00   execute your rule and you get 3 times a day a check on dead devices and a message

    Posted
    6 хвилин тому Sjakie сказав:

    Rule.eval([[@00:00 | @ 08:00 | 16:00 виконайте своє правило, і ви отримаєте 3 рази на день перевірку несправних пристроїв і повідомлення

    no, it's not that...
    so you will check specifically at these hours, and the device may disappear at other time intervals! we just wanted the rule to be fulfilled no more than 3 times a day, without being bound by time!

    Posted

    Max 3 times a day so it's possible it will execute 3 times within 1 minute if you don't use @.

     

    Posted
    16 minutes ago, Sjakie said:

    Max 3 times a day so it's possible it will execute 3 times within 1 minute if you don't use @.

     

    no, you are looking in the wrong direction...
    let's modulate the situation:
    1) the connection was lost at 01.00 at night, at 01.30 at night and at 02.30 at night..
    2) and your rule will be checked at 00:00, 08:00, 16:00
    3) accordingly, it will not show us anything
    3) provide a simple logic: let my rule inform us, but no more than 3 times a day!

    Posted
    22 hours ago, fastvd said:

    no, you are looking in the wrong direction...
    let's modulate the situation:
    1) the connection was lost at 01.00 at night, at 01.30 at night and at 02.30 at night..
    2) and your rule will be checked at 00:00, 08:00, 16:00
    3) accordingly, it will not show us anything
    3) provide a simple logic: let my rule inform us, but no more than 3 times a day!

    I answer myself...
    came up with something like this... it's very unprofessional, because I'm not a programmer ((( but it should work
    Util.defTriggerVar('Null_time=false')
    rule([[@ {catch, 00:01} => Null_time=false;
            log('Resetting the variable Null_time')
            ]])

    rule("tempOzero:isDead & REM_220v:safe & Null_time==false => post(#try2_ozero); fibaro.call(teleg_fastvd, 'sendMessage', fmt('CONTROL: no communication with lake water level'), -700919895 )")
    rule("tempOzero:isDead & REM_220v:safe & #try2_ozero=> post(#try3_ozero); fibaro.call(teleg_fastvd, 'sendMessage', fmt('CONTROL: no communication with lake water level'), -700919895)" )
    rule("tempOzero:isDead & REM_220v:safe & #try3_ozero=> Null_time=true; fibaro.call(teleg_fastvd, 'sendMessage', fmt('CONTROL: no communication with lake water level'), -700919895)")

    the big minus of this is bulkiness

    Posted

    and then I play with the number of activations of the rules...
    And I can't understand why ER4 doesn't work correctly?
    Here are the rules:

    rule("spotKab:isOn  =>  post(#try1) ;log('Spot lighting in the office is turned on for the 1st time ')")
    rule("spotKab:isOn & #try1 => post(#try2); log('Spot lighting is included in office 2 again')")
    rule("spotKab:isOn & #try2 => log('Spot lighting is included in office 3 again')")
    I just turn on the lamp 1 time
    as we can see - all posts are not taken into account and the rule is to post all 3 times!
    Jan, what am I doing wrong?

     

     

    Please login or register to see this attachment.

    Posted

    try to reverse the spotKab:isOn & #try2  

    to #try2 & spotKab:isOn   

     

    i think it is because the # is a post and disappears.

    and therefor you can't use it as condition

     

    Posted
    1 hour ago, ChristianSogaard said:

    try to reverse the spotKab:isOn & #try2  

    to #try2 & spotKab:isOn   

     

    i think it is because the # is a post and disappears.

    and therefor you can't use it as condition

     

    rule("spotKab:isOn  =>  post(#try1) ;log('Spot lighting in the office is turned on for the 1st time ')")
    rule("#try1 & spotKab:isOn  => post(#try2); log('Spot lighting is included in office 2 again')")
    rule("#try2 & spotKab:isOn  => log('Spot lighting is included in office 3 again')")

    no (((

    Please login or register to see this attachment.

    Posted

    He should do something else.

    ER is doing what it suposed to do

    its posting all 3 rules because they are true>> see log

     

    If I proper understand 

    switch on>> try1

    switch on second time >>try2

    switch on third time >>try3

    I don't know if HC3 knows if switch on for second/third time because it's already on.

    should do something with  our masters solution

     

    Posted
    1 hour ago, Sjakie said:

    He should do something else.

    ER is doing what it suposed to do

    its posting all 3 rules because they are true>> see log

     

    If I proper understand 

    switch on>> try1

    switch on second time >>try2

    switch on third time >>try3

    I don't know if HC3 knows if switch on for second/third time because it's already on.

    should do something with  our masters solution

     

    everything is correct...that's why I use the post command, in the role of a marker\tag, so to speak...
    and I don't understand why the 2nd rule works in parallel, if there is no marker yet!

    but here it's not about the marker via POST... I already created a global variable... and similarly tried to switch it and make the rule work ONLY with a specific global variable! I've tried everything and can't figure out why!

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