[shelly] Add support for Duo E27 G3 and Multicolor Bulb E27 G3 - #20909
[shelly] Add support for Duo E27 G3 and Multicolor Bulb E27 G3#20909markus7017 wants to merge 12 commits into
Conversation
|
@lsiepel Yes, I already spend some time, but couldn't get it stable - fixing here breaks there. This will not go into 5.2. I'm focusing of bug fixes and "easy integrations" of new devices (there are 15 more...). WS90 and LORA might be good candidates because almost done. |
|
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
|
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/shelly-beta-with-plus-pro-mini-and-blu-support/139554/1 |
|
I am also willing to test if you could provide a jar. |
andrewfg
left a comment
There was a problem hiding this comment.
Just a few comments concerning terminology
|
@markus7017 there is an offer to get this tested by @matmai, couldyou provide a jar where the conflicts and feedback have been resolved ? |
There was a problem hiding this comment.
Pull request overview
Adds Gen3 Shelly Duo and Multicolor bulbs using the Gen2 RPC API.
Changes:
- Registers both bulb types and channel definitions.
- Adds CCT/RGB DTO and RPC handling.
- Adds profile and deserialization tests.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
ShellyApiConfigurationTest.java |
Improves setup failure reporting. |
Shelly2DuoBulbProfileTest.java |
Tests bulb DTO deserialization. |
ShellyDeviceProfileTest.java |
Tests new profile flags. |
shellyGen2_lights.xml |
Defines new thing types. |
shellyGen1_lights.xml |
Adds Duo temperature range type. |
shelly.properties |
Adds labels and descriptions. |
ShellyHandlerFactory.java |
Removes an unused field. |
ShellyDevices.java |
Registers device identifiers and groups. |
ShellyChannelDefinitions.java |
Creates CCT channels dynamically. |
ShellyLightHandler.java |
Handles Gen3 bulb state and commands. |
Shelly2ApiRpc.java |
Adds bulb RPC dispatch. |
Shelly2ApiJsonDTO.java |
Adds RGB/CCT RPC DTOs. |
Shelly2ApiClient.java |
Maps bulb configuration and status. |
ShellyDeviceProfile.java |
Adds Gen3 bulb capability flags. |
Suppressed comments (2)
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_lights.xml:26
- The description still claims a power meter, contradicting the PR description and the implementation, which does not map the bulb's power/energy fields to meter channels. Remove the claim so users are not promised unavailable channels.
<description>Shelly Multicolor Bulb E27 - Dimmable RGB+CCT Bulb with Power Meter</description>
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties:84
- The localized description reintroduces the false power-meter claim that the PR description says was removed. This string will override the corrected thing XML in localized UIs.
thing-type.shelly.shellypluscolorbulb.description = Shelly Multicolor Bulb E27 Gen3 (Dimmable RGB+CCT Bulb with Power Meter)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
That's to early. We discussed
|
According to the core light pr startpost it depends on this PR. so after the almost finished bug fix I assumed this PR is next. If not please update the above linked PR start post. And verify with @andrewfg about the core pr dependency |
|
My PR will only come after @markus7017 three light related PRs (including this one) are finished. |
|
Be carefull when rebasing, when done, i'll run another review round. Are there any device owners who mentioned they are willing to test? |
|
The commit history has been rebased and reorganized into review-friendly, cherry-pickable commits (one per fix/feature/test group). This PR adds support for the Shelly Duo Bulb E27 Gen3 and Shelly Multicolor Bulb E27 Gen3. While integrating them, the shared light-handling code used by all Shelly light devices was reviewed and fixed — this also covers the existing Gen1 Duo, Duo RGBW and Vintage bulbs, since they share the same code paths. Each bulb model's color profile (CCT-only, RGB+CCT, or RGBW2's fixed color+white) is now handled on its own terms instead of assuming one shape for all of them. A build is available for testing:
@matmai @andrewfg would appreciate your help testing this on real hardware — Duo Bulb G3, Multicolor Bulb G3, and, if you have one, an existing Gen1 Duo/Duo RGBW/Vintage bulb to confirm nothing regressed there. |
|
@lsiepel Please trigger an AI review |
|
This gives an overview of the different color profiles, device types and how they map to channels |
lsiepel
left a comment
There was a problem hiding this comment.
Here are the review results.
This review was AI-assisted.
|
Did some testing, here's the feedback (if I understood correctly you want it here). FWIW, I didn't use discovery but statically created a bulb thing. So: can control brightness but not color temperature. The latter channel has no effect. And the brightness channel seems to reset itself to 0 or 100 at times. Not sure if my testing method or some other bug that still references the old (standard binding) channel is still active (cannot restart my system). |
|
@matmai Please use updated build and try to use discovery initially, maybe the are issues when using the .things file. Delete the thing (also from jsondb to avoid some old stuff to get restored) |
|
@markus7017 I could not really tell from your code, but it looks like you are reclassifying the RGBWWPM rgbcct mode to be one "light" (essentially the same as a Gen 3 full color bulb) rather than a separate rgb primary with a cct secondary. Is that correct? |
|
@andrewfg Maybe to reduce future confusion (not implemented yes): the isRGBCCT flag name is what's colliding with the Pro RGBWW PM's rgbcct profile string in reviewers' heads even though the code paths never overlap (isRGBCCT is gated behind isDuo everywhere). If you want to preempt this coming up again, renaming the flag to something bulb-specific (e.g. isMulticolorBulb) or adding a one-line Javadoc contrast note on the field would remove the ambiguity without touching behavior. |
lsiepel
left a comment
There was a problem hiding this comment.
This is probably the last one
| Shelly2RpcRequestParams params = new Shelly2RpcRequestParams(); | ||
| params.id = 0; | ||
| params.mode = SHELLY_MODE_COLOR.equals(mode) ? SHELLY_RGBCCT_MODE_RGB : SHELLY_RGBCCT_MODE_CCT; | ||
| apiRequest(SHELLYRPC_METHOD_RGBCCT_SET, params, String.class); |
There was a problem hiding this comment.
RGBCCT.Set requires at least one of on or brightness, so this mode-only request is invalid. The same precondition is missed by the setLightParms() RGBCCT branch when it sends only rgb or ct; the temperature path first sends this request and then a ct-only request, so switching to white/CCT can fail before the temperature is applied. Please ensure every RGBCCT.Set request includes on/brightness (or combine mode and value into one valid request), and make the transport-stub test reject payloads that violate the documented requirement.
There was a problem hiding this comment.
Fixed in 9823a91 - the handler now folds the mode switch into the same RGBCCT.Set request as the new rgb/ct value (one request instead of mode-only + value-only), and the RPC layer adds on=true whenever a request would otherwise carry neither on nor brightness. setLightMode() goes through the same path. The transport-stub test now rejects any RGBCCT.Set payload without on/brightness, and new tests cover the combined mode+ct / mode+rgb requests. (CCT.Set is unaffected: per the docs it accepts ct alone.)
85a9c7b to
a3a4b4d
Compare
|
@lsiepel changes applied, ready for the next round:
Branch is rebased on current main, full build incl. tests is green. Updated build: org.openhab.binding.shelly-5.3.0-SNAPSHOT-duog3.jar |
Yes that seems to have fixed it. |
…profile flags Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
…d mode switching Signed-off-by: Markus Michels <markus7017@gmail.com>
…nitions Signed-off-by: Markus Michels <markus7017@gmail.com>
…tch handling Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
- derive isRGBCCT from the thing type at init time (Multicolor Bulb is always rgbcct:0), runtime config detection stays as confirmation - drop the Gen1-Bulb-only mode channel update for the Multicolor Bulb (it has no mode channel) - remove redundant isDuo guard and no-op list write in Shelly2ApiClient - rename Shelly2DuoBulbProfileTest to Shelly2DuoBulbDtoTest (it tests DTO mapping only), use the Multicolor thing type in color-mode tests, drop comments/FQNs in unit tests - README: one sentence per line for the Multicolor Bulb paragraph; trim comments Signed-off-by: Markus Michels <markus7017@gmail.com>
…tus blanking, CCT.Set guard - updateRGBW: skip partial status notifications without rgb instead of dereferencing null - applyBulbLightSettings: preserve the persisted light status across profile refreshes - CCT.Set: don't send an empty request (device requires on, brightness or ct) - RGBCCT.Set: repeat the current power state instead of forcing on when only rgb/ct/mode is sent - Multicolor Bulb: white#temperature reports UNDEF in color mode; Gen3 bulbs push Kelvin - ShellyColorUtils copy constructor now carries the mode Signed-off-by: Markus Michels <markus7017@gmail.com>
…eep Gen1 bulb behaviour - color#hsb/red/green/blue now switch the Multicolor Bulb to color mode, white#temperature switches back - Gen3 bulbs have no power channel: brightness 0 turns the light off, color picker brightness is applied - Gen1 Bulb/Duo/Vintage/Duo RGBW keep their power channel and brightness semantics Signed-off-by: Markus Michels <markus7017@gmail.com>
…r Gen3 bulbs - Gen3 Duo/Multicolor Bulb white#temperature is Number:Temperature 2700..6500 K - Gen1 devices keep the Dimmer based whiteTemp channel type - Thing descriptions aligned with i18n properties, Duo Bulb category Lightbulb - README documents the channel type and mode switching Signed-off-by: Markus Michels <markus7017@gmail.com>
…ests - Shelly2RGBCCTStatus nested in Shelly2DeviceStatusResult like the other status DTOs - SHELLYDT_COLORBLBG3 renamed to SHELLYDT_COLORBULBG3 (value unchanged) - Discovery tests cover the Gen3 bulb service names and model IDs Signed-off-by: Markus Michels <markus7017@gmail.com>
a3a4b4d to
f3a72e2
Compare
|
Pushed a self-review round for both Gen3 bulbs ( Fixes
Changes
README updated accordingly. Test build: |
|
@mstormi please re-test |
|
yes color temp is working now, thanks |
|
I also have also tested a S3BL-C010007AEU bulb with org.openhab.binding.shelly-5.3.0-SNAPSHOT-duog3.jar (5.3.0.202608291343) on openHAB 5.3.0 Snapshot Build 5566.
BTW: SHBLB-1 was not supported by this bundle |
Description
[New Device Support]
Add support for the Shelly Duo Bulb E27 Gen3 (
shellyplusduobulb) and Shelly Multicolor Bulb E27 Gen3 (shellypluscolorbulb). Both devices use the Gen2 RPC API. While integrating them, the shared light-handling code used by all Shelly light devices was reviewed and adjusted so each bulb's actual color profile (CCT-only, RGB+CCT, or RGBW2's fixed 4-channel color+white) is handled correctly — this also affects the existing Gen1 Duo, Duo RGBW and Vintage bulbs, which share the same code paths. README documentation was updated for both new thing types.Features:
Fixes:
Changes:
Testing
How to verify on hardware
Acceptance criteria
Closing
Backport assessment
New device support bundled with a review/fix pass on the shared light-handling code it depends on; not backport-eligible.