Author Topic: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus  (Read 1498 times)

Offline PowerSportsFan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Hi all,

I have been pouring over the forums for weeks and piecing together bits of somewhat related information in order to add full security system functionality to my Z-wave Network with VeraPlus as the heart of it.  And I did not come across any recent posts so I thought I would write up this post to hopefully help others out that are trying to add alarm system functionality to their home automation by bringing all my findings together.

First off, thanks to all the smart and nice people on these forums that have shared their knowledge and experience.  There is no way I can take sole credit for this post.  Just bringing all the various pieces of information together here, in addition to a small amount of creativity on my own part.

Secondly, please keep in mind that I am in no way endorsing or supporting the use of Z-wave and home Automation as a security system.  It is simply what I have done, and if you choose to do the same, then you can use this information if you wish.

Okay so here we go.  Below are the steps and configuration guides as to what I did to add "alarm system" functionality to my home automation, with full entry delay capabilities and audible alerts and chiming.

Devices and sensors:
=============
1) At the heart of it all of course is the VeraPlus controller.

2) As far as door/window/motion/other sensors go, I won't get into any detail.  Just buy the ones you like.  I have a few different makes and brands, but they all seem to work fine so I am not going to get into details for sensors. 

3) What detail I will get into is for sirens and chimes because they behave in a particular way that makes them useful in the "alarm system" setup.The two sirens that I have are Fortrezz SSA2 Red Siren, and the Aeotec ZW080US Siren.  For the chiming/alerting functions, I have a Aoen Labs ZW056.  I haven't played with this one much but apparently you can load a whole bunch of MP3 files into it and call upon those files as announcements.

4) As well, I will provide info on the Zipato RFID keypads I used, as well as the remote controls for added convenience in arming/disarming etc.  The keypads are the ZIPATO Z-WAVE MINI RFID KEYPAD (WT-RFID), and work great.  I have added the Aeotec KeyFob remote control ZW088-C - Z-Wave Plus to the system so far, and plan to add a MiniMote as well, but have not done so yet.

5) You will also need the HouseModes Plugin, which is downloaded and installed from the Apps section within the VeraPlus UI7 GUI.


Adding and preparing the devices:
=====================
I won't get into any detail about this since I think it is quite basic and easy to add devices to UI7.  I am just mentioning it here as the next step to setting all of this up.  Add all your devices into VeraPlus.  Also add any/all of the user codes and RFID tags to the Zipato keypads that you want.  I believe each keypad can hold up to 20 codes, and I think this is a combination of numeric user codes, or using the RFID tags for users.  The tags are of course easier as you just wave it in front of the keypad and it transmits a nice long code.  If anyone loses their RFID tags tough, better remember to remove them from the system...  The buttons on various remotes can also be programmed to carry out arm/disarm functions..


Configuring the "My Modes" details from the dashboard:
===================================
VeraPlus already has "house modes" built in that will perform a lot of automated steps such as arming/disarming appropriate "security/alarm" sensors and so on.  This makes things a lot easier.  Click on the arrow to the right of the "My Modes" section on the dashboard to reveal the detailed settings.  Set whatever sensors you want armed/disarmed in whatever modes. 

In addition, ensure that the following are set for the sirens mentioned in the devices section above:  This is necessary because the sirens and chime I have listed in the devices above, install as various device types, and are controlled as follows:

Fortrezz Red Siren (SirenRed)
Turning On occurs with the Burglary scene (later on below)
Turning off is done by the dashboard (as well as by DisarmedHome scene further on or the SirenAutoOFF Scene)

Aeotec Siren (Siren2):
Turning on is performed by Burglary scene
Turning off is performed by DisarmedHome Scene

Door chime (Doorbell):
Activating is done via EntryDelayActiveScene
Turning off is done via the dashboard (or DisarmedHome scene, or the SirenAutoOFF scene)

So therefore, these settings will make them function as desired in an "alarm system" configuration:

Ensure that Siren2 is set to OFF in all modes under "What to do if an armed sensor is tripped". 
Ensure for SirenRed is set to OFF for Home mode, and No Change for the others under "What to do when this mode is selected"
Ensure that Doorbell is set to OFF for Home mode, and No Change for the others under "What to do when this mode is selected"

Under "How much time to wait before changing mode?" I have:

Wait 40 seconds before changing from home to any other mode
Wait   2 seconds before reporting a motion, door, window tripped


Configuring the "alarm system" related scenes:
==============================
Now assuming that everything is added to the system and working properly, we can proceed with configuring the required scenes to add alarm system functionality.  again I am not going to get into too much detail here because if you have come this far to be using your home automation for more than just "turning lights off and on", it is assumed that you know how to use at least the basics of the UI7 interface  and clicking buttons etc...

Below I did quick copy/pastes from the GUI of the scenes involved for "alarm system" functionality, which should be enough information to use for your own configurations.  The four that you definitely need for "alarm system" like functionality are provided below.  The Scene names should be self explanatory.





============================================================

Edit "EntryDelayActive"
Help for scene creation
Back to Scene List

Step 1: Select a Trigger
3 Device Triggers
Whenever FrontDoor1 is armed and opened...   <----- this for me is front door, back door, and motion sensor.  The motion sensor I had to add because it is a really nice one and picks up motion all the way to the front door from way at the back of the house!! You can add other devices that you may want entry delays on (garage, a window, multisensors, etc).

Step 2: Device Actions
Immediately
NorthCam Record a 15-20 seconds video
SouthCam Record a 15-20 seconds video  <----- I added these as a precautionary, in case it is actually a burglar, then there will be video of the entry event.
Doorbell On  <---- this is my Aoetac ZW056 chime.   This gets turned on as a reminder to disarm the system.  For now it just turns on the default ring tone.  But you can get fancy with loading up tons of MP3 files and then calling different ones, like for exit delay, entry delay, other alerts, etc..  I haven't done this yet.  If you get this far and you get it all working, maybe we can work together to get the rest of it done.  I believe it will have to be done with LUUP code, otherwise the "On" command just plays the default file..

Step 3: Finish the Scene
This scene runs...
When I am in any mode
When this scene runs...
Notify these people:       <----- no notifications here unless you want it, but you know you've walked into your house so...
   
Also, execute the following Luup code:
<-------------- here is the very important LUUP code that gives you your delay entry and makes sure sirens don't go off wailing after your entry delay has expired.  Please see the note arrows on each line.  Should be fairly self explanatory.  The idea here is that when this scene is triggered, it immediately runs a few actions, but also runs the LUUP code.  The code essentially says wait for 30 seconds to give user time to Disarm.  After 30 seconds, check HouseMode, if still armed, then call upon the BurglaryActive Scene.  Otherwise return false (block the scene).  In the BurglaryActive Scene you can do whatever you want done in case of a burglary

local dID = 38  <--- Device ID of HouseModes Plugin
local allow = false
luup.call_delay("delaycall",30)  <---- wait 30 seconds, then call the "delaycall" function below
function delaycall()
   local status = luup.variable_get("urn:micasaverde-com:serviceId:HouseModes1","HMode",dID)
   if (status ~="1") then  <--- If HouseMode NOT equal 1 (Home mode) then call Scene #29 (BurglaryActive Scene)
      luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="29" }, 0)
   else
      return allow  <---- otherwise block the scene since "allow" is set to false
   end
end


Advanced Editor

Select Room
Room Name:

Name Your Scene
Name:
EntryDelayActive

============================================================


Edit "BurglaryActive"
Help for scene creation
Back to Scene List

Step 1: Select a Trigger
Manually triggered scene.

Step 2: Device Actions
Immediately
SirenRed Level 19%  <---- this level makes only the LED's flash.  This siren is quite loud and you might want to do this for testing!
Siren2 On
Siren2 Disarmed  <--- Not sure how you can use the arm/disarm function of this siren but it is not necessary here
NorthCam Record a 15-20 seconds video
SouthCam Record a 15-20 seconds video

Step 3: Finish the Scene
This scene runs...
When I am in any mode
When this scene runs...
Notify these people: user1   user2 ....       <----- user notifications
   
Also, execute the following Luup code:
no LUUP code defined

Advanced Editor

Select Room
Room Name:

Name Your Scene
Name:
Burglary
============================================================




Edit "InstantAlarmActive"
Help for scene creation
Back to Scene List
Step 1: Select a Trigger
2 Device Triggers
Whenever Glass Break Sensor is armed and detects glass break/vibration...  <---- any devices/sensors that shouldn't have a entry delay on them

Step 2: Device Actions
Immediately
SirenRed Level 21%
NorthCam Record a 15-20 seconds video
SouthCam Record a 15-20 seconds video
Siren2 On
Siren2 Disarmed

Step 3: Finish the Scene
This scene runs...
When I'm in the mode Night or Away
When this scene runs...
Notify these people: user1  user2 ....          <----- user notifications

Also, execute the following Luup code:
No Luup Code defined
Advanced Editor
Select Room
Room Name:

Name Your Scene
Name:
InstantAlarmActive

============================================================

Edit "DisarmedHome"   <----- run some stuff when the house mode is changed to Home.  ***Also silences all chimes and sirens
Help for scene creation
Back to Scene List

Step 1: Select a Trigger
1 Device Trigger
Home   <---- the trigger is the HouseModes plugin, polling set to every two seconds for house status

Step 2: Device Actions
Immediately
NorthCam Record a 15-20 seconds video
SouthCam Record a 15-20 seconds video
Doorbell Off
Siren2 Off
Siren2 Disarmed

Step 3: Finish the Scene
This scene runs...
When I am in any mode
When this scene runs...
Notify these people: user1    user2      <----- user notifications
Also, execute the following Luup code:
No Luup Code defined

Advanced Editor

Select Room
Room Name:

Name Your Scene
Name:
DisarmedHome




============================================================


So the above are the critical scenes required for entry delay, and for sounding the sirens and sending out the notifications.


I created some other convenience scenes as well, here is an example.

============================================================

Edit "LivingRmLightsOn"   <---- turn some lights on whenever the system is armed, and you walk in the door after dark
Help for scene creation
Back to Scene List

Step 1: Select a Trigger
2 Device Triggers
Whenever FrontDoor1 is armed and opened...

Step 2: Device Actions
Immediately
Lamp Module 1 On

Step 3: Finish the Scene
This scene runs...
When I'm in the mode Away
When this scene runs...
Notify these people

Also, execute the following Luup code:

local allow = true   <---- set the allow variable.  True allows scene, false blocks it from running
return ((luup.is_night()) == allow)   <---- since allow is set to true, then true is returned, and scene will run at night

Advanced Editor
Select Room
Room Name:

Name Your Scene
Name:
LivingRmLightsOn

============================================================

I also created a Scene to automatically turn off the sirens after 1 minute so they don't go on screaming forever. 

============================================================

Edit "SirensAutoOFF"
Help for scene creation
Back to Scene List

Step 1: Select a Trigger
2 Device Triggers
Whenever the Siren2 is turned on
SirenRed is turned on

Step 2: Device Actions
Wait for 1m and then
SirenRed Off
Siren2 Off
Siren2 Disarmed

Step 3: Finish the Scene
This scene runs...
When I am in any mode
When this scene runs...
Notify these people
Also, execute the following Luup code:
No Luup Code defined
Advanced Editor
Select Room
Room Name:

Name Your Scene
Name:
SirensAutoOFF

============================================================




This has made a very nice self monitored "alarm system" so far.  Took me a while to put this all together and make it work.  Thanks again to all of the smart people that were kind enough to share the information I needed to piece this together.  As you can see, it can be built upon and extended as desired.

Once I add the configs of calling upon different files for different announcements from the chime device, I will update this post.

Hope this is a helpful post.

« Last Edit: October 05, 2016, 08:42:07 pm by PowerSportsFan »

Offline PowerSportsFan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Made some changes.  This is pretty much 100% functional for me.  Hope it helps.

Offline treetop777

  • Full Member
  • ***
  • Posts: 134
  • Karma: +3/-2
Saved for later.  Thanks for sharing.

Offline iamlinus

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
Wow, this was amazing, exactly what I wanted to achieve as well. Kudos!

Offline OlivierToebosch

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #4 on: November 25, 2016, 11:33:15 am »
thx for your input! This works as a charm, but only if I change to the house mode to away with the smartphone!
I'm having nearly the same setup as you:
sensors, rfid keypads, siren and a wallplug with a buzzer plugged in, instead of the mp3 bell player (not available yet in europe).

But my rfid keypads are placed in sensor pir umbrella's. And when I use the keypad to activate the alarm (going from home to away) I trigger the scene and leave the house. You can understand the alarm is set off within 30 seconds :-)

How can this be solved?

best regards,

Olivier

Offline jsauser11

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #5 on: December 03, 2016, 02:43:44 pm »
Hi
I am trying to implement this setup with only a single siren (ZW080-A17). Have it running fine (thanks for the code), but want to implement tone and volume changes for the EntryDelayActive and BurglaryActive scenes. I can control the Siren Gen5 fine with different luup codes sent from individual scenes to set the tones and volume, but can't seem to send them within the code of the EntryDelayActive or BurgleryActive scenes. Thought it would be as simple as appending the code you developed with the control code for the siren to set tone and volume, but no luck with that.
My goal is to have the EntryDelayActive run the siren at tone 5, volume 1, and the BurglaryActive run the siren at tone 1, volume 3.
Any ideas how to do this within the existing code without having to call a device action?
Thanks.

Offline OlivierToebosch

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #6 on: December 04, 2016, 08:20:38 am »
Funny, we are on the same quest! But for me the siren is too loud for a notification functionality. I'm looking for a 'networked mp3 player' that is adressable via http commands. I have a nas with enough storage. it's a pity the aeontec doorbell is not available in Europe, because it covers all my needs.

Offline kigmatzomat

  • Full Member
  • ***
  • Posts: 219
  • Karma: +7/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #7 on: December 07, 2016, 08:11:47 am »
It's pricey but I think you can do that with sonos. I don't own one but the default answer to "I need an audio device that..." Tends to be "buy a sonos"

Offline Cor

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +3/-4
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #8 on: December 07, 2016, 08:23:45 am »
What I did before I had sonos stuff.

Got a cheap android tablet or phone, install vera alerts and send out notifications via vera alerts, to that phone-tablet. For a bit more volume I added a bluetooth speaker.

Cor

Offline PowerSportsFan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #9 on: December 29, 2016, 08:17:48 pm »
Hi
I am trying to implement this setup with only a single siren (ZW080-A17). Have it running fine (thanks for the code), but want to implement tone and volume changes for the EntryDelayActive and BurglaryActive scenes. I can control the Siren Gen5 fine with different luup codes sent from individual scenes to set the tones and volume, but can't seem to send them within the code of the EntryDelayActive or BurgleryActive scenes. Thought it would be as simple as appending the code you developed with the control code for the siren to set tone and volume, but no luck with that.
My goal is to have the EntryDelayActive run the siren at tone 5, volume 1, and the BurglaryActive run the siren at tone 1, volume 3.
Any ideas how to do this within the existing code without having to call a device action?
Thanks.

Sorry for the delayed response.  Haven't had much time these days.

For the BurglaryActive scene, I can't think of why it wouldn't work.  Make sure that the scene is set to run in ANY mode, and make sure you are getting the Device ID's correctly.

For the EntryDelayActive scene, same thing, plus ensure that you are not running the code within the delay function.

I have also found that sometimes I have had to use the "altID" of the device in LUUP code (under Advanced settings), rather than the actual Device# when the device is created.   This was especially true for tone and volume controls.  I am not sure this is 100% consistent but it was true for the doorbell device for some reason...?

Try these and see if you can get it going.  Good luck!
« Last Edit: December 29, 2016, 08:58:02 pm by PowerSportsFan »

Offline PowerSportsFan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #10 on: December 29, 2016, 08:23:26 pm »
thx for your input! This works as a charm, but only if I change to the house mode to away with the smartphone!
I'm having nearly the same setup as you:
sensors, rfid keypads, siren and a wallplug with a buzzer plugged in, instead of the mp3 bell player (not available yet in europe).

But my rfid keypads are placed in sensor pir umbrella's. And when I use the keypad to activate the alarm (going from home to away) I trigger the scene and leave the house. You can understand the alarm is set off within 30 seconds :-)

How can this be solved?

best regards,

Olivier

Hi Olivier,

Again appologies for the delayed response.  Been really busy.

I think that your motion sensors are remaining in "tripped" mode for too long.  I have set my motion sensor to go back to untripped mode within 10 seconds. So even if I set them off while exiting, the 30-40 seconds of delay are long enough to let the motion sensor exit its tripped state.  So when the system does finally change to ARMED mode, the motion sensors are back to untripped, and will not trigger the alarm scene.

You may need to search online for how to change settings of your particular motion sensor.  The documentation that comes with these devices doesn't nearly cover all of their settings and capabilities.

Hope that helps!
« Last Edit: December 29, 2016, 08:58:24 pm by PowerSportsFan »

Offline PowerSportsFan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #11 on: December 29, 2016, 08:38:48 pm »
Also, although it is in the text of my first long post, for the sake of easy access, this is how you would set your "My Modes" settings in the Dashboard:

===================
=== My Modes settings ===
===================


Configure My Preset Modes
House Modes allow you to quickly and easily automate multiple functions into one simple button press. For example, when you are Away, your Vera will automatically lock your door, turn off the lights, and adjust the thermostat to save you money. Click any of the 'Default' buttons below and start customizing your 'House Modes'.

             Home      Away      Night      Vacation

             CUSTOM      CUSTOM      CUSTOM      CUSTOM


Choose sensors to arm
FrontDoor1   DISARMED   DARMED      ARMED      ARMED
BackDoor    DISARMED   ARMED      ARMED      ARMED
MultiSenso..   DISARMED   DISARMED   DISARMED   ARMED
MotionSens..   DISARMED   ARMED      DISARMED   ARMED
Glass Brea..   DISARMED   ARMED      ARMED      ARMED
NorthWindo..   DISARMED   ARMED      ARMED      ARMED
_Smoke Sen..   DISARMED   ARMED      ARMED      ARMED

What to do if an armed sensor trips?
Siren2      OFF      OFF      OFF      OFF  <--- other sirens are turned off in scenes.
NorthCam   OFF      OFF      OFF      OFF
SouthCam   OFF      OFF      OFF      OFF
Record and store video whenever the above sensors are tripped or doors or windows are opened. <-- This is done through scenes

Who should be notified ?
Choose which Vera Users to notify automatically in the event a door or window is opened or a sensor is tripped.Add User
user1.      NO      NO      NO      NO   <--- notifications done through scenes
user2.      NO      NO      NO      NO

What to do when this mode is selected?
Doorbell          Off              no change   no change   no change
Appliance ..   no change   no change   no change   no change
SirenRed           Off (0%)           no change   no change   no change
Lamp Modul..   no change   no change   no change   no change
Lamp Modul..   no change   no change   no change   no change


How much time to wait before changing mode?  <--- change to your preference
Wait    40    seconds before changing from home to any other mode
Wait    2     seconds before reporting a motion, door, window tripped

GeoFencing  <--- change to your preference
Set house mode to HOME when at least one user is at home  (off)
Set house mode to AWAY when nobody is at home              (off)



Offline ozleon

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #12 on: January 04, 2017, 08:06:07 pm »
Great Stuff PowerSportsFan.

With your guidance I was able to setup my system. I don't have all of the sensors, and only one siren, but for what I have it works great. Question for yah:

1) Is there some code that I can add to not switch to "Away" if a door or window is open? On my Time Warner system it would not let me arm if any of the sensors were active. I can envision a scenario of the kids leaving the sliding door open, as we are all rushing out the door. I arm the system, and it start going off, because the sliding door sensor is tripped.

2) whats the purpose of the two sirens? I purchased the Aeotec Siren, but not sure if I need the other one. From your comments, and others it seems the Fortrezz allows you to set volume, and duration commands. I ordered the Aeotec doorbell, and will use that for notifications, as you described.

Thanks
Ozzie

Offline PowerSportsFan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Adding alarm system functionality to Z-Wave Home Automation with VeraPlus
« Reply #13 on: January 11, 2017, 10:01:07 pm »
Hey Ozzie, glad this compilation of info was helpful.

1) Try this post:

http://forum.micasaverde.com/index.php/topic,33828.0.html

It has some great code that polls for status of sensors. 

I haven't done this yet but I have been meaning to, as soon as I find some time.  Not quite sure where to put this since the delay for "change to any other mode from Home mode" is configured through the dashboard "My Modes".  You would need a way to check the status of the sensors BEFORE the delay is even allowed.  I am thinking a scene that runs immediately on ARM request, where the status of the sensors is checked immediately, and if all good, then the exit delay would run within the LUUP code, kind of like my "EntryDelayActive" scene.  You would then need to remove the delay on the Dashboard.  The ARMing procedure could even be separated from the status check, I'm thinking almost like an "ExitDelayActive" scene.  Then the ARM scene can be called from within the ExitDelayActive LUUP code.  If some sensors are still tripped, you could make some sort of alert go off, and return FALSE for calling the ARM scene.  I suppose this is where multiple bell/chime devices may come in handy, or the wonderful Aeon Doorbell.

2)  The two siren setup just kind of happened because I had bought both of them already.  And before I bought the Aeon Doorbell, I was using "Siren2" with reduced volume and sound#1 as an entry delay chime.  So it's not a necessity.  Although may come in handy for some alerting as I suggested in point 1) above.

Hope that helps!  I will try and remember to post if/when I get this done.

 -John