CO₂ - Progressive Alerts (multi-device, area-aware, cooldown, “only-if-home” toggle)
GitHub Link Click Here for Issues
TL;DR
A robust CO₂ alert blueprint that:
- Triggers on Warn / Alert / Critical thresholds (each with its own
for:duration) - Notifies multiple Companion App devices and/or any
notify.*entities - Optional “only if devices are at home” gate (default on)
- Adds the sensor’s Area to the notification title (if defined)
- Has a cooldown to prevent spam
- Emits rich Logbook diagnostics for troubleshooting
- Uses
notify.send_messagewhere available and falls back to legacynotify.mobile_app_<slug>for phones
What it does
- Monitors a CO₂ sensor (device class
carbon_dioxide). - Sends progressive notifications:
- WARN — default
1000 ppm,for: 5 min - ALERT — default
1400 ppm,for: 3 min - CRITICAL — default
2000 ppm,for: 1 min
- WARN — default
- Title includes the Area of the CO₂ sensor: e.g.,
Air quality — Kitchen. - Cooldown (default 15 min) between any two notifications.
- Mobile notifications go to selected Companion App devices:
- If “Notify only if devices are at home” is enabled (default), the blueprint resolves each device’s
device_tracker.*and sends only when it’shome. - If disabled, it sends regardless of presence.
- If “Notify only if devices are at home” is enabled (default), the blueprint resolves each device’s
- Also supports additional
notify.*entities (notify groups, Telegram, etc.).
Inputs
| Input | Type | Default | Notes |
|---|---|---|---|
| CO₂ sensor | sensor (device_class: carbon_dioxide) |
— | Source for ppm |
| Mobile app devices | list of device (integration: mobile_app) |
[] |
One or more phones/mac with Companion App |
| Notify entities (optional) | list of entity (domain: notify) |
[] |
Any notify.* targets (groups, Telegram, etc.) |
| Notify only if devices are at home | boolean |
true |
Presence gate using each device’s device_tracker |
| Warn threshold / for | number / minutes |
1000 / 5 |
First level |
| Alert threshold / for | number / minutes |
1400 / 3 |
Second level |
| Critical threshold / for | number / minutes |
2000 / 1 |
Third level |
| Cooldown (minutes) | number |
15 |
Minimum gap between any two sends |
| Debug logging to Logbook | boolean |
false |
Verbose Logbook traces everywhere |
How notifications are sent
- If your target exposes
notify.*entities, the blueprint usesnotify.send_messagewithtarget.entity_id. - For Companion App phones, if no
notify.*entity exists on the device, it falls back to legacy *
notify.mobile_app_<slug>* (slug derived from the device’sdevice_trackerobject_id).
This avoids templatingdevice_id(which device actions don’t support inside loops) and works reliably with multiple
devices.
Logbook diagnostics
When Debug is on, each run logs:
- Trigger level, ppm, thresholds, Area
- Cooldown timing (
last_triggered,seconds_since, decision) - Per device: found
device_tracker, state, anynotify.*on the device, computed legacy service name - Which path was used to send (entity vs legacy) or why it was skipped
This makes it easy to see exactly why a device did or didn’t get a push.
Install
- Open Settings → Automations & Scenes → Blueprints.
- Import Blueprint and paste the Gist URL above.
- Create a new automation from this blueprint:
- Pick your CO₂ sensor.
- Select your phones (Companion App devices).
- (Optional) select extra
notify.*entities. - Adjust thresholds/durations/cooldown if needed.
Tips & troubleshooting
-
No notification on a phone?
Check the Logbook entry. Common causes:- Presence gate: device not
home(toggle “Notify only if devices are at home” off to test). - No
device_tracker.*on that device (Companion App presence/permissions). - The device doesn’t expose a
notify.*entity; fallback usesnotify.mobile_app_<tracker_slug>. The log shows the
exact name used.
- Presence gate: device not
-
Want different thresholds per room?
Create multiple automations from this blueprint, one per sensor/room. -
Too chatty?
Increasefor:times and/orcooldown_minutes. -
Noisy logs?
Turn off Debug logging to Logbook in the inputs.
Changelog
- v1.0 – Progressive levels, multi-device, area-aware title, presence gate (toggle), cooldown, Logbook diagnostics,
hybrid notify (entity + legacy mobile fallback).This text will be hidden