---
title: "How we notice a sensor has died before it misleads us"
description: "The battery runs out quietly and a door sensor simply stops saying “open”. An automation in Home Assistant notifies you when an entity is unavailable or the battery is low."
canonical: "https://realhomeautomations.com/en/projects/detect-dead-sensors/"
language: en-US
updated: 2026-11-25T15:20:29+00:00
---

# How we notice a sensor has died before it misleads us

The battery runs out quietly and a door sensor simply stops saying “open”. An automation in Home Assistant notifies you when an entity is unavailable or the battery is low.

> Canonical HTML page: https://realhomeautomations.com/en/projects/detect-dead-sensors/

- **Difficulty:** Intermediate
- **Build time:** 30–60 minutes
- **Reading time:** 3 minutes

## Tools required

- Home Assistant (with Zigbee or another sensor integration)
- Battery sensors (doors, temperature, leaks that you already have)
- Phone with the Home Assistant app (for the notifications)


## What readers will learn

- To tell "no event" from "the sensor is dead"
- To catch an entity that has become unavailable
- To track a low battery in percent
- To get one summary list instead of dozens of notifications


## Skill requirements

- To find entities and attributes in Developer tools
- To paste YAML into an automation

A leak sensor stays dry for months. It is "calm" while its battery has run out. Silence is not proof that everything is fine. You have to tell "no event" from "the sensor can't be heard".

 ## What you will learn

 Three checks: the entity has become `unavailable`, the battery is low and (optionally) the sensor hasn't reported for a long time. And how to gather them into one notification.

 ## What you need

- A working Home Assistant with battery sensors.
- For Zigbee: the ZHA or Zigbee2MQTT integration. Many devices show the battery level as a separate entity.
- A phone with the Home Assistant app.

 Time: 30–60 minutes for setup. The real result comes after weeks, when some battery runs down.

 ## How it works

 Two signals catch most problems.

- **An unavailable entity.** ZHA marks a battery device as `unavailable` after 24 hours of silence. An automation with the trigger "unavailable for more than 2 hours" notifies you.
- **Low battery.** Devices that report it have an entity with `device_class: battery`. The trigger is a numeric threshold.

 Quiet sensors (a door that doesn't open) are not proof of a problem. That is why we don't look at how long ago the last event was, unless the integration shows "last seen".

 Simeon's checks: a weekly report on Sunday at 10:00 lists the batteries below 20% and the devices unavailable for more than an hour; a low-battery check runs twice a day at below 25%; and a leak sensor that is silent for 30 minutes sends a notification.

 ## Steps

- In **Developer tools → States** filter by `battery` and write down the entities. Also write down the entities of the sensors you want to monitor.
- Create a low battery automation. The threshold and entities are **examples**:

 ```
alias: Sensor low battery
mode: parallel
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.door_front_battery
      - sensor.leak_kitchen_battery
    below: 20
actions:
  - action: notify.mobile_app_your_phone
    data:
      title: Low battery
      message: >
        {{ trigger.to_state.name }} is at {{ trigger.to_state.state }}%.
```

- A second automation for unavailable entities:

 ```
alias: Sensor not reporting
mode: parallel
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.door_front
      - binary_sensor.leak_kitchen
    to: unavailable
    for: "02:00:00"
actions:
  - action: notify.mobile_app_your_phone
    data:
      title: Sensor not reporting
      message: "{{ trigger.to_state.name }} has been unavailable for 2 hours."
```

- Replace the entities and the name of the notification. You expect both automations to save without an error.
- If you have dozens of sensors, add a summary weekly check that lists all the `unavailable`, instead of a separate notification for each.

 ## Checking the result

- Temporarily raise the battery threshold above the current level: a notification should come.
- Take the battery out of a secondary sensor: after the set time a notification comes.
- Put the battery back and check that the entity returns to a normal state.

 ## If it doesn't work

- There is no notification → the entity doesn't become `unavailable`, but stays at its last value → use "last seen" if the integration provides it.
- Many notifications → the network has a problem and more devices drop at once → check the hub or adapter.
- The battery isn't reported → not every device shows it → the substitute is a replacement calendar.

 ## Limitations

- `unavailable` shows that the connection has dropped. The cause may be a weak signal or the hub, not necessarily a battery.
- A battery in percent is approximate. Some cells drop sharply at the end.
- There is no notification if Home Assistant isn't running.

 ## Sources and verification status

 Checked against the documentation on 22.11.2026.

- [Home Assistant: State trigger](https://www.home-assistant.io/docs/automation/trigger/#state-trigger)
- [Home Assistant: Numeric state trigger](https://www.home-assistant.io/docs/automation/trigger/#numeric-state-trigger)
- [Home Assistant: ZHA](https://www.home-assistant.io/integrations/zha/)