Skip to content

Add Sonoff SWV2C valve support - #3171

Open
yezi289 wants to merge 2 commits into
SmartThingsCommunity:mainfrom
yezi289:swv2c
Open

Add Sonoff SWV2C valve support#3171
yezi289 wants to merge 2 commits into
SmartThingsCommunity:mainfrom
yezi289:swv2c

Conversation

@yezi289

@yezi289 yezi289 commented Aug 11, 2026

Copy link
Copy Markdown

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

1、Add Sonoff valve subdriver lazy loading.
2、Modify comment language and file name
@CLAassistant

CLAassistant commented Aug 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yezi289

yezi289 commented Aug 11, 2026

Copy link
Copy Markdown
Author

I have tested this with a physical Sonoff SWV2C device. It pairs successfully in the SmartThings app, and both valve controls work normally.

@ldeora

ldeora commented Aug 11, 2026

Copy link
Copy Markdown

I have tested this with a physical Sonoff SWV2C device. It pairs successfully in the SmartThings app, and both valve controls work normally.

That's the easiest part, but does it stay on for longer than 10 minutes or does it automatically turn itself off after 10 minutes? What happens after - say - 15 minutes?

The device is completely useless when it turns itself off after 10 minutes. Users don't want to turn it on every 10 minutes if they want to irrigate for an hour.

Discussion:

https://community.smartthings.com/t/st-edge-sonoff-hydro-one-duo-family-swv-zfe-swv-zfu-swv-zne-swv-znu-swv-zf2e-swv-zf2u/309672

It's a bit more complicated (link to (outdated) code and technical documentation):

https://community.smartthings.com/t/st-edge-sonoff-hydro-one-duo-family-swv-zfe-swv-zfu-swv-zne-swv-znu-swv-zf2e-swv-zf2u/309672/106

@ldeora

ldeora commented Aug 11, 2026

Copy link
Copy Markdown

Another issue: before a channel is turned on, the opposite channel must be turned off. According to the official manual only one channel should be open at any time.

https://github.com/ldeora/SmartThingsEdgeDrivers/blob/main/sonoff-hydro/TECHNICAL_DOCUMENTATION.md#19-hydro-duo-architecture

@yezi289

yezi289 commented Aug 11, 2026

Copy link
Copy Markdown
Author

I tested this with a physical Sonoff SWV2C device.

For the 10-minute behavior: yes, the device has an internal default auto-close/manual watering duration. In my test, if a valve is opened normally, the device closes it automatically after the configured duration. The default value appears to be 10 minutes. Users can change the irrigation/manual watering duration through the device's own configuration path outside of this basic valve control behavior.

For the dual-channel behavior: I also tested the mutual exclusion behavior on the physical device. The two channels cannot stay open at the same time. If channel 1 is open and then channel 2 is opened, channel 1 is automatically closed and channel 2 opens. The device firmware reports the valve state automatically when a valve is operated, and the SmartThings app state updates correctly from those reports.

If preferred, I can update the driver to explicitly send an Off command to the opposite endpoint before opening the requested channel, so the SmartThings state stays aligned with the device behavior.

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.

3 participants