3 min read

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.

Level
Intermediate
Active time
30–60 minutes
Home Assistant required
Yes

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.

  1. 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.
  2. 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

  1. In Developer tools → States filter by battery and write down the entities. Also write down the entities of the sensors you want to monitor.
  2. 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 }}%.
  1. 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."
  1. Replace the entities and the name of the notification. You expect both automations to save without an error.
  2. 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.

Need a hand?

We can set up and install everything in this project. In some regions we install it ourselves — ask us.

Contact us

Related projects

Added to cart

Real Home Automations

Sign in to your account

With a code sent to your email

Continue with Google
or

By continuing, you accept the Terms and Conditions and the Privacy Policy.