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

  • Topic Author
  • Posted
    15 minutes ago, jgab said:

     

    pushed v0.36

     

    Ok, the ';;' was a bug - I thought I fixed that weeks ago but somehow it was reverted to the old code... Now it should work.

     

    The newline I can't see whats' wrong. Strange that it works in rule("....=> text1 ++ '\n' ++ text2") but not the with the simplePush...

    I will try to look into it...

     

    Ahh, I know what it is. The first example is a multiline rule with [[]] isn't it? The problem is that Lua don't translate \n to newline in those strings. You get the string "\n".

    I could probably get around that by doing the translation in the parser - let me come back on that...

    Posted
    1 minute ago, jgab said:

    Ahh, I know what it is. The first example is a multiline rule with [[]] isn't it? The problem is that Lua don't translate \n to newline in those strings. You get the string "\n".

    I could probably get around that by doing the translation in the parser - let me come back on that...

    Yeah, thats a mutliline, It would be nice if you could fix this, becuase i am sending PUSH messages to cusomters every evening about device statuses, and it looks really awfully without linebreaks. Its almost unreadable.

    THanks

    Posted
    18 minutes ago, jgab said:

    pushed v0.36

    Jan what is this?

    Please login or register to see this attachment.

    Posted (edited)

    Any1 got a suggestion on how to trigger on profile change?

     

    Found out this on is on the globals , but cant find any on profiles 😅

    rule("$Home == 'HOME' => AutoPirSov1:on")
    Edited by Brors94
    Posted (edited)
    28 minutes ago, Brors94 said:

    Any1 got a suggestion on how to trigger on profile change?

     

    Found out this on is on the globals , but cant find any on profiles 😅

    rule("$Home == 'HOME' => AutoPirSov1:on")

    I haven't tried it in ER5, but in ER4 this should work according to @jgab

    Please login or register to see this code.

     

    Edited by Neo Andersson
  • Topic Author
  • Posted
    2 hours ago, Neo Andersson said:

    Jan what is this?

    Please login or register to see this attachment.

    Sorry, test variables that followed my release - will remove in next version.

  • Topic Author
  • Posted
    32 minutes ago, Neo Andersson said:

    I haven't tried it in ER5, but in ER4 this should work according to @jgab

    Please login or register to see this code.

     

    Yes, it works in ER5 too - I will try to come up with some short form....

    • Thanks 1
    Posted

    @jgabJan i just can get http calls working with rules. 

     

    Any assist please would be appreciated.

     

    1. How to form a POST using rules. Please proved some example. Where to put data forexample when calling my raspberry? How to wrap this example below into a rule?

      

    Please login or register to see this code.

     
     

     

    2. I could run some GET call in rules but i cant get it working when returned data is a table

     

    Please login or register to see this code.

     

     

     

     

    3. If i need to process my returned data coming from my GET call in a custom function (callback), how to use it in a rule? 
     
     
     
    Thanks so much
  • Topic Author
  • Posted
    8 hours ago, Neo Andersson said:

    @jgabJan i just can get http calls working with rules. 

    2. I could run some GET call in rules but i cant get it working when returned data is a table

     

    Please login or register to see this code.

     

     

    3. If i need to process my returned data coming from my GET call in a custom function (callback), how to use it in a rule? 
     
     
     
    Thanks so much

     

    2. This was a bug using key.key[index].key expressions. I missed that. Fixed in v0.5

     

    3. 

    Please login or register to see this code.

     

    v 0.5 pushed.

    - fixed cosmetics...

    - \n\r\t are now translated in multiline strings

    - fixed bug in table indexing

    - fixed dangling ';;' bug.

  • Topic Author
  • Posted
    On 11/27/2023 at 1:14 PM, ChristianSogaard said:

    Thank you Jan 

    Almost there :-)

    I need to filter out doublets - in below case there is 3 alarm zones -  and i get messages from both Partition 1+2  because they have overlapping sensors.

     

      

    Please login or register to see this code.

     In v0.5 there is a table.union that merges two lists removing duplicated. Change table.append to table.union in the example and it should work.

    • Thanks 1
    Posted (edited)
    On 11/14/2023 at 7:17 PM, jgab said:

    Alarm rules

     

    Alarm in the HC3 is implemented by Fibaro using the concept of partitions.

    Partitions are armed and disarmed. Individual devices (typically sensors) belongs to partitions

    and if a devices is breached that belongs to a partition, the partition is breached and we have an alarm.

     

    In ER5 we have properties to query partitions for their state

    <partition>:armed - returns true if the partition is armed - 0 means the house

    <partition>:tryArm - will try to arm the partitions - 0 means the house

    <partition>:isArmed - returns true if the partition is armed - 0 means the house

    <partition list>:isAllArmed - returns true if all partitions are armed

    <partition>:isDisarmed

    <partition list>:isAnyDisarmed - returns true if all partitions is disarmed

    <partition>:isAlarmBreached

    <partition>:isAlarmSafe

    <partition list>:isAllAlarmBreached - returns true if all partitions are breached

    <partition list>:isAnyAlarmSafe - returns true if any partitions is safe

     

    and properties to change the alarm states

    <partition>:armed=true - arms the partition - 0 means the house

    <partition>:armed=false - disarms the partition - 0 means the house

     

    <partition>:tryArm is special as it will try to arm the partition/partitions and if it doesn't succeed because their

    is a breached device in any of the partitions it will post an event that list the partitions and devices that are breached.

    Note that the arming will continue and if not cancelled, the partition will be armed and at the same time breached because of

    the breached devices.

     

    To handle that, one can make a rule that trigger on the posted event,

    Ex:

    Please login or register to see this code.

     

    To trigger a rule if there is a breached partition/home, it's easiest to trigger on the events generated (in the future there may be properties)

    Please login or register to see this code.

     

    Unfortunately, if a partition is armed using the web UI/Yubii app, we don't get any warning from the fibaro api before the partition is armed - maybe in the future...

     

    Hi Jan

     

    it looks like that tryArm always takes partition 0 (all zones) no matter what partition i type - example here is 2, but it arms alle partitions

     

    Please login or register to see this code.

     

     

    And how would a correct log syntax looks like - if i dynamic want to add the partition name in the log?
     || !0:armed >> 0:tryArm;    log(__TAG,efmt('Armed partition:%s',env.event.id))
     

    Edited by ChristianSogaard
    Typo
  • Topic Author
  • Posted
    11 hours ago, Neo Andersson said:

    @jgabJan i just can get http calls working with rules. 

     

    Any assist please would be appreciated.

     

    1. How to form a POST using rules. Please proved some example. Where to put data forexample when calling my raspberry? How to wrap this example below into a rule?

      

    Please login or register to see this code.

     
    Thanks so much

    Please login or register to see this code.

     

    http.post(url,options,data)

  • Topic Author
  • Posted
    2 hours ago, ChristianSogaard said:

     

    Hi Jan

     

    it looks like that tryArm always takes partition 0 (all zones) no matter what partition i type - example here is 2, but it arms alle partitions

     

    Please login or register to see this code.

     

     

    And how would a correct log syntax looks like - if i dynamic want to add the partition name in the log?
     || !0:armed >> 0:tryArm;    log(__TAG,efmt('Armed partition:%s',env.event.id))
     

    I don't see that problem when arming partitions..., some more details?

     

    Well, partition 0 is the house/home so that name is given. To get the name from a partition id you need an helper function

    (I may build something like it into ER5 in the next version...)


     

    Please login or register to see this code.

     

    Posted
    5 hours ago, jgab said:

    This was a bug using key.key[index].key expressions. I missed that. Fixed in v0.5

    Jan, this is strange. I am running at home on 0.36 and there is no newer version in updater, on the other hand I am running on 0.35 at customers project but there is not even 0.36 version in QAupdater? QA updater is on 0.67 on both systems.

     

    Please login or register to see this image.

    /monthly_2023_11/image.png.5851fd1aff3806c9a4922557d5631606.png" />

    Posted
    14 minutes ago, jgab said:

    I don't see that problem when arming partitions..., some more details?

     

    Well, partition 0 is the house/home so that name is given. To get the name from a partition id you need an helper function

    (I may build something like it into ER5 in the next version...)


     

    Please login or register to see this code.

     

     

    Sure :-)

     

    This rule triggers and do 2.tryArm

     

    Please login or register to see this code.

     

    Should just arm 2 - right

    image.png.769ee66832379aa163e952c0bbe173bc.png

     

    Please login or register to see this code.

     

    end up ARMing everything

    image.png.2525471fac9cc3fe9d42d9b7a50999b1.png

     

  • Topic Author
  • Posted
    1 hour ago, Neo Andersson said:

    Jan, this is strange. I am running at home on 0.36 and there is no newer version in updater, on the other hand I am running on 0.35 at customers project but there is not even 0.36 version in QAupdater? QA updater is on 0.67 on both systems.

     

    Please login or register to see this link.

     

    I updated this morning which means that QAUpdater got the new database that is stored on github - so it should work for you too.

    Note that the Web UI for QAs not always updates  correctly so you need to flip between tabs to get the labels to update...

     

    QAUpdate has it's own version number - it's been 0.67 since July 14, 2022.. ;-)  (I'm still running .66)

    QAUpdater can update and install different types of QAs, EventRunner5 being one of them

    You have to Refresh to get the new database of updates.

    Then select the QA update

    Then select the version of that QA update (usually 3 versions available so people can revert if something is wrong with the new update)

    Then selected the installed QA to update (if you have many ER5 QAs installed

     

    Please login or register to see this attachment.

     

    In a future version of ER5, ER5 will talk to QAUpdater and ask if there are any ER5 updates and then notify the user....

    • Like 3
  • Topic Author
  • Posted
    2 hours ago, ChristianSogaard said:

     

    Sure :-)

     

    This rule triggers and do 2.tryArm

     

    Please login or register to see this code.

     

    Should just arm 2 - right

    Please login or register to see this link.

     

    Please login or register to see this code.

     

    end up ARMing everything

    Please login or register to see this link.

     

     

    Can you post rule 5,6,7 too? 
    The rule you posted was number 3 (with the keypress)

    Posted (edited)
    4 minutes ago, jgab said:

     

    Can you post rule 5,6,7 too? 
    The rule you posted was number 3 (with the keypress)


    Rules:

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    Edited by ChristianSogaard
    Typo
    Posted
    5 hours ago, jgab said:

    Please login or register to see this code.

    @jgab Jan it is probably my diasbility, but this doesn't worj for me.

     

    I am getting this debug in nodered when i try to use it with rules and when sending regularly.

     

    Please login or register to see this image.

    /monthly_2023_11/image.png.a181af43c5bcf96c76fc918085bd82d5.png" />

     

     

    1. It seems that i should have my data in  format like when sending with regular function. I dont know how to convert it in a rule.

    2. Also i noticed that using global variable ex $somevariable == 'en-En'  inside a rule post data, then it complains that it should be a string. Probably ERmechanism converts is somehow. How to not convert 'en-En'  and keep it as string?

    Posted

    @jgabJan how can i access a nested table value in a rule?

     

     

    1.

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

     

    2.

     

    I cant wrap into one line nested II >> calls

     

    Please login or register to see this code.

    I have tried several ways..using {} for nested ||>, using ;;...ehhhh

     

     

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