First Alert Z-Wave Smoke / Carbon Monoxide Detectors don't show up in Home-Assistant

@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.

1 Like

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)
2 Likes

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.

1 Like

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.

3 Likes

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

  • SMICO100-AC Interconnect Hardwire 2-in-1 (Meets Newer Standards)

  • Model: 1046874 This is not a ZWave device. But the Zooz Zen55 is

  • Smoke and CO Alarm with Battery Backup

  • Sensor Type: Ionization (Smoke), Electrochemical (CO)

  • 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.

Hope someone finds this useful. Best Regards.

1 Like