-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonoff SWV-BSP Smart Water Valve improvements #3930
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3930 +/- ##
==========================================
+ Coverage 91.00% 91.03% +0.02%
==========================================
Files 328 328
Lines 10656 10687 +31
==========================================
+ Hits 9698 9729 +31
Misses 958 958 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
FWIW, I have a similar PR minus the |
…ficiency. Thanks to @fgsch
Thank you @fgsch, I've updated the code. I didn't see your PR, I'm sorry. |
👍
I haven't tried it yet. IIUC you are using the attribute for the automatic valve close if there is no water together with the timing irrigation command for this purpose? Is this correct?
No worries. I changed the name to match other devices. Might as well do it here but really up to you. |
I'm sorry I don't understand your question. I added the I added also the two alarms, because I found your PR #3346 that added the attributes and I read that the other PRs in ZHA needed for the |
That attribute, 0x5011, is used to turn the valve off if there is no water for the specified amount of time (as per https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/sonoff.ts#L1447). This PR uses this attribute as a timer, which is later used with command 0x42 for timed irrigation (as per https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/sonoff.ts#L329-L363). Effectively, this is changing what 0x5011 is used for, assuming I understood correctly. |
Now I understand. My idea was to keep a single switch but let the user set a timeout and then send a 42 instead of a 01. I found no way to add and store that value. Trying to figure it out I found that parameter, but I didn't get it was used for water shortage. Could you point me in the right direction of adding an optional timeout in the device config? |
I'm not sure. Perhaps one of the devs could help. |
@fgsch, are you the reviewer who needs to respond based on the label? |
No, it's a label for me (or other reviewers) that an answer/review/help is needed. |
Ok, thank you. |
I added these features to the Sonoff SWV-BSP Smart Water Valve (see #3298):
on_time
attribute, representing the number of seconds after opening before the valve automatically closes.on_time == 0
it's a normal On command (0x01
)on_time != 0
it sends a on_with_timed_off (0x42
), with theon_time
numbers of seconds sets in the attributeThis is my first attempt at creating a Quirk.
Any advice on whether I'm following the correct way would be appreciated.
Thank you!
Checklist
pre-commit
checks pass / the code has been formatted using Black