Add Sonoff SNZB-04PR2 (WWSTCERT-10731) and SNZB-04P (WWSTCERT-10704) Smart Scene Contact into zigbee-contact#2539
Merged
KKlimczukS merged 8 commits intoSmartThingsCommunity:mainfrom Apr 9, 2026
Conversation
KKlimczukS
requested changes
Mar 18, 2026
drivers/SmartThings/zigbee-contact/profiles/contact-battery-tamper.yml
Outdated
Show resolved
Hide resolved
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Channel deleted. |
Test Results 72 files 492 suites 0s ⏱️ Results for commit 924110e. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 924110e |
KKlimczukS
approved these changes
Mar 19, 2026
cjswedes
approved these changes
Mar 30, 2026
hcarter-775
approved these changes
Apr 9, 2026
hcarter-775
pushed a commit
that referenced
this pull request
Apr 11, 2026
…Smart Scene Contact into zigbee-contact (#2539) * Add Sonoff SNZB-04PR2 Smart Scene Contact into zigbee-contact * Add Sonoff profile into zigbee-contact * Delete the program, that is only submit the relevant configuration. * Modify the profile configuration of the fingerprint file * The anti-tampering function has been changed to a standard attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check all that apply
Type of Change
Checklist
Description of Change
This PR adds Sonoff SNZB-04PR2 Smart Scene Contact into zigbee-contact,In fact, it also includes SNZB-04P. The two devices have exactly the same functions, so they are submitted together.
Changes made:
1.Added device fingerprint in fingerprints.yml to recognize the SONOFF SNZB-04PR2 and SNZB-04P device
2.Implemented custom handler in src/sonoff/init.lua to handle SONOFF-specific Zigbee communication
3.Implemented custom handler in src/sonoff/SNZB-04PR2/init.lua to handle SONOFF-specific Zigbee communication
4.Added the detection and reporting function for the device's door magnetic status and tamper prevention status.
5.Add contact-battery-tamper.yml into profiles.
Summary of Completed Tests
Device Testing:
✅ Device pairing: Successfully paired SONOFF SNZB-04PR2 and SNZB-04P with SmartThings Hub
✅ Status reporting actions: Verified both types of status work correctly:
Door magnetic sensor status reporting
Alarm removal status reporting
✅ Battery reporting: Confirmed battery percentage is correctly displayed in SmartThings app
✅ Endpoint mapping: Verified button events are properly mapped to correct contact components
Code Testing:
✅ Fingerprint recognition: Device correctly identified during pairing process
✅ Profile loading: Device profile loaded successfully
✅ Event handling: Custom SONOFF handler processes Zigbee messages correctly
✅ Integration: No conflicts with existing button drivers
Compatibility:
✅ SmartThings Hub compatibility: Tested on SmartThings Hub v3
✅ Driver integration: Successfully integrates with existing zigbee-button driver framework
✅ No regression: Existing button devices continue to function normally