Skip to content

SONOFF/SWV1C - #3157

Open
yanggx24 wants to merge 2 commits into
SmartThingsCommunity:mainfrom
yanggx24:main
Open

SONOFF/SWV1C#3157
yanggx24 wants to merge 2 commits into
SmartThingsCommunity:mainfrom
yanggx24:main

Conversation

@yanggx24

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

@@ -0,0 +1,14 @@
name: sonoff-irrigation

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 rename this profile to valve-battery

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 on lines +101 to +105
[capabilities.valve.ID] = {
[capabilities.valve.commands.open.NAME] = valve_open_handler,
[capabilities.valve.commands.close.NAME] = valve_close_handler,
}
},

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.

Did You check if Your device works with the zigbe-valve driver default handling ? (without this custom handling)

Comment on lines +109 to +111
[OnOff.ID] = {
[OnOff.attributes.OnOff.ID] = onoff_attr_handler
},

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.

Did You check if Your device works with the zigbe-valve driver default handling ? (without this custom handling)

@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

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

zigbee-valve_coverage.xml

File Coverage
All files 88%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-valve/src/sinope/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-valve/src/sonoff/init.lua 73%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 244e0ee

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Test Results

   73 files    541 suites   0s ⏱️
3 241 tests 3 236 ✅ 0 💤 5 ❌
5 233 runs  5 227 ✅ 0 💤 6 ❌

For more details on these failures, see this check.

Results for commit 244e0ee.

♻️ 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
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
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
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 on lines -44 to -46
sub_drivers = require("sub_drivers"),
health_check = false,
shared_device_thread_enabled = true,

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.

Add the new sonoff subdriver to the sub_drivers.lua file in this driver and use lazy loading.

Comment on lines -45 to -46
health_check = false,
shared_device_thread_enabled = true,

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.

These should be kept

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.

4 participants