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
Question
morpheus75 75
I messed up some code tags so re-posting...
Hi
Here is my small tutorial on the alarm system code i use to complement the rfid keypad system.
Firstly you need to create an 'ALARM' variable with at least 2 values.
one variable will be OFF
second variable will be FULL (or whatever name you want to give)
you could if you wanted create many more variables for different zone eg i have a 3rd called DOWN
you then programme the keypads (or any other scene) to change the variable to the alarm mode you want
Please login or register to see this code.
From above i have 2 keypads.
I have put triggers under the properties for both ON and OFF when i press the 'ON' button once it changes the VARIABLE to PART,
if i then press again it changes the VARIABLE to FULL.
If you wanted you could continue this for more zones but it can get a bit complicated......
Finally if either of the OFF buttons are pressed the VARIABLE is set to OFF.
Next part is the actual setting of the alarm..
Please login or register to see this code.
this looks big but you only need to add the device ID's of your FULL mode, DOWN mode and any other message once the alarm has been set. Remember to separate your ID numbers with a comma
The code is triggered by a change in the global variable called 'alarm'.
This then starts the scene. The time delay gives you time to press again for different modes and also to leave the house and make sure that all sensors become safe. (i have set my motion sensors to show as being safe after 5 secs, the default is around 15 secs).
After the time delay it checks which variable is set, then it only checks those sensors to make sure they are all SAFE.
If they are SAFE then it proceeds to ARM those sensors and then sends you a push message that the alarm has been set and will run any additional code you have added eg turn off the lights, heating etc
If they are UNSAFE then it aborts the arming procedure and sends you a message that 'a named sensor is unsafe to arm',
you can then investigate and make sure it is safe before starting again. examples include if a door was left ajar or window is left open etc
Next part is the ACTIVATION code:
Please login or register to see this code.
firstly you need to enter the ID numbers of all your sensors in the properties section as triggers except the entry zones
also the fullArmIds and downArmIds need to match the previous arming code except for the entry doors we have a separate entry code to give us a time delayed entry
1st block is the function activation(), this basically tells me via push message and email which sensor triggered my alarm
2nd block checks to see which mode the alarm is in and therefore will only monitor those specific ID's
3rd block will cause the alarm to trigger if our 'armed' devices are breached and run the activation code
Entry code is below this as name suggests gives us a defined time to enter property and switch off alarm before it activates:
Please login or register to see this code.
to start with set the ID of your entry zones under properties, and update the ID 82 and 83 with your own.
If you have just 1 then delete accordingley and more than 2 then just add the extra as needed
the function is same as before
the final block checks if the doors have been opened if they are armed and the alarm is NOT set to off it then starts a 30 sec timer.
Just amend 30 to whatever time you need.
once the timer has counted down it will check the variable again and if you have turned alarm off then code aborted.
if alarm not switched off then activation procedure starts just as before and sends push message, email and siren activates for 10 mins.
Final part is turning the alarm off
Please login or register to see this code.
fill the deviceIds with the values of ALL YOUR SENSORS - incl entry sensors
the trigger for this is the global variable alarm
if its in the 'off' setting then it will send me a push message and send an 'off' command to siren (just in case it was activated)
it will then go through the sensors 1 by 1 and disarm them all
I hope this helps all of you and any questions and feedback and comments please feel free to leave them
thanks
Link to comment
Share on other sites
34 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.