Success! Interfacing my smoke detector/CO with VeraLite

I have been looking for some way to tie in my smoke/CO detectors to my Vera for some time, but haven’t found a good pre-made solution. So I rolled my own. As a bonus, it calls me and tells me what is happening, and even reports the indoor temperature from my Honeywell thermostat.

Before anyone freaks out, I realize that this is not a replacement for a dedicated home fire panel with it?s battery backup, etc. However, it met my needs and budget.

I’ve been in this home for about 18 months, and realized when testing my smoke detectors that they did not work at ALL. They were older BRK combo Smoke/CO detectors that were made in 04. The direct replacement is a First Alert combo SC9120B. They were already tied together, making my vera connection even easier. I need to replace two, they were about $35 each on Amazon.

Researching the project I needed a way to detect the alarm condition and then report it to Vera. For detecting the alarm, I used the BRK-RM4 interface module, which is UL listed under UL217, UL2034, UL539. The unit has a few disadvantages, though. It requires 120v power to operate (no battery backup) which is mildly concerning, but I’m ok with the tradeoff. If the power is off too long, then my vera will be dead, too, rendering the issue moot. It’s also kind of big. It’s about $18 shipped on Amazon.

For connecting to Vera, I used the Schlage RS100HC door/window sensor. It has two screw terminals for contact closure detection and has good range. I have one on my garage door about 50’ from Vera and it works fine. It’s about $39 on Amazon. The device reports to Vera as a motion sensor. When the two terminals are shorted, it shows idle, when they’re open it shows motion detected. Obviously pair the sensor to vera before you assemble everything. Make sure it works and its properly seen on the web page.

Wiring was very easy. I took a small piece of garage door button wire that I had left over, and connected it to the NC (Normally Closed) connections on the RM4 (Brown and Gray wires). The other end connected to the small screw terminals inside the Schlage door sensor. I used the smaller wire so I could fit it through the small hole that already existed on the Schlage door sensor. The other end of the RM4 connects to the 3 wires that attach to the smoke detector. They are Black (hot), White (neutral), Orange/Red (alarm interconnect). See the attached picture for details. I ended up shortening all the wires quite a bit. This is a LOT to cram into a small ceiling box.

Next, I set up two scenes on Vera, both triggered by the Schlage door sensor. I called one SmokeCO ALARMING, and it?s trigger was ?an armed sensor is tripped?, called it ?Smoke CO Alarming?, and the condition is “Device Armed is Tripped”.

The return to normal is configured the same, except the condition is “Device Armed is not tripped”. I tested it to make sure the triggers were working properly. I tested it all with the magnet before actually placing it in the ceiling box.

Then I used a spare computer to install Elastix for connection to my home VOIP provider. I created a sub account and attached it to make outbound calls. If anyone’s interested in that part, I can share how I did it.
To make a long story short, I wrote a program that accepts a web request with the following items:
Number to call - phone number to deliver the message to
Alert sound name - just a sound file on the computer, so I can modify the alert type
Alert count - number of times to play the alert sound
Text - using flite for text to speech, I convert this text into words.

Last, I integrated it all with LUUP code. When the trigger fires, the LUUP code

  1. Checks to see if the door sensor is armed. If not, just exit. I was afraid something might go wrong, so I can disable the process by simply disarming the Schlage door sensor.
  2. Query the temperature of the indoor thermostat
  3. Build a text string something like “Alarming alarming alarming. Smoke and carbon monoxide detector is alarming and the indoor temperature is 71 degrees. Press 1 to repeat the message.”
  4. Package it all up in a URL and call the Elastix box to generate the call.
  5. Repeat the call for all numbers in the array. (It calls my work and cell phone)

And it all works! I’d love to hear suggestions for other uses or improvements!

Attachments to this post:

(seems you can’t upload mp3 voice messages, so I zipped them up)
Voicemail for detector ALARMING
Voicemail for detector return to normal
Voicemail for detector ALARMING with alert tone

LUUP code with comments for the ALARMING scene. Obviously adjust as necessary for the return to normal scene.

LUUP Code for Alarming Scene

--First lets get the armed state of the sensor.
-- From:  http://wiki.micasaverde.com/index.php/Scripts_for_scenes
-- This is the device ID for sensor we want to query.  We will ignore alerts if this sensor is not armed.
local deviceNo = 48

-- Example of how to get status from below
-- original_status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status", device)

-- Security Sensor Service ID
local SS_SID = "urn:micasaverde-com:serviceId:SecuritySensor1"  
local armed = luup.variable_get (SS_SID, "Armed", deviceNo)
if (armed == "0") then
    return false  -- Not armed so we exit.
end 


-- Since we're armed, we want get the current temperature from the thermostat.
-- 
--Thermostat device
local deviceNo = 29


-- These are the numbers we'll call and report our alarm
local phoneNumbers = {"12025551212", "12025551213"}

--  Start out with some text to make it clear what you're reporting. 
--  All the text must be URL encoded since it's passed to a remote machine for processing.
--  These are done in variables so I can reuse this code for both alarm and alarm-cleared conditions.
initialWarning = "Alarming%20Alarming%20Alarming.%20"

-- This is the condition of the alarm.  Are we cleared or are we alarming?
local Condition = "is%20alarming"

-- We can optionally play a tone at the beginning of the call to further alert the condition. 
-- We can play the alert as many times as we want.
AlertCount = "1"
AlertSound = "plectrontone"



local i = 0

-- Thermostat - Get the current temperature.
local SS_SID = "urn:upnp-org:serviceId:TemperatureSensor1"  
local CurrentTemp = luup.variable_get (SS_SID, "CurrentTemperature", deviceNo) or "nothing"


-- Iterate over phone numbers
for i, callnum in ipairs(phoneNumbers) do

--  Generate our link to place the call, substituting:
-- Alert sound, alert count, initial warning, alerting condition, and current temperature.
--  All this has to be URL encoded to properly pass to the asterisk box.

local Linky = "http://172.x.x.x/cgi-bin/call.pl?extension=" .. callnum .. "&alertsound=" .. AlertSound .."&alertcount=" .. AlertCount .. "&saytext=" .. initialWarning .. "Smoke%20and%20Carbon%20Monoxide%20detector%20" .. Condition .. ".%20and%20the%20indoor%20temperature%20is%20" .. CurrentTemp .. "%20degrees."


--  Fire off the URL.
     local status, result = luup.inet.wget(Linky, 5)
end

This is fantastic. I’m going to try this out as well, but a much simpler version that just trips the zwave sensor (the phone call alert is awesome though). I’ve seen these relays in a couple of places - Kidde and First Alert have their own branded ones too. I just couldn’t understand how to use the relay till now.

What I don’t understand is why the relay doesn’t work off battery backup? The alarm has battery backup. Does the relay portion of the alarm not draw power from its own internal battery?

These relays draw their power from the 100V line to engage the relay.
Otherwise there would be the potential for discharging the batteries in the alarms.

With another relay … you can supply 9Volts DC on the red/white wires and engage the alarm.

Sounds like a task for a cheap automotive relay.

Sounds like a task for a cheap automotive relay.[/quote]

I thought about trying to modify it, in fact you could probably use a simple transistor to “close” the contacts and use far less energy. But when I thought about it, without power vera is dead. So is my cable modem. So is my phone call server. So it might send out the zwave alarm, but since the vera is dead, it won’t see it.

Even if the vera wasn’t dead, my cable modem would be, so it coudn’t even email me.

So it seemed like a moot point. If I were going to engineer a more failproof system, I’d do it differently.

-G

[quote=“biggsworld, post:5, topic:175835”]I thought about trying to modify it, in fact you could probably use a simple transistor to “close” the contacts and use far less energy. But when I thought about it, without power vera is dead. So is my cable modem. So is my phone call server. So it might send out the zwave alarm, but since the vera is dead, it won’t see it.
Even if the vera wasn’t dead, my cable modem would be, so it coudn’t even email me.
So it seemed like a moot point. If I were going to engineer a more failproof system, I’d do it differently.
-G[/quote]
UPS?