Build a Home Assistant CO Detector Integration for Smarter Warnings

Guy programming a CO Detector at a desk

Image generated byGemini

Carbon monoxide is odorless, invisible, and deadly. Standard alarms often detect it too late, and by then your HVAC system may have already pumped toxic air into every bedroom in the house.

A proper smart home setup should actively prevent a leak from spreading. This guide shows you how to build a Home Assistant CO detector integration that connects a Zigbee carbon monoxide sensor to your HVAC system, triggering an automatic shutdown the moment gas is detected.

You can finish the whole build in under an hour, and everything runs locally; no cloud servers needed. That means your safety automation keeps working even during a total internet outage.

Why Standard Alarms Fall Short

Accidental carbon monoxide exposure is a serious public health problem that’s getting worse. CO poisoning deaths rose 85.7% between 2012 and 2022. And over 100,000 ER visits each year are tied to accidental CO exposure.

The specific danger in modern homes stems from how your central HVAC system operates. If a furnace or attached garage leaks gas, the blower fan essentially becomes a distribution network, pushing poison into every room before a hallway alarm even registers the threat. Many people mistake early CO poisoning symptoms for the flu or simple fatigue, which makes proactive detection even more critical.

Manufacturers are stepping up with better retail solutions. Brands like X-Sense are releasing interconnected wireless alarms for remote alerts, and others are introducing combo devices using Matter over Thread for faster response times. But here’s the catch: none of these products physically stops your furnace from blowing toxic air through the house.

That’s where local Home Assistant setups shine. By interacting directly with your thermostat, a local automation can cut the blower motor within seconds of detection. No internet connection required. No third-party server in the loop. The table below breaks down how these approaches compare:

Feature Standard “dumb” detector Smart detector (e.g., Nest) Home Assistant + Zigbee
Local control No Cloud dependent Yes
Triggers HVAC shutdown No Rare / limited Yes (immediate)
No cloud dependency Yes No Yes
Battery life 10 years 1–2 years 2–5 years

What You’ll Need

Before writing any automations, you’ll need hardware that communicates over local protocols. This keeps your safety automation running without internet access. Here’s what to grab:

  • Home Assistant instance: The setup requires continuous, round-the-clock operation and can be deployed on hardware such as a dedicated mini PC, a Raspberry Pi, or a Home Assistant Yellow appliance.
  • Zigbee coordinator: A USB antenna dongle like the Sonoff Zigbee 3.0 USB Dongle Plus to receive sensor data locally.
  • Smart CO detector: A Zigbee-compatible unit like the CO-8ZBS, which uses an electrochemical sensor for accurate readings.
  • Smart thermostat or relay: A locally integrated thermostat (Ecobee, Nest via Matter) or a smart relay (like a Shelly unit) controlling your HVAC blower.

How to Build the HVAC Shutdown Automation

1. Pair the Detector via Zigbee2MQTT

Start by putting your Zigbee CO sensor into pairing mode. Most sensors require holding the setup button for about five seconds until an LED starts flashing. If you haven’t configured your local Zigbee network yet, check out this guide on setting up MQTT with Docker first.

Once the device enters pairing mode, open your Zigbee2MQTT dashboard and permit new devices to join. The software will automatically interview the sensor and assign it a unique identifier on your network.

2. Verify Sensor Entities

Before trusting this sensor with a safety automation, make sure it’s actually transmitting data. Head to the Devices dashboard in Home Assistant and find your newly added CO detector. Confirm that the binary_sensor.carbon_monoxide entity shows a status of “Clear” or “Off.” That’s the exact entity you’ll use as your automation trigger.

3. Write the YAML Automation

Now for the good part. You’re going to write an automation that reacts the instant gas is detected. This runs entirely on your local network, so a cloud outage won’t compromise your family’s safety.

The trigger watches the binary sensor for a state change from “off” to “on.” When it fires, the action calls climate.turn_off, commanding your thermostat to kill the blower motor immediately. Here’s the updated, compliant YAML:

alias: "Safety: CO Detected - HVAC Shutdown"
description: "Shuts down the HVAC system if carbon monoxide is detected locally."
trigger:
 - platform: state
   entity_id: binary_sensor.carbon_monoxide
   to: "on"
condition: []
action:
 - action: climate.turn_off
   target:
     entity_id: climate.home_thermostat
mode: single

4. Configure Critical Notifications

What good is an alert if your phone is on silent? Your system needs to bypass “Do Not Disturb” mode for life-safety events. Both the iOS and Android Home Assistant companion apps let you push critical alerts at maximum volume, overriding any silent settings.

For an extra layer of redundancy, you can also set up a Telegram bot for notifications. This way, multiple family members get the warning simultaneously, regardless of their phone settings.

Avoiding Critical Failures

Your safety automation is only as good as the battery powering your sensor. Set up a secondary automation that pings your phone when the detector’s battery drops below 15%. Zigbee devices report their battery levels directly to the coordinator, making it easy to track. Replacing the battery early keeps your primary safety trigger active year-round.

Placement matters too. Since carbon monoxide has a density slightly lower than that of ambient air and frequently hitches a ride on the thermal currents produced by furnace units, it spreads uniformly across a room as it drifts upward. Avoid placing detectors low to the ground. Instead, mount your detectors on the ceiling or high on a wall at eye level near sleeping areas for the most accurate readings.

Place secondary units near potential sources, such as attached garages or utility rooms with gas appliances. Proper placement ensures the sensor catches the gas before it hits dangerous levels in your breathing zone.

And one more thing: never treat your smart home setup as a replacement for traditional alarms. Keep your hardwired or 10-year sealed battery detectors in place. The Home Assistant integration manages your environment and sends remote alerts, but a loud, localized alarm is still what wakes sleeping residents. Using both layers together gives you the strongest safety net available.

Breathing Easier with Local Control

You’ve just taken your home safety well beyond a simple audible beep. Automatically shutting down the HVAC during a leak buys precious escape time by stopping the active spread of toxic air through your ductwork.

Test your new automation safely using the “Run Actions” button in Home Assistant’s automation dashboard. Never test by releasing actual gas near the sensor. Got a creative safety automation of your own? Share your setup in the comments below.

build-a-home-assistant-co-detector-integration-for-smarter-warnings

Leave a Reply

Your email address will not be published. Required fields are marked *