TS0202 falsely reports no occupancy after ~90s
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.7k
- Forks
- 2k
- Avg merge
- 18h 55m
- Merged PRs (30d)
- 35
Description
What happened?
The device (TS0202, motion sensor) after around 90s of movement in front of it, falsely reports no occupancy, which triggers automations to turn off lights. To make it detect occupancy again i need to move out of device sight and after a while enter again. It's similar, or the same as issue #5690
What did you expect to happen?
It should report occupancy, for as log as I'm in device's sight
How to reproduce it (minimal and precise)
- Connect device with z2m
- Go into its sight, it reports
occupancy = true - Wait ~90s while moving, it reports
occupancy = false
Zigbee2MQTT version
2.13.0
Adapter firmware version
EmberZNet 8.0.2 [GA]
Adapter
SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2
Setup
Home Assistant for RPi 4B, with z2m as home assistant app
Device database.db entry
{"id":12,"type":"EndDevice","ieeeAddr":"0x5c0272fffebbecf4","nwkAddr":7765,"manufId":0,"manufName":"_TYZB01_jytabjkb","powerSource":"Battery","modelId":"TS0202","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,1,3,1280,61185],"outClusterList":[3,25],"clusters":{"genBasic":{"attributes":{"modelId":"TS0202","manufacturerName":"_TYZB01_jytabjkb","appVersion":68}},"ssIasZone":{"attributes":{"iasCieAddr":"0x0000000000000000","zoneState":0}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":200}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":68,"zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{},"lastSeen":1787926856149}
Debug log
[28.08.2026, 15:53:45] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Czujnik Ruchu', payload '{"battery":100,"battery_low":false,"linkquality":168,"occupancy":true,"tamper":false,"voltage":null}'
[28.08.2026, 15:55:15] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Czujnik Ruchu', payload '{"battery":100,"battery_low":false,"linkquality":168,"occupancy":false,"tamper":false,"voltage":null}'
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the TS0202 behavior in Zigbee2MQTT using the steps and debug log shown, then compare the symptoms with issue #5690. Trace how the device's occupancy reports are handled; done means continued movement no longer produces a false occupancy=false report after about 90 seconds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100