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
    28 minutes ago, ChristianSogaard said:

     

    Jan, you helped create this rule

    Please login or register to see this code.

     

    I tried copy the name/roomname part to this rule 

    Please login or register to see this code.

    Im getting - bad argument #1 to 'f' (table expected, got boolean)

    Please login or register to see this code.

    would you help again ?

    When you get an

    Please login or register to see this code.

    the id is the partition id and you don't get any list of breached devices.

    To do that we have to use another function to get the breached devices in that partition,

    So, something like

    Please login or register to see this code.

     

     

    • Thanks 1
    Posted (edited)

    Jan, i am trying to use the new operators for my customer's house, like isAnyOff etc

    Unfortunatelly i cant test it at my home with blinds

     

    Would this work? LED1 should be turned ON when all shutters are opened, and LED2 if at least 1 has less value than 100

    Please login or register to see this code.

     

    Edited by Neo Andersson
    Posted (edited)

    Jan i am getting error after upgrade

     

    Please login or register to see this code.

     

     

    Please login or register to see this attachment.

    Edited by Neo Andersson
    Posted
    2 hours ago, jgab said:

    When you get an

    Please login or register to see this code.

    the id is the partition id and you don't get any list of breached devices.

    To do that we have to use another function to get the breached devices in that partition,

    So, something like

    Please login or register to see this code.

     

     

    Hi Jan

     

    Something broke from updating 0.56>0.58

    Worked in 0.56

    Please login or register to see this code.

    after 0.58 upgrade

    Rule: No triggers in rule
    #Key951_2_Pressed2_4_Pressed3 => 

     

     

    EventRunner5, deviceId:2059, version:0.56
    [03.12.2023] [19:33:27] [TRACE] [QUICKAPP2059]: Setting up rules...
    [03.12.2023] [19:33:27] [TRACE] [ER2059]: Defined [Rule:1] matrix4Alarm:central & keyPrim =>post({type=fmt('%s_%s_%s',keyPrim, matrix4Alarm:central.keyId,matrix4Alarm:central.keyAttribute)}); keyPrim = nil
    [03.12.2023] [19:33:27] [TRACE] [ER2059]: Defined [Rule:2] matrix4Alarm:central & keyPrim==nil =>keyPrim=fmt('Key%s_%s_%s',matrix4Alarm,matrix4Alarm:central.keyId,matrix4Alarm:central.keyAttribute); wait(3); keyPrim=nil
    [03.12.2023] [19:33:27] [TRACE] [ER2059]: Defined [Rule:3] #Key951_2_Pressed2_4_Pressed3 => || 1:armed >> 1:armed=false; log('#Disarmed from Matrix as Keypad')|| !1:armed >> 1:tryArm ; log('#Try to Arm the house from Matrix as Keypad')
    [03.12.2023] [19:33:27] [TRACE] [ER2059]: Defined [Rule:4] #alarm{property='delayed'} =>local devs = {};-- for p,d in pairs(env.event.value) do devs = table.append(devs,d) end;for p,d in pairs(env.event.value) do devs = table.union(devs,d) end; -- union a..
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Defined [Rule:5] #alarm{id='$id', property='armed', value=true} =>-- fibaro.warning(__TAG,efmt('Armed partition:%s',id:alarm.name))fibaro.warning(__TAG,efmt('Da House is Armed'));-- 353:msg = log("Alarm parti..
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Defined [Rule:6] #alarm{property='homeBreached'} => -- Log when home is breachedfibaro.warning(__TAG,efmt('BREACHED home'))
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Defined [Rule:7] #alarm{id='$id', property='breached'} => local bdevs = fibaro.getBreachedDevicesInPartition(id);local msg = table.concat([true,fmt('%s:%s in room %s',_,_:name,_:roomName) in bdevs],'
    ');msg = f..
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Defined [Rule:8] #alarm{id='$id', property='armed', value=false} =>-- fibaro.warning(__TAG,efmt('Armed partition:%s',env.event.id))fibaro.warning(__TAG,efmt('Da House is DIS Armed'));-- 353:msg = log("Alarm p..
    [03.12.2023] [19:33:28] [DEBUG] [QUICKAPP2059]: HC3 uptime 0 days, 5 hours, 26 minutes
    [03.12.2023] [19:33:28] [DEBUG] [QUICKAPP2059]: Sunrise at 8:17, Sunset at 15:41
    [03.12.2023] [19:33:28] [DEBUG] [QUICKAPP2059]: Weather condition is cloudy
    [03.12.2023] [19:33:28] [DEBUG] [QUICKAPP2059]: Temperature is -0.4°
    [03.12.2023] [19:33:28] [DEBUG] [QUICKAPP2059]: Wind is 3.6ms
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Defined [Rule:9] @sunset+00:10 => log('Ok, sunset+00:10')
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Defined [Rule:10] @sunrise-00:10 => log('Ok, sunrise-00:10')
    [03.12.2023] [19:33:28] [TRACE] [ER2059]: Disabled [Rule:9]
    [03.12.2023] [19:33:29] [TRACE] [ER2059]: Disabled [Rule:10]
    [03.12.2023] [19:33:29] [DEBUG] [QUICKAPP2059]:
    Rules setup time: 0.232 seconds (15 rules)
    [03.12.2023] [19:36:25] [DEBUG] [QUICKAPP2059]:
    EventRunner5, deviceId:2059, version:0.58
    [03.12.2023] [19:36:25] [TRACE] [QUICKAPP2059]: Setting up rules...
    [03.12.2023] [19:36:25] [TRACE] [ER2059]: Defined [Rule:1] matrix4Alarm:central & keyPrim =>post({type=fmt('%s_%s_%s',keyPrim, matrix4Alarm:central.keyId,matrix4Alarm:central.keyAttribute)}); keyPrim = nil
    [03.12.2023] [19:36:25] [TRACE] [ER2059]: Defined [Rule:2] matrix4Alarm:central & keyPrim==nil =>keyPrim=fmt('Key%s_%s_%s',matrix4Alarm,matrix4Alarm:central.keyId,matrix4Alarm:central.keyAttribute); wait(3); keyPrim=nil
    [03.12.2023] [19:36:25] [ERROR] [ER2059]: [Rule:3:#Key951_2_Pressed2_4_Pressed3 => || 1:armed >> 1:armed=false; log('#Disarmed from Matrix as Keypad') || !1:armed >> 1:tryArm ; log('#Try to Arm the house from Matrix as Keypad')] Rule: No triggers in rule
    #Key951_2_Pressed2_4_Pressed3 => 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [03.12.2023] [19:36:25] [ERROR] [QUICKAPP2059]: Rule setup error(s) - fix & restart...
    [03.12.2023] [19:36:26] [ERROR] [QUICKAPP2059]: Last err: [Rule:3:#Key951_2_Pressed2_4_Pressed3 => || 1:armed >> 1:armed=false; log('#Disarmed from Matrix as Keypad') || !1:armed >> 1:tryArm ; log('#Try to Arm the house from Matrix as Keypad')] Rule: No triggers in rule #Key951_2_Pressed2_4_Pressed3 => ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [03.12.2023] [19:36:26] [TRACE] [ER2059]: Disabled [Rule:1]
    [03.12.2023] [19:36:26] [TRACE] [ER2059]: Disabled [Rule:2]

    Posted

    Jan a lot of rules doesnt work. There is something broken i think

    Posted
    5 minutes ago, Neo Andersson said:

    Jan a lot of rules doesnt work. There is something broken i think

    same for me 
    I downgraded to 0.56 and are back up running

  • Topic Author
  • Posted

    Yep, the table constructor fix for v0.58 broke the #event constructor.

    I've fixed it in v0.61 and pushed it.

     

    • Thanks 1
    Posted
    3 hours ago, jgab said:

    When you get an

    Please login or register to see this code.

    the id is the partition id and you don't get any list of breached devices.

    To do that we have to use another function to get the breached devices in that partition,

    So, something like

    Please login or register to see this code.

     

     

     

    Hi Jan

     

    Im trying to get the Partition name listed as well, using the new :partition.name .- i have it to work in my breached rule... but not is this one...

     

    Please login or register to see this code.

     

     

     

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

     

    Hi Jan

     

    Im trying to get the Partition name listed as well, using the new :partition.name .- i have it to work in my breached rule... but not is this one...

     

    Please login or register to see this code.

     

     

     

     

    This works for me

    Please login or register to see this code.

     

    Posted (edited)

    Jan, please, why is this error?

     

    Please login or register to see this code.

     

     

    Last err: [Rule:35:Wardrobe_left_motion:breached & 19:01..06:59 => shs.turnOn(Wardrobe_Eva_LED) &..] Parser: left hand side of assignment unsupported Wardrobe_left_motion:breached & 19:01..06:59 => shs.turnOn(Wardrobe_Eva_LED) & Wardrobe_Eva_LED:color = red & Wardrobe_Eva_LED:value = 30 ^

    Edited by Neo Andersson
    Posted

    Jan please, what is happening...In customers house i cant see a single line of events

     

    Please login or register to see this image.

    /monthly_2023_12/image.png.e78facd32540c722fa9c604de68bed7e.png" />

     

    rules defined, but no events showed

     

    image.png.a53cf8c88f6a280c78d17e7315fad7fd.png

    Posted
    23 hours ago, Neo Andersson said:

    Jan, i am trying to use the new operators for my customer's house, like isAnyOff etc

    Unfortunatelly i cant test it at my home with blinds

     

    Would this work? LED1 should be turned ON when all shutters are opened, and LED2 if at least 1 has less value than 100

    Please login or register to see this code.

     

    @jgab Jan this doesnt work for blinds or shutters

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

    Jan, please, why is this error?

     

    Please login or register to see this code.

     

     

    Last err: [Rule:35:Wardrobe_left_motion:breached & 19:01..06:59 => shs.turnOn(Wardrobe_Eva_LED) &..] Parser: left hand side of assignment unsupported Wardrobe_left_motion:breached & 19:01..06:59 => shs.turnOn(Wardrobe_Eva_LED) & Wardrobe_Eva_LED:color = red & Wardrobe_Eva_LED:value = 30 ^

    '&' has higher priority than '=', so you need to wrap the assignment in parentheses 

    Please login or register to see this code.

     

    1 hour ago, Neo Andersson said:

    @jgab Jan this doesnt work for blinds or shutters

    It's lowercase :on, and:off

     

    On is true if value property > 0 and off if value property == 0.

    Posted
    50 minutes ago, jgab said:

    '&' has higher priority than '=', so you need to wrap the assignment in parentheses 

    Please login or register to see this code.

     

    It's lowercase :on, and:off

     

    On is true if value property > 0 and off if value property == 0.

    Thank you Jan

    Posted (edited)

    Jan, what is the syntax for table lenght aka #myTable inside a rule?

    UPDATE: Okay i have found it. Its size(table) if someone else was looking for it.

    Edited by Neo Andersson
    Posted (edited)

    Ehh i am giving up...:-)

    I cant find anywhere in topics answer

    If i have a table of devices, defined as

    Please login or register to see this code.

     

    how to convert the table to a string format, that i can send it in my simplePush message function?

     

    using json gives me some uncomprehensible numbers

     

    Please login or register to see this code.

     

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

    Ehh i am giving up...:-)

    I cant find anywhere in topics answer

    If i have a table of devices, defined as

    Please login or register to see this code.

     

    how to convert the table to a string format, that i can send it in my simplePush message function?

     

    using json gives me some uncomprehensible numbers

     

    Please login or register to see this code.

     

    The problems is that 'devices' are a reserved word that always returns all device IDs in the system.

    Use 'devs' instead.

    Btw, there is a new string.format function 

    string.eformat

    and corresponding efmr and log functions that use that formatter. It has a few additional formatting directives. One is '%l' that inserts a list of objects.

    Please login or register to see this code.

    gives you the string

    Please login or register to see this code.

     

    The

    Please login or register to see this code.

    is a powerful construct. In your example you only use the <filterExpr> part which is an expression that if true will add the element to the resulting list (_:last > 24:00)

    We can also use the <transformExpr> to transform the element before adding it to the resulting list.

    Please login or register to see this code.

    to make a list like

    Please login or register to see this code.

     

    Posted (edited)
    2 hours ago, jgab said:

    Please login or register to see this code.

    this doesn't work for me, i tried without " quotes but still. It says missing first argument

    Edited by Neo Andersson
  • Topic Author
  • Posted
    16 minutes ago, Neo Andersson said:

    this doesn't work for me, i tried without " quotes but still. It says missing first argument

    It used both single and double quotes so the whole rule string would need [[]]

    This works for me

    Please login or register to see this code.

     

    Please login or register to see this code.

     
    Posted
    5 minutes ago, jgab said:

    It used both single and double quotes so the whole rule string would need [[]]

    This works for me

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    Ahhhh, the two type of quotes,,,okay i got it now, you just quoted the name of the device in printed output too...okay thanks

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