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


Generic Fibaro HC3 Alarm system


ChristianSogaard

Recommended Posts

2 hours ago, ChristianSogaard said:

I'm getting an error on RULE 10 - the user is missing , I tried adding a User into the HT - but I missed the syntax.

I did try to fin a description in the 

Please login or register to see this code.

There was a semicolon missing after the for-loop. No one seems to have tried it before... Fixed in original post too /thanks

  • Like 1
Link to comment
Share on other sites

  • Topic Author
  • 14 minutes ago, jgab said:

    Please login or register to see this code.

    There was a semicolon missing after the for-loop. No one seems to have tried it before... Fixed in original post too /thanks

    You are so fast. .Thank you ? 

     

     
    2 minutes ago, ChristianSogaard said:

    You are so fast. .Thank you ? 

     

     

    Gettig some more ERRORS - when triggering the ARM Alarm

     

    [15.11.2020] [20:20:45] [ERROR] [QUICKAPP928]: in Rule:5[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:5[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}
     

     

    [15.11.2020] [20:20:45] [ERROR] [QUICKAPP928]: in Rule:10[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:10[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}

     

    [15.11.2020] [20:20:50] [ERROR] [QUICKAPP928]: in Rule:6[#alarm{id='$id',property='armed',value=true} =>...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:6[#alarm{id='$id',property='armed',value=true} =>...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}
     

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, ChristianSogaard said:

    You are so fast. .Thank you ? 

     

     

    Gettig some more ERRORS - when triggering the ARM Alarm

     

    [15.11.2020] [20:20:45] [ERROR] [QUICKAPP928]: in Rule:5[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:5[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}
     

     

    [15.11.2020] [20:20:45] [ERROR] [QUICKAPP928]: in Rule:10[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:10[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}

     

    [15.11.2020] [20:20:50] [ERROR] [QUICKAPP928]: in Rule:6[#alarm{id='$id',property='armed',value=true} =>...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:6[#alarm{id='$id',property='armed',value=true} =>...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}
     

    and for RULE 7 when DeArming

    [15.11.2020] [20:24:38] [ERROR] [QUICKAPP928]: in Rule:7[#alarm{id='$id',property='armed',value=false} =>...]: {"err":".\/include\/EventRunner.lua:1824: bad deviceID 'nil' for '%setprop' '\"user\"?'","ERR":true,"src":"Rule:7[#alarm{id='$id',property='armed',value=false} =>...]","msg":"Error executing instruction:'[\"%setprop\",2,false,[\"msg\"]]'"}

    Link to comment
    Share on other sites

    I don't recognise the rule numbers anymore - you have added rules? Can you post all your alarm rules?

    The user should be the ID if your HC3 user.

    Ex 2 is often the admin

    rule("user=2")

    Edited by jgab
    Link to comment
    Share on other sites

    6 minutes ago, jgab said:

    I don't recognise the rule numbers anymore - you have added rules? Can you post all your alarm rules?

    The user should be the ID if your HC3 user.

    Ex 2 is often the admin

    rule("user=2")

     

    seems like your 'user' is nil

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, jgab said:

     

    seems like your 'user' is nil

    matrix1 = 77 -- DeviceID of matrix device
    rule([[matrix1:central & keyPrim =>
         post({type=fmt('%s_%s_%s',keyPrim,matrix1:central.keyId,matrix1:central.keyAttribute)}); 
         keyPrim=nil
    ]])
    rule([[matrix1:central & keyPrim==nil =>
        keyPrim=fmt('Key%s_%s_%s',matrix1,matrix1:central.keyId,matrix1:central.keyAttribute); 
        wait(2); 
        keyPrim=nil
    ]])

    rule("#Key77_2_Pressed3_4_Pressed2 => post(#disArm)") -- Matrix iD 77, key 2 3-clicks, key 4 2-clicks

      rule([[keyfob:central.keyId==3 => -- Keyfob to enable/disable alarm zone
        || 1:alarm.armed >> 1:alarm=false; log('disarming 1');
        || !1:alarm.armed >> 1:alarm=true; log('arming 1')
        ]])
        
       rule("1:alarm='watch'") -- Send us an event when user arms alarm (via app or GUI or rule)
       
      rule([[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed
            local alarm = id:alarm;
            if alarm.devices:safe then                            -- Check that devices are safe
              user:msg = log("Alarm partition '%s' is about to arm in %s seconds",alarm.name,secs) 
            else
               id:alarm=false;
               user:msg = log("Alarm partition '%s' has breached devices, cancelling arming",alarm.name,secs) 
            end
            ]])

      rule([[#alarm{id='$id',property='armed',value=true} =>
            user:msg = log("Alarm partition '%s' is now armed",id:alarm.name)
            ]])

      rule([[#alarm{id='$id',property='armed',value=false} =>
            user:msg = log("Alarm partition '%s' is now disarmed",id:alarm.name)
            ]])

      rule([[#alarm{id='$id',property='breached',value=true} =>       -- Alarm partition breached
            user:msg = log("Alarm partition '%s' breached!",id:alarm.name);
            for i=1,5 do log("Tuut!") end
           ]])

      rule([[#alarm{property='homeBreached',value=false} =>  -- All alarm partitions safe
            user:msg = log("Alarm safe again")
           ]])


    rule([[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed
            local alarm = id:alarm;
            if alarm.devices:safe then                            -- Check that devices are safe
              user:msg = log("Alarm partition '%s' is about to arm in %s seconds",alarm.name,secs) 
            else
               id:alarm=false;
               local bd = {}; 
               for _,id in ipairs(alarm.devices) do if id:breached then add(bd,id:name) end end;
               user:msg = log("Alarm partition '%s' has breached devices %s, cancelling arming",alarm.name,bd) 
            end
          ]])
       

    Link to comment
    Share on other sites

    So you need to set the variable user to a userID in the beginning of the rules, like

    rule("user=2")

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • 23 minutes ago, jgab said:

    So you need to set the variable user to a userID in the beginning of the rules, like

    rule("user=2")

    Please login or register to see this code.

    I'm running test on this Rule - I'm getting !"Alarm partition '%s' is about to arm in %s seconds" every time arming . even though - my door is opened, and is member of the Perimeter and the Whole House Zone.

    It should do "cancelling arming" 

     

    15.11.2020] [21:04:11] [DEBUG] [QUICKAPP432]: update curDoors: x17:x Bagdør,355.0.1, , doors: Kontor Havedør x4:x,x17:x Bagdør,355.0.1,
    [15.11.2020] [21:04:29] [DEBUG] [QUICKAPP928]: Incoming trigger:{"value":true,"id":2,"type":"alarm","property":"armed"}
    [15.11.2020] [21:04:29] [DEBUG] [QUICKAPP928]: [{"type":"alarm","id":"$id","value":true,"property":"armed"}]>>'Rule:5[#alarm{id='$id',property='armed',value=true} =>...]'
    [15.11.2020] [21:04:29] [TRACE] [QUICKAPP928]: Alarm partition 'Whole House' is now armed
    [15.11.2020] [21:04:30] [DEBUG] [QUICKAPP928]: fibaro.call(2,"sendGlobalPushNotifications","Alarm partition 'Whole House' is now armed","false") => nil

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

    And the door is a member of the partition reported in the "Alarm partition '%s' is about to arm in %s seconds" log?

    Do you arm the whole house or a single partition?

    Can add some log to see what devices it thinks are safe

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, jgab said:

    And the door is a member of the partition reported in the "Alarm partition '%s' is about to arm in %s seconds" log?

    Do you arm the whole house or a single partition?

    Can add some log to see what devices it thinks are safe

    Please login or register to see this code.

     

    This Line is showing the change. - so . "Kontor Havedør x4:x" just opened

    [15.11.2020] [21:23:22] [DEBUG] [QUICKAPP432]: update curDoors: x17:x Bagdør,355.0.1, , doors: Kontor Havedør x4:x,x17:x Bagdør,355.0.1,

     

    Its member of "Whole House"

    Please login or register to see this image.

    /monthly_2020_11/image.png.4a1202de3dfa0ad0c1e07392b24c6b9e.png" />

    The House is being Armed.

    [15.11.2020] [21:26:16] [DEBUG] [QUICKAPP928]: Incoming trigger:{"value":true,"id":2,"type":"alarm","property":"armed"}
    [15.11.2020] [21:26:16] [DEBUG] [QUICKAPP928]: [{"type":"alarm","id":"$id","value":true,"property":"armed"}]>>'Rule:5[#alarm{id='$id',property='armed',value=true} =>...]'
    [15.11.2020] [21:26:16] [TRACE] [QUICKAPP928]: Alarm partition 'Whole House' is now armed
    [15.11.2020] [21:26:16] [DEBUG] [QUICKAPP928]: fibaro.call(2,"sendGlobalPushNotifications","Alarm partition 'Whole House' is now armed","false") => nil

     

     

    Trying for ZONE - Perimeter. Then it works?

     

    - [15.11.2020] [21:28:30] [DEBUG] [QUICKAPP928]: [{"type":"alarm","id":"$id","value":"$secs","property":"willArm"}]>>'Rule:9[#alarm{id='$id',property='willArm',value='$secs'} => -- Notification that alarm is about to be armed...]'
    [15.11.2020] [21:28:30] [TRACE] [QUICKAPP928]: Alarm partition 'Perimeter Zone' has breached devices ["Kontor Havedør x4:x"], cancelling arming

     

    Link to comment
    Share on other sites

    52 minutes ago, ChristianSogaard said:

    This Line is showing the change. - so . "Kontor Havedør x4:x" just opened

    [15.11.2020] [21:23:22] [DEBUG] [QUICKAPP432]: update curDoors: x17:x Bagdør,355.0.1, , doors: Kontor Havedør x4:x,x17:x Bagdør,355.0.1,

     

    Its member of "Whole House"

     

    The House is being Armed.

    [15.11.2020] [21:26:16] [DEBUG] [QUICKAPP928]: Incoming trigger:{"value":true,"id":2,"type":"alarm","property":"armed"}
    [15.11.2020] [21:26:16] [DEBUG] [QUICKAPP928]: [{"type":"alarm","id":"$id","value":true,"property":"armed"}]>>'Rule:5[#alarm{id='$id',property='armed',value=true} =>...]'
    [15.11.2020] [21:26:16] [TRACE] [QUICKAPP928]: Alarm partition 'Whole House' is now armed
    [15.11.2020] [21:26:16] [DEBUG] [QUICKAPP928]: fibaro.call(2,"sendGlobalPushNotifications","Alarm partition 'Whole House' is now armed","false") => nil

     

    It seems like it's going directly from activating to armed. Is the delay close to 0s?

    It needs a delay for the activation check to have time to check the devices before the partition gets armed.

    I would say it needs a minimum of 4-5s delay in the alarm setting for the partition

    Edited by jgab
    Link to comment
    Share on other sites

    • 1 month later...
  • Topic Author
  • On 11/15/2020 at 9:08 PM, ChristianSogaard said:

    Please login or register to see this code.

    I'm running test on this Rule - I'm getting !"Alarm partition '%s' is about to arm in %s seconds" every time arming . even though - my door is opened, and is member of the Perimeter and the Whole House Zone.

    It should do "cancelling arming" 

     

    15.11.2020] [21:04:11] [DEBUG] [QUICKAPP432]: update curDoors: x17:x Bagdør,355.0.1, , doors: Kontor Havedør x4:x,x17:x Bagdør,355.0.1,
    [15.11.2020] [21:04:29] [DEBUG] [QUICKAPP928]: Incoming trigger:{"value":true,"id":2,"type":"alarm","property":"armed"}
    [15.11.2020] [21:04:29] [DEBUG] [QUICKAPP928]: [{"type":"alarm","id":"$id","value":true,"property":"armed"}]>>'Rule:5[#alarm{id='$id',property='armed',value=true} =>...]'
    [15.11.2020] [21:04:29] [TRACE] [QUICKAPP928]: Alarm partition 'Whole House' is now armed
    [15.11.2020] [21:04:30] [DEBUG] [QUICKAPP928]: fibaro.call(2,"sendGlobalPushNotifications","Alarm partition 'Whole House' is now armed","false") => nil

    For the variable user for the userID in the beginning of the rules, like

    rule("user=2")

    if family is 4 people - all using APP for ARM/DisArm

    Can I detect which user is arming from the APP - and only sendGlobalPushNotifications to the user that is arming?

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • On 11/15/2020 at 8:48 PM, jgab said:

    So you need to set the variable user to a userID in the beginning of the rules, like

    rule("user=2")

    rule("user=2")

    What if I have 4 users- can i check which user from the APP is arming the Alarm? - if not i need to PUSH to all users

    Can I do rule("user=2,3,4,5") ?

    Link to comment
    Share on other sites

    4 minutes ago, ChristianSogaard said:

    rule("user=2")

    What if I have 4 users- can i check which user from the APP is arming the Alarm? - if not i need to PUSH to all users

    Can I do rule("user=2,3,4,5") ?

    You can push to several users by giving a list to :msg

    Please login or register to see this code.

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, jgab said:

    You can push to several users by giving a list to :msg

    Please login or register to see this code.

    Love that - but can i check which user i arming the Alarm , and only PUSH to that user?

     

    Link to comment
    Share on other sites

    2 minutes ago, ChristianSogaard said:

    Love that - but can i check which user i arming the Alarm , and only PUSH to that user?

     

    I haven't been able to detect any trigger value (or events panel) that tells who armed the alarm.

    You could have different buttons/scenes for your users to arm, and there set the user.

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, jgab said:

    I haven't been able to detect any trigger value (or events panel) that tells who armed the alarm.

    You could have different buttons/scenes for your users to arm, and there set the user.

    Brilliant Idea ?

    Link to comment
    Share on other sites

    Jan,

    can this be a temporary option?

    for each user a line?

    Please login or register to see this code.

    Link to comment
    Share on other sites

    1 hour ago, Sjakie said:

    Jan,

    can this be a temporary option?

    for each user a line?

    Please login or register to see this code.

    That's equal to

    2:msg = ...

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