Security System Failures: No Internet, No Power, an Offline Sensor, a Low Battery
Security System Failures: No Internet, No Power, an Offline Sensor, a Low Battery
In Lessons 2 through 9, you built notifications, escalation, sensors, home modes, and a supporting alarm. The system knows what to do about flooding, an open door, or an intrusion. But what happens when the system itself stops working correctly: and you don't know it?
This lesson doesn't add a new intrusion or flood scenario. It adds a supervision layer: you monitor sensors, the internet, power, and integrations. A system failure is a security event too: just a different kind than water under the washer.
Plan on about 90 to 105 minutes. Start with a list of critical sensors. Then add offline and battery alerts.
The rule for this lesson
A security system is only as good as its weakest link.
An offline sensor, a low battery, and a dead internet connection aren't "technical noise": they're real risk.
A real-life problem: you think the door's closed: but the sensor isn't reporting
The front door contact sensor showed "closed" for months. In reality, it's been in an unavailable state for a week: the battery died, Zigbee dropped the connection, or the Wi-Fi bridge restarted overnight. The dashboard looks calm. The alarm won't trigger, because HA can't see the opening.
A second scenario: a storm, a power outage, and a router with no UPS goes down. Home Assistant on a server with a UPS is still running, the local siren will work: but push and SMS can't get out. Without internet monitoring, you assume "the system handled it," while the alert never left the house.
In Lesson 1 we flagged this problem in the failure-points table. In Lessons 4 through 9 you kept hearing "we'll come back to this in Lesson 10." Now we're closing that loop.
A system failure versus a real threat
| Event | What it means | How we respond |
|---|---|---|
| Flooding detected | A real risk of damage | The full security-alarm escalation |
A sensor is unavailable |
We don't know what's happening | A failure notification: no intrusion siren |
| Battery at 15% | The sensor will die soon | An informational alert: replace the battery |
| No internet | Push might not get out | An alert + relying on SMS / local response |
| No power | Part of the system is offline | A UPS, self-powered sensors, awareness of the limits |
unavailable doesn't mean "closed"
An entity in the unavailable or unknown state isn't telling you the door is safe. It's telling you: "I have no data." That's an important distinction for anyone reading the dashboard casually.
What's actually the risk
Ignoring offline sensors: you trust the dashboard, even though a sensor hasn't reported in a week.
A failure alert = a full alarm: every low battery sets off the siren: the household stops responding.
No failure testing: you've never checked what happens when the internet or power goes out.
A router with no UPS: HA is running, but push has no way to leave the house.
Confusing HA with a certified detector: a smoke detector with its own siren still works when HA goes down: but you lose the extra layer of notification.
Entities you already have
This lesson combines entities from earlier lessons into one supervision list. Examples below: swap in your own.
| Entity | Source | Why it's critical |
|---|---|---|
binary_sensor.internet_available |
Lesson 3: ping | You know whether push can get out |
group.flood_sensors |
Lesson 4 | Without them, you can't detect water |
group.critical_openings |
Lesson 6 | Doors, windows, the gate |
group.alarm_sensors |
Lesson 9 | Supporting-alarm zones |
sensor.front_door_battery |
Sensor integration | Warns of an offline sensor before it happens |
Monitoring helpers
Add these to your helpers file:
input_boolean:
failure_monitoring_enabled:
name: "Failure monitoring enabled"
icon: mdi:heart-pulse
system_failure_test:
name: "System failure test"
icon: mdi:bug-check
input_number:
battery_alert_threshold:
name: "Battery alert threshold"
min: 5
max: 40
step: 5
initial: 20
unit_of_measurement: "%"
icon: mdi:battery-alert
failure_monitoring_enabled is the kill switch for the whole layer: handy when swapping batteries or restarting Zigbee. You set battery_alert_threshold from the dashboard; in the YAML below, the threshold is read from the input_number.battery_alert_threshold helper.
The critical sensors group
We combine the sensors whose downtime hurts the most into one place. Don't dump everything in the house here: only what your safety actually depends on.
group:
critical_sensors:
name: "Critical sensors"
entities:
- group.flood_sensors
- group.critical_openings
- group.alarm_sensors
- binary_sensor.hallway_smoke
- binary_sensor.boiler_room_co
If you don't have smoke detectors in HA: remove those entities from the group. The group should be short and meaningful, not a complete copy of the whole house.
A template sensor: how many sensors are offline
template:
- sensor:
- name: "Critical sensors offline"
unique_id: critical_sensors_offline
icon: mdi:access-point-off
state: >
{% set ns = namespace(count=0) %}
{% for e in expand('group.critical_sensors') %}
{% if e.state in ['unavailable', 'unknown'] %}
{% set ns.count = ns.count + 1 %}
{% endif %}
{% endfor %}
{{ ns.count }}
On the dashboard, you immediately see the number of problems. In Lesson 11, we'll build a security-status card out of this.
A failure ≠ an intrusion alarm
We send offline, battery, and internet alerts through script.notify_household: a plain push. We don't call the full security-alarm scripts, because this isn't a fire or an intrusion. Doing otherwise kills trust in the system.
Automation 1: no internet
Without internet, a plain push isn't a reliable channel outside the house. First, a persistent local notification and a local signal; SMS through an independent modem if you have one; push only as a secondary channel (e.g. Local Push at home).
You're using binary_sensor.internet_available from Lesson 3. When the internet drops: you get an alert. When it comes back: you get one too, so you know push is working again.
automation:
- alias: "Failure: no internet"
description: "Notifies when the ping stops getting through"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.internet_available
to: "off"
for:
minutes: 2
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: persistent_notification.create
continue_on_error: true
data:
title: "FAILURE: no internet"
message: "Push outside the house may not get through. Check locally and Plan B."
- action: script.turn_on
continue_on_error: true
target:
entity_id: script.security_alarm_local
data:
variables:
tts_message: "Attention. No internet at home. Check the connection."
- choose:
- conditions:
- condition: state
entity_id: input_boolean.alarm_sms_enabled
state: "on"
sequence:
- action: script.alarm_sms
continue_on_error: true
data:
phone_number: "+15550123456"
message: "FAILURE: no internet at home"
- action: script.notify_household
continue_on_error: true
data:
title: "FAILURE: no internet at home"
message: >
Push outside the house may not work. Check the router, the UPS, and the SMS channel from Lesson 3.
- alias: "Failure: internet restored"
description: "Confirms the internet connection has come back"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.internet_available
to: "on"
for:
minutes: 1
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: script.notify_household
data:
title: "Internet restored"
message: "The internet connection at home is working again."
for: 2 minutes filters out brief fluctuations after a router restart. Without internet, this push might not reach your phone outside the house: hence the importance of SMS and the local siren from Lesson 3.
If you have a local SMS channel from Lesson 3, an internet outage is one of the few cases where SMS makes particular sense. Push without internet might never leave the house, but a local LTE modem or router with SMS can still send a short message.
Automation 2: a critical sensor goes offline
automation:
- alias: "Failure: critical sensor offline"
description: "Alerts when an entity in the critical group stops reporting"
mode: queued
max: 5
triggers:
- trigger: state
entity_id:
- binary_sensor.front_door
- binary_sensor.kitchen_flood
- binary_sensor.bathroom_flood
- binary_sensor.living_room_window
- binary_sensor.hallway_motion
to: "unavailable"
for:
minutes: 5
- trigger: state
entity_id:
- binary_sensor.front_door
- binary_sensor.kitchen_flood
- binary_sensor.bathroom_flood
- binary_sensor.living_room_window
- binary_sensor.hallway_motion
to: "unknown"
for:
minutes: 5
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: script.notify_household
data:
title: "FAILURE: sensor offline"
message: >
{{ state_attr(trigger.entity_id, 'friendly_name') or trigger.entity_id }}
is in state {{ trigger.to_state.state }}.
Check the battery, Zigbee range, and the bridge.
The entity list in the trigger is an example: add your own from the critical_sensors group. for: 5 minutes guards against an alert triggered by a brief HA restart. mode: queued won't drop alerts when several sensors fail at once.
Automation 3: a sensor's battery is low
Many Zigbee and Z-Wave sensors report battery level as a separate sensor.*_battery entity, or as a battery_level attribute. Check Developer Tools to see what yours is called.
automation:
- alias: "Failure: low sensor battery"
description: "Alerts before a battery is fully drained"
mode: single
triggers:
- trigger: numeric_state
entity_id:
- sensor.front_door_battery
- sensor.living_room_window_battery
- sensor.kitchen_flood_sensor_battery
below: input_number.battery_alert_threshold
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: script.notify_household
data:
title: "FAILURE: low sensor battery"
message: >
{{ state_attr(trigger.entity_id, 'friendly_name') or trigger.entity_id }}:
{{ states(trigger.entity_id) }}%.
Replace the battery before the sensor stops reporting.
The below: input_number.battery_alert_threshold threshold comes from the dashboard helper. If a sensor has no battery entity: skip it in this automation and rely on unavailable monitoring instead.
We're showing the battery_alert_threshold helper now because it's worth having it on the dashboard and choosing the threshold deliberately. Changing the threshold on the dashboard changes the automation's behavior: with no YAML editing.
Optional: a daily reminder about weak batteries
A threshold-crossing alert is good, but it isn't always enough. If a battery was already low before Home Assistant restarted, you might not see a new crossing of the threshold. That's why a short daily reminder is worth having, if any critical sensor still has a low battery level.
automation:
- alias: "Failure: daily reminder about weak batteries"
description: "Once a day, reminds you of critical sensors with a low battery"
mode: single
triggers:
- trigger: time
at: "09:00:00"
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
- condition: template
value_template: >
{% set batteries = [
'sensor.front_door_battery',
'sensor.living_room_window_battery',
'sensor.kitchen_flood_sensor_battery'
] %}
{{ batteries
| select('is_state', 'unknown')
| list
| count == 0
and batteries
| map('states')
| map('int', default=100)
| select('lt', 20)
| list
| count > 0 }}
actions:
- action: script.notify_household
data:
title: "Reminder: low battery"
message: >
At least one critical sensor has a battery under 20%.
Check the battery entities on the security dashboard and replace it before you lose connectivity.
Don't turn unavailable into 100% via map('int', default=100): that hides the failure. Detect a low level, an unreachable battery sensor, and a missing battery entity as separate cases.
This automation is optional. It's not a requirement for finishing the lesson: but in practice it significantly improves the usefulness of battery monitoring.
Automation 4: the Zigbee coordinator goes offline
If you're using Zigbee through a USB coordinator or a bridge: its entity can go unavailable. When that happens, a lot of sensors stop reporting at once. That should be one alert, not ten separate ones.
automation:
- alias: "Failure: Zigbee coordinator offline"
description: "Alerts when the Zigbee bridge stops responding"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.zigbee_bridge_available
to: "off"
for:
minutes: 3
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: script.notify_household
data:
title: "FAILURE: Zigbee offline"
message: >
The Zigbee bridge isn't responding. Wireless sensors may not report.
Check the USB connection, power, and restart the integration.
The binary_sensor.zigbee_bridge_available entity is an example: yours might be binary_sensor.slzb_06p7_ezsp or the ZHA integration's state. If you don't use Zigbee, skip this automation. Don't assume every user will find a ready-made binary_sensor for their bridge: use coordinator availability, integration status, uptime, an offline-device count, or a USB problem, whichever fits your setup.
Where to find a Zigbee bridge entity
Not every coordinator has a ready-made binary_sensor.zigbee_bridge_available entity. For a network coordinator, you can ping its IP address. For a USB coordinator, you can monitor the integration's status, the count of offline devices, or skip this automation and focus on individual sensor alerts.
Automation 5: a power outage (optional)
If you have a UPS integrated with HA, or a voltage sensor: you can detect a power outage. Without one, you're relying on HA and the router simply going unresponsive: and then no alert will get out at all. That limitation is worth knowing about.
A UPS isn't a luxury for security
At minimum: a UPS for the router and the HA server. Without the router, push won't get out. Without HA, no automation will run. Certified smoke and CO detectors should still have their own power and siren: independent of HA.
automation:
- alias: "Failure: power outage"
description: "Alerts when the UPS reports running on battery"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.ups_on_battery
to: "on"
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: script.notify_household
data:
title: "FAILURE: power outage at home"
message: >
The UPS has taken over power. Check the runtime left on the router and HA server batteries.
Push may stop working once the router goes down.
Don't have a UPS integrated with HA? Keep this automation as a template for later, and add "buy a UPS for the router" to your security plan.
Automation 6: a system-failure test
The test checks whether the failure-notification channel works. It doesn't simulate a power outage: it just sends a sample alert.
automation:
- alias: "Failure: monitoring test"
description: "Sends a test failure alert"
mode: single
triggers:
- trigger: state
entity_id: input_boolean.system_failure_test
to: "on"
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "on"
actions:
- action: script.notify_household
data:
title: "TEST: failure monitoring"
message: >
This is a test of the failure layer. Offline sensors: {{ states('sensor.critical_sensors_offline') }}.
Internet: {{ states('binary_sensor.internet_available') }}.
- delay:
seconds: 3
- action: input_boolean.turn_off
target:
entity_id: input_boolean.system_failure_test
Automation 7: reset the test when monitoring is disabled
automation:
- alias: "Failure: reset test when monitoring is disabled"
description: "Turns off the test helper if monitoring is off"
mode: single
triggers:
- trigger: state
entity_id: input_boolean.system_failure_test
to: "on"
conditions:
- condition: state
entity_id: input_boolean.failure_monitoring_enabled
state: "off"
actions:
- delay:
seconds: 2
- action: input_boolean.turn_off
target:
entity_id: input_boolean.system_failure_test
- action: script.notify_household
data:
title: "Failure test canceled"
message: "Failure monitoring is disabled. Turn it on if you want to run a test."
The same pattern as in Lessons 6 through 9: a test can't stay stuck on on when the conditions block it.
An audit after HA starts up
A to: unavailable trigger won't fire if the entity was already unavailable at startup. You need a startup audit and a periodic one too.
automation:
- alias: "Failure: sensor audit after HA startup"
mode: single
triggers:
- trigger: homeassistant
event: start
actions:
- delay:
minutes: 3
- if:
- condition: numeric_state
entity_id: sensor.critical_sensors_offline
above: 0
then:
- action: script.notify_household
continue_on_error: true
data:
title: "FAILURE: sensors offline after HA restart"
message: >
After Home Assistant started, {{ states('sensor.critical_sensors_offline') }}
critical sensors were found unavailable.
The trigger fires on a state change
The offline automation runs when an entity switches to unavailable or unknown. If you turn off monitoring, wait for a sensor to fail, and only then turn monitoring back on, the alert might not fire, because the state already changed earlier.
Monthly test: a checklist
Automations don't replace a regular review. Once a month: say, the first Sunday: go through the list. Log the date in a notebook or calendar.
1. Turn on failure_monitoring_enabled.
2. Click system_failure_test. A TEST push should arrive with the offline count and internet status.
3. Turn off monitoring and click the test again. The helper should return to off with a cancellation message.
4. Turn monitoring back on. Disconnect one test sensor's battery, or cut its power for over 5 minutes. The offline alert should appear only after the delay set in for:.
5. During the day, unplug the router's WAN cable for at least 3 minutes. Check the no-internet alert in the HA log.
6. Check the batteries of your critical sensors on the dashboard.
7. Remind yourself about the test from Lesson 2 (push) and Lesson 3 (escalation / SMS).
8. Optional: one drop of water on a flood sensor: that's the response test from Lesson 4, not the system-failure test.
9. Confirm that failure alerts don't trigger the full security-alarm scripts.
Testing no internet: carefully
The no-internet alert might not reach your phone outside the house: because... there's no internet. Run the test while you're home on Wi-Fi with HA, or check the log inside Home Assistant. That's not a flaw in this lesson: it's just physics.
Dashboard: what to show
sensor.critical_sensors_offline: the number of problems, at a glance
binary_sensor.internet_available: internet status
The critical_sensors group: a list of entities with their state
The failure_monitoring_enabled and system_failure_test toggles
The battery entities for your critical sensors
Common mistakes
A failure = a full alarm: a low battery sets off the siren: use a plain push instead.
Too short a for: an alert on every HA restart: extend the offline delay to 5 minutes.
Testing offline with monitoring disabled: the sensor fails, then you enable monitoring: the trigger won't fire again, since the state didn't change a second time.
Too big a group: you're monitoring 40 entities: alerts every hour. Keep it to the critical ones.
A test with no reset: the test helper stays stuck on on: add Automation 7.
Swapping a battery without disabling monitoring: a false offline alert: turn off failure_monitoring_enabled during service work.
What not to do
Don't pretend HA monitoring replaces certified smoke and CO detectors.
Don't ignore the unavailable state: it doesn't mean "everything's fine."
Don't test a power cutoff at night with no preparation: the router and HA might not come back on their own.
Don't rely solely on push during an internet outage: SMS and the local siren from Lesson 3 still matter.
Practical assignment
☐ Add the failure_monitoring_enabled, system_failure_test, and battery_alert_threshold helpers.
☐ Create the critical_sensors group and the critical_sensors_offline sensor.
☐ Paste in Automations 1 through 7. Skip Zigbee and UPS if you don't have them. Optionally add the daily battery reminder.
☐ Test the offline alert on one sensor, and the test reset with monitoring disabled.
☐ Schedule the monthly test on your calendar and run through this lesson's checklist.
☐ Add the offline counter, internet status, and the failure-test button to the dashboard.
Key takeaways
unavailable ≠ safe: missing data is risk, not reassurance.
A failure is a plain push, not the full alarm escalation.
The internet, power, and Zigbee are failure points just as important as the sensors.
The monthly test is part of security: not an option for advanced users only.
Monitoring has a kill switch: failure_monitoring_enabled saves you during service work and battery swaps.
What's next
In Lesson 11, we'll bring everything together on a single security dashboard: home status, alerts, home mode, the alarm, openings, offline sensors, and test buttons. Instead of hopping between cards: one screen that answers "is the house secure."
After this lesson, your system doesn't just respond to threats. It also knows when it stops working correctly itself: and tells you before an intrusion or a flood does.