Success! Updated smoke/CO calls me when alarming

Several years ago I managed to get my Vera to call me when my smoke and carbon monoxide filter went into alarm mode. That was pretty kludgy and required a PC running Asterisk - a daunting task in and of itself.

I moved to a different state and decided to tackle the problem again, and have it working, but this time using a Raspberry Pi 2 ($35!) instead of a PC. The technology has come a long way. You can trigger a voice call from any scene using LUA. The LUPP code is probably the most complicated part.

Here’s how it works:
I use the BRK-RM4 relay (works with First Alert brand smoke detectors)
Connect the relay to a door sensor (I happened to use a Schlage, but any should work including the monoprice ones)

  • When the smoke detector alarms it closes the relay which in turn makes the door sensor see a “door open” event.
  • When the alarm ends, the relay opens giving a door closed event.

On the RPi2 I installed asterisk from raspberry-asterisk.org.
I added a trunk to my existing voip provider though google voice would work just as well.
I added a custom context and a few extensions to handle calls for alarming and “return to normal”.
Added a custom CGI for the Vera interaction
Added a custom AGI for actually making the calls.

On vera I created a scene that was triggered when the Smoke detector “door” was closed.
In the LUA code, I collect a few pieces of information including the current temperature from the up and downstairs thermostats.
I create a URL that contains all the information that I want to pass to voip caller (including the temperature) and fire it off with luup.inet.wget( link)

Here’s what happens:
Alarm goes off - relay closes
Door sensor sends an alert to VERA for the smoke alarm door opening.
The Vera Scene collects the data from various sensors, and fires off the link to my custom CGI.
The custom CGI (in apache) collects the data from Vera and creates a “dialout” file which is tossed over to the Asterisk VOIP system, in includes all the variables passed from Vera.
The call file creates a call - connects it to my custom context and the other end to a phone number supplied by vera (in the LUUP code).
The voip system does some text to speech (using google’s text to speech engine - the same one you hear on google maps) and calls and delivers the message. It’s smart enough to look for an answering machine so it will deliver the message properly.

If you’re interested in more details I’d be happy to help, or provide a more thorough write-up. (The intro on the messages is from Peter Griffin from Family guy. :slight_smile: )

The attached files let you hear the message that was sent.

My original post: http://forum.micasaverde.com/index.php/topic,15334.msg116522.html#msg116522

Just curious why you would want a phone call vs. a text message or email? I find having texts/emails with distinct ringtones (like a wailing siren) to be much faster and attention-getting than a phone call. Thanks for taking the time to write it up. It’s always neat to see how others are putting things together!

The simple answer is because I could. :slight_smile:

Since vera sends the text as an email from noreplyXX@notify.mios.com and XX can be basically any number, setting up distinct ringtones can be a challenge. Especially since all alerts come from the same group of addresses - I don’t have any way to identify a vera notification about an open door vs smoke detector. They all look the same.

Plus, persistent phone calls are harder to ignore and have a better acceptance from other potential participants in the family.

Very interested in how you go it to work and the process, I want to do something very similar. I want to use it to call my kids and have them get out of bed. The phone is the only think they can understand, lol.

Regards,