I’m trying to implement a simple motion-activated light in my cellar using Zigbee motion sensors and a Sonoff ZBMINI. All devices have been discovered in ZigBee2MQTT, using a Sonoff Zigbee 3.0 USB Dongle Plus as coordinator. This setup works well, also with other sensors (smart sockets, lights, presence, temperature, etc.)
My problem is that both motion sensors I’m trying out frequently drop out of the ZigBee network but continue to show up in Zigbee2MQTT with the state “detected”. I’d like to first tackle the “state” problem before fixing the “dropping out” issue.
I use both a Sonoff SNZB-03 and a TuYa IH012-RT01
The state “detected” seems to be the default state. After restarting Home Assistant, the sensor first shows up as “unknown” and then goes directly to “detected”, despite ZB@MQTT showing that it was “last seen” 17 hours ago…
ZB@MQTT reports the following state, which is probably the last known state from yesterday afternoon:
{
"battery": 90.5,
"battery_low": false,
"last_seen": "2023-03-03T16:29:41+01:00",
"linkquality": 120,
"occupancy": true,
"tamper": false,
"voltage": 2900
}
However, the sensors are not configured to “retain” their values. The checkbox in the ZB2MQTT device settings is unchecked, and I even set this in the zb2mqtt/configuration.yaml
file (plus a few additional trial-and-error options):
'0x00124b002918e7bb':
friendly_name: Keller Bewegung Links
homeassistant:
expire_after: 5
legacy: false
optimistic: false
retain: false
occupancy_timeout: 10
What could cause these offline motion sensors to consistently show up as “occupied” in Home Assistant?