Skip to content

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
laity-w-sudo:main
Apr 9, 2026
Merged

Add Sonoff SNZB-04PR2 (WWSTCERT-10731) and SNZB-04P (WWSTCERT-10704) Smart Scene Contact into zigbee-contact#2539
KKlimczukS merged 8 commits intoSmartThingsCommunity:mainfrom
laity-w-sudo:main

Conversation

@laity-w-sudo
Copy link
Copy Markdown
Contributor

@laity-w-sudo laity-w-sudo commented Nov 7, 2025

Check all that apply

Type of Change

  • [√] WWST Certification Request
    • If this is your first time contributing code:
      • [√] I have reviewed the README.md file
      • [√] I have reviewed the CODE_OF_CONDUCT.md file
      • [√] I have signed the CLA
    • [√] I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • [√] New feature
  • Refactor

Checklist

  • [√] I have performed a self-review of my code
  • [√] I have commented my code in hard-to-understand areas
  • [√] I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

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

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Nov 7, 2025

CLA assistant check
All committers have signed the CLA.

@cbaumler cbaumler requested review from ctowns and hcarter-775 March 18, 2026 21:31
@github-actions
Copy link
Copy Markdown

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

Channel deleted.

@github-actions
Copy link
Copy Markdown

Test Results

   72 files    492 suites   0s ⏱️
2 689 tests 2 689 ✅ 0 💤 0 ❌
4 550 runs  4 550 ✅ 0 💤 0 ❌

Results for commit 924110e.

@github-actions
Copy link
Copy Markdown

File Coverage
All files 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-contact/src/frient/frient-vibration/init.lua 87%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 924110e

Copy link
Copy Markdown
Contributor

@KKlimczukS KKlimczukS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KKlimczukS KKlimczukS changed the title Add Sonoff SNZB-04PR2 and SNZB-04P Smart Scene Contact into zigbee-contact Add Sonoff SNZB-04PR2 (WWSTCERT-10731) and SNZB-04P (WWSTCERT-10704) Smart Scene Contact into zigbee-contact Mar 27, 2026
@cbaumler cbaumler requested review from aleclorimer and cjswedes and removed request for ctowns and hcarter-775 March 27, 2026 18:41
@KKlimczukS KKlimczukS merged commit ceb767c into SmartThingsCommunity:main Apr 9, 2026
12 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants