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


  • 0

alarm scenes, how to configure it?


xantony

Question

Hello,

i am starting with HC2 since few weeks, now i am trying to set up an alarm system. actually i have 12 door sensors and 8 motion sensors (all fibaro) for my alarm system.

Since i am with version 3.59 ( stable to me and not going to any beta untill everything works fine with 4.X versions) i started with tha alarm panel which is somehow limited for my need.

i would like to have something modular, like have 2 main alarms : one just perimetral ( just door sensors ) for being protected during the night with my presence at home; the other one volumetric+perimetral ( all the sensors active ) when i am away.

moreover i would be helpful to divide the zones of the house to be alarmed indipendently.

I did one easy try using the standard panel but it's very limited, also i found out that on the phone application there is no way to arm with one button the complete alarm system, i had to go room by room, device by device and arm them. is this as it was supposed to or i am missing somethin? how did you set up the alarm according to your need?

scenes might help but i am not into lua yet and i would start possibly with block scenes.

i would appreciate your suggestion and advices on this topic, also because i have 3 sirens that i did not installed yet cause i am scared doing somthing wrong and wake up all the building during the night

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

antonio

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0
Adjusted following code:
Well you could arm all devices manually:

Please login or register to see this code.

...

Well that will push a notification per sensor - I think that is a bit to much. It would be better to have the sendPush after the loop.

By the way, do note that I only check device ID 1 to 150 - if you have more devices, you might need to increase that value.

Link to comment
Share on other sites

  • 0

Well you could arm all devices manually:

Please login or register to see this code.

And then disarm:

Please login or register to see this code.

Do note the door_sensor test, and motion_sensor. If you like to just arm the door_sensors then just loop over all devices and just arm them. I use the code above when no one is home or someone is home. I could just as easy just arm/disasm just door_sensors...

Link to comment
Share on other sites

  • 0
  • Inquirer
  • thanks for your suggestion, i used it and they work just as easy. one additional question, what's the lua command do push a notification upon a group of device status?

    i.e. : i would like to have a custom push notification when all my door sensors are armed. the same when they are disarmed

    Link to comment
    Share on other sites

    • 0

    Adjusted following code:

    Well you could arm all devices manually:

    Please login or register to see this code.

    ...

    Link to comment
    Share on other sites

    • 0
    ...Well that will push a notification per sensor - I think that is a bit to much. It would be better to have the sendPush after the loop...

    As said, (move it down if you want only one message). That said you may want to also add code something like -- tonumber(fibaro:getValue(i, "armed")) > 0 -- to check that the sensor(s) really armed.

    Link to comment
    Share on other sites

    • 0

    Xanthony,

    As the guys have said, that code (put in a scene) will help you 'arm'/'disarm' what you need. The bit that you will 'need' to do it from your phone/tablet to make it easy for you without doing each one individually is a Virtual Device with two buttons (to start off) with 'Arm' 'Disarm.' Put that code into two buttons and you're up and running

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    There are two things you need to watch is when you have 'two' or more Alarms. ie. Fibaro has its own 'soft' alarm which will go off on phone/tablet when your 'armed' sensors are tripped but what you want to do is 'sync' these with any 'hard' alarms you have (i.e. hardware sirens) to make sure that they go on and off 'together'. You will need to think about using globals and more code to do it and make it more complicated as your needs arise.

    Second issue is Fibaro motion sensors. Apparently they work ok in >3.590 but I can't comment as they're not stable releases. I have many sensors and they ALL trip (tamper especially) on a regular basis with no motion at all. This will become VERY annoying. I got so fed up with it going off for no reason (as you will) that you will need to separate your door sensors from your motions sensors arming/disarming. Say in two different scenes. Then, in your motion sensor scene, write code for sensors going off by 'accident' i.e. if a sensor goes off once ignore it, but if two go off within one minute for example then set all alarms off. Will take you some time to figure it out as best for you but it will work.

    The fun is the testing and working it all out....unless you're married that is

    Please login or register to see this image.

    /emoticons/default_laugh.png" alt=":lol:" />

    Dave

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Link to comment
    Share on other sites

    • 0

    You could use json instead.

    This way you only write your code once as it adjusts to the answer.

    One way of doing it:

    Adjust your IP, Password, port etc.

    *Edit

    Added push function. Edit to suit your needs!

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0

    Cool!! Never really understood json (next on my personal list to learn).....that puts it in context for me with Alarm stuff

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    How exactly can 'one' learn json as regards how to use with Fibaro? i.e. I can't see anything on Support info about json really or the API so I'm just trying to work out from posts etc.

    Really helpful code

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Dave

    Link to comment
    Share on other sites

    • 0

    I'm looking for the same thing you are.

    I honestly know nothing, really.

    I just learn what i have to to get a specific function.

    I look at lua.org, google, this forum, other sites and connect the dots with trial an terror

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    So i don't have any real tips such as "look here for this".

    Glad the code can be of some use!

    Link to comment
    Share on other sites

    • 0

    You could have a look at the following link:

    Please login or register to see this link.

    Althought this is not a JSON tutorial, it provides useful information.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • hi guys,

    thanks all for the replies! i am so new i don't even know where to use json code, if into lua scene code or in builting a virtual device!

    one addistional question, how do i find my mobile ID?? i looked into access pannel and i just copy and paste the serial code associate to my mobile device but i got an error in lua code. anyone can helo on this?

    sorry i am very new and totally away from coding so i have to learn what i need without going to complicated otherwise i will give up!

    thanks

    Link to comment
    Share on other sites

    • 0

    this works also at the moment with the new api

     

        local jsonTable = api.get( "/devices" )

     

    saves a few lines of code

     

    (also no need for json.decode)

    Edited by lroovers
    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
    Answer this question...

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