Skip to content

[WWSTCERT-13446, WWSTCERT-13450, WWSTCERT-13454, WWSTCERT-13458] SONOFF/SWV1C - #3157

Merged
KKlimczukS merged 24 commits into
SmartThingsCommunity:mainfrom
yanggx24:main
Oct 12, 2026
Merged

KKlimczukS merged 24 commits into
SmartThingsCommunity:mainfrom
yanggx24:main

Conversation

@yanggx24

@yanggx24 yanggx24 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Summary of Completed Tests

Comment thread drivers/SmartThings/zigbee-valve/profiles/sonoff-irrigation.yml Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua
@github-actions

Copy link
Copy Markdown

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions

Copy link
Copy Markdown

Profile category check: ✅ Passed - all profiles have a category defined.

@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Channel deleted.

@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

zigbee-valve_coverage.xml

File Coverage
All files 97% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-valve/src/sinope/init.lua 97% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-valve/src/lazy_load_subdriver.lua 57% ❌

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 1e566cb

@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Test Results

   73 files    544 suites   0s ⏱️
3 301 tests 3 301 ✅ 0 💤 0 ❌
5 294 runs  5 294 ✅ 0 💤 0 ❌

Results for commit 1e566cb.

♻️ This comment has been updated with latest results.

@KKlimczukS
KKlimczukS requested a review from cbaumler July 31, 2026 09:59
@yanggx24

yanggx24 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review.

Yes, I checked this behavior with the SONOFF SWV1C device. The device uses the Zigbee OnOff cluster for valve control and reports the valve state through the OnOff attribute.

The custom handlers were added to explicitly map:

  • valve.open / valve.close commands to Zigbee OnOff On / Off
  • OnOff attribute reports back to SmartThings valve.open / valve.closed events

This is also needed because the device reports the OnOff value as ZCL_DATA_TYPE_UINT8. In Lua, numeric 0 is truthy, so the handler explicitly checks for false and 0 to avoid treating an OFF report as open.

I can also re-test without the custom handlers and confirm whether the default zigbee-valve handling covers this device correctly.

@ldeora

ldeora commented Aug 3, 2026

Copy link
Copy Markdown

I can also re-test without the custom handlers and confirm whether the default zigbee-valve handling covers this device correctly.

Has this implementation been tested with the valve left open for longer than ten minutes?

Several Hydro ONE users have reported that the valve closes itself after approximately ten minutes because of its device-side manual watering duration. From the current PR, it appears that Open only sends the standard Zigbee On command and does not read or update the SONOFF 0xFC11 attribute 0x501D (manualDefaultSettings).

Could you confirm whether the tested devices remained physically open beyond ten minutes, and which model and firmware version were used? It would also be useful to know whether newer firmware has removed the default limit or whether the WWST integration is expected to configure 0x501D.

@yanggx24

yanggx24 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

I can also re-test without the custom handlers and confirm whether the default zigbee-valve handling covers this device correctly.

Has this implementation been tested with the valve left open for longer than ten minutes?

Several Hydro ONE users have reported that the valve closes itself after approximately ten minutes because of its device-side manual watering duration. From the current PR, it appears that Open only sends the standard Zigbee On command and does not read or update the SONOFF 0xFC11 attribute 0x501D (manualDefaultSettings).

Could you confirm whether the tested devices remained physically open beyond ten minutes, and which model and firmware version were used? It would also be useful to know whether newer firmware has removed the default limit or whether the WWST integration is expected to configure 0x501D.

  1. Just now, I tested a 10-minute manual valve opening action, and after the timeout, the device reported an off status, and the UI on the app also updated accordingly.
  2. The firmware version of the tested device is v 1.1.0.
  3. This smartthings driver will not affect the automatic shutdown after 10 minutes. For this device, our plan is to first complete the WWST certification, and then provide more support for private attributes.

@ldeora

ldeora commented Aug 3, 2026

Copy link
Copy Markdown

I can also re-test without the custom handlers and confirm whether the default zigbee-valve handling covers this device correctly.

Has this implementation been tested with the valve left open for longer than ten minutes?
Several Hydro ONE users have reported that the valve closes itself after approximately ten minutes because of its device-side manual watering duration. From the current PR, it appears that Open only sends the standard Zigbee On command and does not read or update the SONOFF 0xFC11 attribute 0x501D (manualDefaultSettings).
Could you confirm whether the tested devices remained physically open beyond ten minutes, and which model and firmware version were used? It would also be useful to know whether newer firmware has removed the default limit or whether the WWST integration is expected to configure 0x501D.

  1. Just now, I tested a 10-minute manual valve opening action, and after the timeout, the device reported an off status, and the UI on the app also updated accordingly.

To make it clear: the valve won't stay open for longer than 10 minutes, even when it was opened "manually" (Zigbee On command)?

@yanggx24

yanggx24 commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor Author

To make it clear: the valve won't stay open for longer than 10 minutes, even when it was opened "manually" (Zigbee On command)?

Yes.

Comment thread drivers/SmartThings/zigbee-valve/src/init.lua
Comment thread drivers/SmartThings/zigbee-valve/src/init.lua
@KKlimczukS KKlimczukS changed the title SONOFF/SWV1C [WWSTCERT-13085, WWSTCERT-13089, WWSTCERT-13093, WWSTCERT-13097] SONOFF/SWV1C Aug 5, 2026
@KKlimczukS

Copy link
Copy Markdown
Contributor

@yanggx24 Please update Your branch.

@KKlimczukS
KKlimczukS requested a review from aleclorimer August 10, 2026 10:02
@yanggx24

Copy link
Copy Markdown
Contributor Author

@yanggx24 Please update Your branch.

I have merged the latest code, is there anything else missing?

@KKlimczukS
KKlimczukS self-requested a review September 23, 2026 16:20

@KKlimczukS KKlimczukS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update Your branch

@cjswedes cjswedes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is close, it seems like the onoff handler override does justify the subdriver, but there are some other things that seem unnecessary in the subdriver.

Comment thread drivers/SmartThings/zigbee-valve/src/init.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/sonoff/init.lua Outdated
@KKlimczukS
KKlimczukS self-requested a review September 24, 2026 09:19

@KKlimczukS KKlimczukS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua
Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
yanggx24 and others added 3 commits October 9, 2026 09:32
Co-authored-by: Konrad K <33450498+KKlimczukS@users.noreply.github.com>
Co-authored-by: Konrad K <33450498+KKlimczukS@users.noreply.github.com>

@KKlimczukS KKlimczukS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua Outdated
@KKlimczukS

Copy link
Copy Markdown
Contributor

@yanggx24
Contributor License Agreement (CLA) needs to be signed by You, so we could merge the code.
Please make sure to complete that step on the github.

@yanggx24

yanggx24 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@yanggx24 Contributor License Agreement (CLA) needs to be signed by You, so we could merge the code. Please make sure to complete that step on the github.

The required license/cla check is stuck at “Expected — Waiting for status to be reported”.
Could you please retrigger the CLA check or provide the CLA signing link?

@KKlimczukS

Copy link
Copy Markdown
Contributor

@yanggx24 Contributor License Agreement (CLA) needs to be signed by You, so we could merge the code. Please make sure to complete that step on the github.

The required license/cla check is stuck at “Expected — Waiting for status to be reported”. Could you please retrigger the CLA check or provide the CLA signing link?

@yanggx24 Please check this link: https://cla-assistant.io/SmartThingsCommunity/SmartThingsEdgeDrivers

@KKlimczukS
KKlimczukS merged commit 3951deb into SmartThingsCommunity:main Oct 12, 2026
46 of 49 checks passed
@yanggx24

yanggx24 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

@yanggx24 Please check this link: https://cla-assistant.io/SmartThingsCommunity/SmartThingsEdgeDrivers

OK, I have signed it. Thank you.

aleclorimer pushed a commit that referenced this pull request Oct 13, 2026
…FF/SWV1C (#3157)

* feat:sonoff swv valve

* Zigbee Valve:modify comment language and file name

* Zigbee Valve:Add Sonoff valve subdriver lazy loading

* test: fix zigbee valve lazy loading coverage

* Fix SONOFF valve command handling

* Configure Sonoff valve battery reporting

* chore: simplify zigbee-valve license header

* chore: remove test_lazy_load_subdriver.lua

* Use default SONOFF valve reporting config

* fix(zigbee-valve): restore default battery reporting configuration

* Fix SONOFF valve command test expectations

* Remove unnecessary line breaks in test_sonoff_valve.lua

* Update drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua

Co-authored-by: Konrad K <33450498+KKlimczukS@users.noreply.github.com>

* Update drivers/SmartThings/zigbee-valve/src/test/test_sonoff_valve.lua

Co-authored-by: Konrad K <33450498+KKlimczukS@users.noreply.github.com>

* Remove redundant comments from the SONOFF test file

---------

Co-authored-by: Konrad K <33450498+KKlimczukS@users.noreply.github.com>
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