Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4708 +/- ##
==========================================
+ Coverage 92.32% 92.34% +0.01%
==========================================
Files 371 373 +2
Lines 12198 12228 +30
==========================================
+ Hits 11262 11292 +30
Misses 936 936 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for the Shelly Ecowitt WS90 weather station by implementing a V2 quirk with custom clusters for wind, UV index, and precipitation measurements. The implementation is based on community work from issue #4558 by @DougMunford and marks the first Shelly device added to this repository.
Changes:
- Introduces Shelly manufacturer module with shared constants
- Implements custom clusters for manufacturer-specific weather measurements (wind, UV, rain)
- Creates Home Assistant entities for wind speed/direction, gust speed, UV index, precipitation, and rain detection
- Adds basic tests verifying custom cluster attribute definitions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| zhaquirks/shelly/init.py | Defines Shelly manufacturer constants following established patterns from other manufacturers |
| zhaquirks/shelly/ecowitt_ws90.py | Implements V2 quirk with three custom clusters (0xFC01-0xFC03) exposing weather station sensors to Home Assistant |
| tests/test_shelly.py | Provides basic test coverage verifying custom cluster attributes are properly defined |
dade9a7 to
af7eb31
Compare
zhaquirks/shelly/ecowitt_ws90.py
Outdated
| """Wind cluster attribute definitions.""" | ||
|
|
||
| wind_speed = foundation.ZCLAttributeDef( | ||
| id=0x0000, type=types.uint16_t, access="rp", is_manufacturer_specific=True |
There was a problem hiding this comment.
We're moving to using manufacturer_code=0xABCD (with the correct manufacturer code) for every definition. This replaces the manufacturer ID override and is_manufacturer_specific.
Can you confirm that they Shelly manufacturer code is the same as the cluster ID? That sounds strange.
There was a problem hiding this comment.
Yeah apologies, I just named it weirdly now that I am looking into it... SHELLY_MANUFACTURER_CODE would be a better name - the code is 0x1490 for all three of these clusters... I will change the naming (and also put a link to the Zigbee spec from Shelly for this devices to the description of the PR)
I will change it to manufacturer_code then, thanks for the info!
There was a problem hiding this comment.
I changed it to the manufacturer_code and removed the is_manufacturer_specific and manufacturer_id_override.
I also added the link to the Shelly doc to the initial PR description in the "Additional information".
Copilot seems to be complaining about the change in the comment below: https://github.com/zigpy/zha-device-handlers/pull/4708#discussion_r2749886452#discussion_r2749886452 - can I safely ignore it?
There was a problem hiding this comment.
Ah, the AI instructions haven't been updated for the above API change. You can ignore it.
af7eb31 to
fc1af45
Compare
|
Hi, I'm using your code as custom quirk in my HA installation but when I updated Core from 2026.1.3 -> 2026.2.1 the custom attributes stopped updating. I asked ClaudeAI, and its suggestion fixed it for me, so I thought you'll be interested:
wind_speed = foundation.ZCLAttributeDef(
id=0x0000, type=types.uint16_t, access="rp",
manufacturer_code=SHELLY_MANUFACTURER_CODE,
) |
fc1af45 to
fa7eee6
Compare
You are absolutely right! I just checked my HA and those attributes were indeed missing after the upgrade to 2026.2... |
01b6031 to
f7fcfc9
Compare
db4856c to
a8b9be8
Compare
Proposed change
Add support for Shelly Ecowitt WS90.
Additional information
Based on the quirk and discussion in #4558
The quirk code itself is 99% based on the work done by @DougMunford in that issue, I just added the cluster manufacturer id code, extracted couple things to constants and put this into PR. So huge kudos to Doug!!!
Device documentation: here
This is my first PR to this repo and my first ever commit to anything in Python so I apologize in advance if I messed something up 🙂
Any and all feedback is definitely welcome!
Device diagnostics
zha-79be2e9ad9b58ac907e43c7f06078f1a-Shelly Ecowitt WS90-6fda9ff7584dc159a0a84279398bdb7e.json
Checklist
pre-commitchecks pass / the code has been formatted using Black