Zigbee Motion Sensor Stuck On? A 3-Layer Freeze Watchdog for Home Assistant

Zigbee Motion Sensor Stuck On? A 3-Layer Freeze Watchdog for Home Assistant. AutoMatter

Every installer has met this one: a wireless motion sensor reports motion, then never reports that it stopped. The hallway light stays on all night, or the basement fan never shuts off. A Home Assistant community member has shared a project aimed squarely at that problem, and it is worth a look if you run Zigbee sensors that drive lighting.

What was shared

The project is a GitHub repository, announced in a Share your Projects post on November 5. The author calls it field-tested. It is a brand new repository with no stars or forks yet, so treat that as the author’s claim, and we have not run it ourselves.

It has two halves:

  • Zigbee version: Home Assistant automations for Zigbee motion and door contact sensors, written for ZHA or Zigbee2MQTT, aimed at rooms like kitchens and basements.
  • ESPHome version: ESP8266/ESP32 configs for rooms with several presence zones (the example is a bathroom with main, shower and toilet sensors), where the timing loops run on the microcontroller itself.

How the 3-layer check works

The automation counts how many lighting cycles finish with the main sensor still reading on, and judges the sensor by signs of life:

  • Natural reset: the sensor goes from on to off by itself, and the failure counter returns to zero.
  • Activity-driven reset: a second zone trips while the main sensor is active, such as a door opening. That counts as proof of a person, so the sensor is treated as healthy.
  • Forced reset: if everything else is quiet and the sensor stays on for a set number of cycles, the automation decides it is frozen and pushes an off state with a small Home Assistant Python script.

The author suggests starting with a low threshold (the example is 5 cycles) to watch recovery happen, then raising it for daily use.

Lights that survive a Home Assistant outage

The ESPHome modules are built so physical switches drive the relays directly, with hardware debounce. If the Home Assistant API drops, the module falls back to a local timer. The config sets reboot_timeout: 0s so the chip does not reboot-loop when it loses the network, and a soft watchdog power-cycles the Wi-Fi radio to reconnect. It also calculates a seasonal solar offset on the node, roughly +8 degrees in winter and +3 in summer.

What it means for an installed system

  • ZHA users, read the README note first. The author warns that the Python state override can leave some sensors in a deep-sleep state under recent Home Assistant releases. The suggested fix is a native ZHA cluster attribute action instead. It means editing one block per sensor and supplying that sensor’s own address, so test on one room before rolling it out.
  • A forced reset hides the fault; it does not fix it. A sensor that freezes regularly may have a weak battery, a poor mesh path or interference. Check those first. Zigbee shares 2.4 GHz with Wi-Fi, and the usual advice is a shielded USB 2.0 extension for the coordinator, away from other gear.
  • Avoid false triggers. A person sitting still in a room with no second zone could look like a freeze. The author’s design leans on auxiliary sensors for that, so rooms with only one sensor deserve a higher threshold.
  • Back up first. The Python script route changes state behind the integration’s back. Snapshot your configuration before trying it.

Where we land

As of today Zigbee is the more mature option in Home Assistant: a big proven catalogue, fully local, very low power. Matter is the industry’s direction and wins on working across ecosystems, but it is younger. If your Zigbee sensors work, keep them until they die. This project is a cheap way to cope with the occasional stuck sensor, and nothing in it suggests replacing hardware. We would not call it a substitute for fixing a sensor that freezes often.

Sources