Conversation
This PR adds a stable and practical quirk for the Sonoff SNZB‑03P motion sensor. It fixes incorrect motion behavior, exposes the illumination state, and provides a working motion timeout configuration. Key features: Adds vendor illumination cluster 0xFC11 with attribute 0x2001 (Dark/Light) Maps motion timeout to OccupancySensing delay for full ZHA compatibility Removes IAS Zone to avoid duplicate binary_sensor Provides a working Number entity for motion timeout (5–60 seconds) No vendor‑specific write overrides required — stable and ZHA‑safe Fully tested with real hardware Why this PR? The existing PR (zigpy#3979) attempted to add support but relied on vendor‑specific clusters that caused issues with ZHA’s attribute handling. This version is simpler, more robust, and works reliably with the current ZHA architecture. Tested on: Sonoff SNZB‑03P (firmware 0x00002201) ZHA with Sonoff Dongle‑M Home Assistant 2024.x Result: Motion works correctly Illumination updates reliably Timeout slider works and writes successfully No duplicate entities No errors in logs
3jam3
left a comment
There was a problem hiding this comment.
As requested, here is the updated and stable SNZB‑03P quirk.
Changes included:
- Added vendor illumination cluster (0xFC11)
- Added Dark/Light enum sensor
- Removed IAS Zone to avoid duplicate motion entities
- Implemented motion timeout using OccupancySensing delay (fully ZHA‑compatible)
- Clean and stable implementation without vendor-specific write overrides
This PR replaces PR #3979 as discussed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4628 +/- ##
=======================================
Coverage 93.07% 93.08%
=======================================
Files 401 402 +1
Lines 13306 13322 +16
=======================================
+ Hits 12385 12401 +16
Misses 921 921 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Updated the Sonoff SNZB-03P quirk with improved class definitions and added docstrings for clarity.
corrections added
|
@3jam3 modify PR title to: "Add Sonoff SNZB-03P motion sensor" |
|
CI fails due to zigpy not supporting Python 3.12/3.13 yet. |
|
I am relatively new to HA, but because I was having issues with what I thought were ZHA ones, I came across this post, but it started in another post from Jan 2024 from what I could see, but maybe earlier. Now I am also having all the same issues as everybody else on ZHA with these devices. By the sounds of it this is very close to resolved. My question would be if this is the case then when can the community expect to see this incorporated with in Home Assistant. Home Assistant Green user I know HA is all developed by supporters / volunteers, but 2 years and sill no time scales for a fix date to incorporate within HA. |
I can confirm the same bug (illumination reports unknown). Envionment |
|
I tested this PR/custom quirk on:
The quirk applies and creates the Illumination enum sensor, but with the current attribute definition the sensor remains Debug log during a motion event shows that the device does report illumination: So attribute The working version for me defines the attribute as report-only and non-manufacturer-specific: last_illumination_state = ZCLAttributeDef(
id=0x2001,
type=LastIlluminationState,
access="p",
is_manufacturer_specific=False,
)After a full HA restart and a fresh motion event, the sensor updates correctly: state:
translated: Light
raw: Light
attributes:
device_class: enumSo the cluster is manufacturer-specific ( The key change appears to be: last_illumination_state = ZCLAttributeDef(
id=0x2001,
type=LastIlluminationState,
- access="rp",
- is_manufacturer_specific=True,
+ access="p",
+ is_manufacturer_specific=False,
) |
|
@danielcolquitt you are awesome professor! |
|
This and related issues have been open for several years. How can I help move this forward and get it merged? |

This PR adds a stable and practical quirk for the Sonoff SNZB‑03P motion sensor. It fixes incorrect motion behavior, exposes the illumination state, and provides a working motion timeout configuration.
Key features:
Adds vendor illumination cluster 0xFC11 with attribute 0x2001 (Dark/Light)
Maps motion timeout to OccupancySensing delay for full ZHA compatibility
Removes IAS Zone to avoid duplicate binary_sensor
Provides a working Number entity for motion timeout (5–60 seconds)
No vendor‑specific write overrides required — stable and ZHA‑safe
Fully tested with real hardware
Why this PR?
The existing PR (#3979) attempted to add support but relied on vendor‑specific clusters that caused issues with ZHA’s attribute handling. This version is simpler, more robust, and works reliably with the current ZHA architecture.
Tested on:
Sonoff SNZB‑03P (firmware 0x00002201)
ZHA with Sonoff Dongle‑M
Home Assistant 2024.x
Result:
Motion works correctly
Illumination updates reliably
Timeout slider works and writes successfully
No duplicate entities
No errors in logs
Proposed change
Additional information
Device diagnostics
Checklist
pre-commitchecks pass / the code has been formatted using Black