I had the same problem with the first alert detector, solution was to remove the alarm from the network and then add it through HA. From my understanding, the alarm only sends out it’s identifying information once so if you add it with OZWCP you won’t see it next time you launch HA. A restart of HA may also be needed after adding the alarm to get the entity IDs updated.
For the alarm types, 1 is fire alarm, 2 is CO, 12 is the test button, and 13 is stand by, the value seems to normally be 255, if you press the test button the type will change to 12, after the test is over the value will change to 0. After some time, the type changes back to 13 and the value changes to 255. Note: I haven’t confirmed 1 is fire and 2 is CO, I just read that on another forum, I have my alarm go off if the type ever isn’t 13 just to be safe.
The first_alert_zcombo_smoke_and_carbon_monoxide_detector_alarm_type_4 string will vary based on the node ID given by your zwave network. I had to wait some time and/or restart Home Assistant before I got an entity name that included “first_alert_zcombo_smoke_and_carbon_monoxide_detector”. When I first initially included the alarm on the network it just had some generic sensor alarm entity name.
Are you sure it’s not supposed to be the alarm_report that ha the values, 1, 2, 12, and 13? I tested my alarm and the alarm_report is what changed to 12. The alarm_type changed to 255.
Mine was different again - alarm_level goes to 255 when there is an alarm and alarm_type gives the type. After the alarm is over, alarm_level resets to 255, but alarm_type stays at the last value. It also seems possible for alarm_level to go to 255 and alarm_type to go to 13 to represent an idle state. I built this sensor as a result - but I think the lesson here is test the device and see what you actually get!
I also wrote a simple AppDaemon App to monitor it, send a notification and turn lights on when it goes off:
import appdaemon.appapi as appapi
#
# App to send notification when a sensor changes state
#
# Args:
#
# sensor: sensor to monitor e.g. sensor.upstairs_smoke
# idle_state - normal state of sensor e.g. Idle
# turn_on - scene or device to activate when sensor changes e.g. scene.house_bright
# Release Notes
#
# Version 1.0:
# Initial Version
class SensorNotification(appapi.AppDaemon):
def initialize(self):
if "sensor" in self.args:
for sensor in self.split_device_list(self.args["sensor"]):
self.listen_state(self.state_change, sensor)
def state_change(self, entity, attribute, old, new, kwargs):
self.log("{} is in state {}".format(self.friendly_name(entity), new))
self.notify("{} is in state {}".format(self.friendly_name(entity), new), name="ios")
if new != self.args["idle_state"] and "turn_on" in self.args:
self.turn_on(self.args["turn_on"])
And a final point - I bought 1 of these then another 2. The first one fought me with the pairing until I figured it out, the second 2 were flawless when I had the exact sequence down - now very happy with these.
The sequence I used for ZWave pairing was exactly as follows:
Using Open ZWave Control Panel, activate “Add Device”
Only then, hold the test button and close the battery door, wait for the beep, release the button
That’s it - OZWCP will find the device and fill in all details, command classes etc.
Don’t power the device on before pairing, don;t change the order of the above and it should work fine.
Has anyone actually observed the alarm type for smoke or CO? I do get 13 for a test, but have not seen it be a 1 or 2 for smoke or CO yet. Need to do some kind of test I guess.
@aimc I took your awesome template and app and put it to work tonight. But I also added tts with it for my sonos. I did this in SmartThings with the webcore component to speak announcements for my smoke alarms. Worked great for my kiddos. I have this one setup to fire off the initial announcement and then it will repeat itself every 30 seconds as long as the condition remains. Thank you.
import appdaemon.plugins.hass.hassapi as hass
#
# App to send notification when a sensor changes state
#
# Args:
#
# sensor: sensor to monitor e.g. sensor.upstairs_smoke
# idle_state - normal state of sensor e.g. Idle
# turn_on - scene or device to activate when sensor changes e.g. scene.house_bright
# Release Notes
#
# Version 1.0:
# Initial Version
class SensorNotification(hass.Hass):
def initialize(self):
if "sensor" in self.args:
for sensor in self.split_device_list(self.args["sensor"]):
self.listen_state(self.state_change, sensor)
self.media_player = 'group.speakers'
def state_change(self, entity, attribute, old, new, kwargs):
self.log("{} is in state {}".format(self.friendly_name(entity), new))
#self.notify("{} is in state {}".format(self.friendly_name(entity), new), name="ios")
if new != self.args["idle_state"] and "turn_on" in self.args:
self.turn_on(self.args["turn_on"])
if new == "Fire":
while new == "Fire":
self.fire_announcement(deviceID=entity)
self.fire_handle = self.run_in(self.fire_announcement, 30, deviceID=entity)
else:
self.cancel_timer(self.fire_handle)
if new == "CO2":
while new == "CO2":
self.co2_announcement(deviceID=entity)
self.co2_handle = self.run_in(self.co2_announcement, 30, deviceID=entity
else:
self.cancel_timer(self.fire_handle)
def fire_announcement(self,kwargs):
friendly_name = self.get_state(kwargs['deviceID'], attribute='friendly_name')
message = "The {} has detected smoke. Please exit the house immediately through the safest path." .format(friendly_name)
self.call_service("media_player/volume_set", entity_id=self.media_player, volume_level = 100)
self.call_service("tts/google_say", entity_id=self.media_player, message=message)
def co2_announcement(self,kwargs):
friendly_name = self.get_state(kwargs['deviceID'], attribute='friendly_name')
message = "The {} has detected carbon monoxide. Please exit the house immediately through the safest path." .format(friendly_name)
self.call_service("media_player/volume_set", entity_id=self.media_player, volume_level = 100)
self.call_service("tts/google_say", entity_id=self.media_player, message=message)
edit: I commented out the notify for the moment while I’m still figuring out which notification platform I want to use. I’m probably also going to do a web call with IFTTT to call my cell phone and my wifes if we’re not home.
So I cleaned up my code a good bit for anyone who would like to use this full credit goes to @aimc since I took his and just started adding to it. It will be available from this point forward here
EDIT: Sorry moved my repo to my own internal git server. But here is the code
import appdaemon.plugins.hass.hassapi as hass
import time
import datetime
#
# App to send notification when a sensor changes state
#
# Args:
#
# sensor: sensor to monitor e.g. sensor.upstairs_smoke
# idle_state - normal state of sensor e.g. Idle
# turn_on - scene or device to activate when sensor changes e.g. scene.house_bright
# Release Notes
#
# Version 1.0:
# Initial Version
class SensorNotification(hass.Hass):
def initialize(self):
if "sensor" in self.args:
for sensor in self.args["sensor"]:
self.listen_state(self.state_change, sensor)
self.media_player = 'group.speakers'
self.alexa = 'group.alexa'
def state_change(self, entity, attribute, old, new, kwargs):
self.log("{} is in state {}".format(self.friendly_name(entity), new))
testing = False
if new == "Fire":
self.log("Announcing there is a fire")
message_text = "The {} has detected smoke. Please exit the house immediately through the safest path." .format(self.friendly_name(entity))
elif new == "CO":
self.log("Announcing there is CO")
message_text = "The {} has detected carbon monoxide. Please exit the house immediately through the safest path." .format(self.friendly_name(entity))
elif new == "Testing":
testing = True
self.log("Announcing that we're testing")
message_text = "The {} has detected test mode. There is no need for you to panic this is only a test." .format(self.friendly_name(entity))
elif new == "Idle" and old != "Idle":
self.log("The {} has gone back to Idle".format(self.friendly_name(entity), new))
self.cancel_timer(self.timer)
else:
self.log("I got an unknown state")
return
starttime = datetime.datetime.now() + datetime.timedelta(seconds=1)
self.timer = self.run_every(self.announcement_cb,starttime,15, message_text=message_text,testing=testing)
def announcement_cb(self,kwargs):
self.call_service("media_player/volume_set", entity_id=self.media_player, volume_level = 100)
self.call_service("tts/google_say", entity_id=self.media_player, message=kwargs["message_text"])
self.call_service("media_player/alexa_tts", entity_id=self.alexa, message=kwargs["message_text"])
if not kwargs["testing"]:
self.call_service("notify/hangouts", message=kwargs["message_text"])
self.call_service("notify/discord", message=kwargs["message_text"], target="ACCOUNTID")
for light in self.args["turn_on"]:
self.turn_on(light)
Just had a thought and wondering if anyone has tried it. Can you set the state of the other alarms to match the state of the alarm that is going off to force them to activate? Kinda like how those alarms are linked to each other so if one goes off the rest go off? Would need to do some thought into this if you can, but I’m assuming since they sleep most of the time it’d be hard to get a command to them until they woke up but hopefully by then it would be a moot point. I guess you could lower the wake up from 3600 to like 300 but that doesn’t sound like a good idea for battery life.
No, this would not work. Changing the state in HA does not change the state of the device. In order to make the smoke alarm go off the device would need to accept such a command and unfortunately it does not.
I was given the opportunity to discover a new state for these at 6am today when one of them started chirping 5 times in a row every minute.
According to the zcombo manual, 5 chirps means End of Life. It reported as Level = 255 and Type = 14 in HA, so I’ve updated my template sensors accordingly.
I also see in the manual there is a Malfunction alert with 3 chirps every minute. Since we now know 12-14, I’m going to speculate that will report as type 15. I’ll update if it’s ever confirmed.
It was way past due for me (in the U.S.) to replace my very old AC wired Smoke detectors and I also needed to update to code by adding detectors (battery operated) to all the bedrooms.
I choose two First Alert, models for this project:
I. Smoke and Carbon Monoxide Detector - Battery Powered
Model 1044807 (aka ZCombo - 2nd gen).
ZWave+ Smart Start
2 AA batteries
Sensor Type:
Electrochemical (CO), Photoelectric (Smoke)
Here are some of the various things you’ll find on the HA Device Page
Those items in yellow mean they are not enabled in HA
I have built an automation that makes use of the “Smoke detected” and the “Carbon monoxide detected” binary sensors. Unfortunately, hitting the “test” button on the First Alert does not change the state of these sensors to test out the automation (but FYI, it does change the state of the “Smoke alarm test” sensor).
II. Smoke and CO AC Wired with Interconnect. Connected to Zooz ZEN55
ZWave+/LR device Smart Start (connected via Aeotec Gen5+).
Connects to the First Alert Interconnect Bus and monitors it for Smoke/CO detection. It can distinguish between Smoke and CO being output on the Interconnect Bus.
Here are some of the items that show up on the HA Device Page:
I have built automations for the “Carbon monoxide detected” and “Smoke detected” binary sensors. Fortunately I can test this automation. When pressing the “test” button on the Smoke/CO detector, it activates the interconnect bus, once for smoke, once for CO, and the ZEN55 picks it up and activates the HA binary sensors.