Skip to content

[shelly] Add support for Shelly Pro RGBWW PM - #19227

Open
markus7017 wants to merge 29 commits into
openhab:mainfrom
markus7017:shelly_rgbw
Open

[shelly] Add support for Shelly Pro RGBWW PM#19227
markus7017 wants to merge 29 commits into
openhab:mainfrom
markus7017:shelly_rgbw

Conversation

@markus7017

@markus7017 markus7017 commented Aug 23, 2025

Copy link
Copy Markdown
Contributor

Description

Adds support for the Shelly Pro RGBWW PM, building on top of the Plus RGBW PM fixes in #21256 (merged).

Feature: Support for Shelly Pro RGBWW PM, with all four of its firmware profiles: rgbcct (RGB + CCT), cctx2 (dual CCT), rgbx2light (RGB + two white channels), and light (five independent white channels).

The device is handled by the existing RGBW thing group. Power metering channels are created for all profiles.

Fix: Color-temperature (ct) is now propagated end-to-end for the cctx2 profile — both CCT channels expose a colorTemp channel alongside their dimmer, on both the RPC-poll and WebSocket-push/periodic-status paths.

Fix: Component-level power/energy readings (apower/aenergy/voltage/current) now reach the meter channel group for every component on every profile: rgbcct and rgbx2light meter their RGB component (meter) plus their secondary CCT/Light component(s) (meter2/meter3), cctx2 meters both CCT channels independently (meter1/meter2), light meters all five channels independently.

Fix: The device-level aggregated accumulatedPower/totalEnergy channels are now only created for the Pro RGBWW PM hybrid profiles (which have multiple independently metered components), not for the single-meter Plus RGBW PM.

Rebased onto current main (which now includes #21256) — ready for review.

Testing

README documents the full channel layout for every profile of the device.

  • Pro RGBWW PM in rgbcct mode: RGB channel + CCT channel work independently
  • Pro RGBWW PM in cctx2 mode: dual CCT channels work, no error on status poll
  • Pro RGBWW PM in rgbx2light mode: RGB + 2 white channels work
  • Pro RGBWW PM in light mode: 5 white channels work

Acceptance criteria

  • Implementation done
  • Documentation is up-to-date
  • Verified by Community

Closing

@markus7017 markus7017 self-assigned this Aug 23, 2025
@markus7017 markus7017 added enhancement An enhancement or new feature for an existing add-on work in progress A PR that is not yet ready to be merged labels Aug 23, 2025
@markus7017 markus7017 linked an issue Aug 26, 2025 that may be closed by this pull request
@markus7017 markus7017 changed the title [shelly] Add support for Plus RGBW and Pro RGBW [shelly] Enhance support for Plus RGBW and add Pro RGBW Aug 27, 2025
@lsiepel
lsiepel requested a review from Copilot August 30, 2025 08:59

Copilot AI left a comment

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.

Pull Request Overview

This PR enhances support for Shelly Plus RGBW devices and adds support for the new Shelly Pro RGBW PM device. The changes improve device compatibility and provide better channel control for RGBW lighting devices.

Key changes include:

  • Added new Shelly Pro RGBW PM device support with proper thing type definitions
  • Enhanced existing Shelly Plus RGBW PM configuration with additional channel groups
  • Refactored light status handling to extract reusable components for better maintainability

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ShellyThingCreatorTest.java Added test cases for new Pro RGBW PM device type
shellyGen2_lights.xml Enhanced Plus RGBW PM configuration and added Pro RGBW PM thing type definition
shelly.properties Updated device descriptions for Plus RGBW PM
ShellyLightHandler.java Refactored light update logic to use extracted component method
ShellyComponents.java Added reusable updateLights method extracted from handler
Shelly2ApiRpc.java Enhanced light status handling for multiple light channels
Shelly2ApiJsonDTO.java Extended data structures to support additional light configuration options
Shelly2ApiClient.java Added light settings and status handling for new device types
ShellyDevices.java Added device type constants and mappings for Pro RGBW PM

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacekKac

Copy link
Copy Markdown
Contributor

@markus7017 any news about this ?

@lsiepel

lsiepel commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Another shelly PR with binding core refactoring is waiting to be merged. Once done, i guess this is rebased and we can do a final review.

@markus7017 markus7017 added the awaiting other PR Depends on another PR label Jun 7, 2026
@markus7017 markus7017 removed the awaiting other PR Depends on another PR label Jun 20, 2026
@markus7017 markus7017 removed the work in progress A PR that is not yet ready to be merged label Jun 20, 2026
@markus7017 markus7017 changed the title [shelly] Enhance support for Plus RGBW and add Pro RGBW [shelly] Add support for Shelly Plus RGBW PM and Pro RGBWW PM Jun 20, 2026
@markus7017 markus7017 added the awaiting other PR Depends on another PR label Jun 20, 2026
@markus7017 markus7017 added the work in progress A PR that is not yet ready to be merged label Jun 20, 2026
@markus7017

Copy link
Copy Markdown
Contributor Author

Review actions taken

All Copilot inline comments addressed:

  • Test placement — test entries moved into the correct provider methods ( for service names, for model IDs).
  • XML channel labels — XML was fully refactored; stale channel5/status5/meter5 entries with wrong i18n keys no longer exist.

Additional hardening:

  • , , now dispatch to / for the profile (Pro RGBWW PM dual-CCT mode). Previously these hardcoded methods which the firmware rejects for CCT components.
  • : brightness=0 is no longer sent as a parameter; turn-off relies on (consistent with the earlier fix).
  • Added profile detection tests for and profiles.
  • Added service-name and model-ID discovery tests for both new thing types.

455 tests pass, 0 failures.

@openhab-bot

Copy link
Copy Markdown
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/shelly-binding/56862/5689

@andrewfg

andrewfg commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@andrewfg I need you review/test support here, I'm not so deep in the color profiles etc.

@markus7017 see my comment #19227 (comment) above. In my own PR #21286 I have -- in anticipation of your PR here being merged -- already written the code to manage the different profiles RGB, RGBW, RGBX2LIGHT, RGBCCT, CCTX2 and plain LIGHT using the OH Core LightModel. We are indeed in a bit of a quandary here, since my work depends on anticipation of yours, and equally yours should probably anticipate mine. There could be two ways forward -- 1) you just "rough it" in this PR and I can fine tune it in mine, or 2) we try to cross co-ordinate. => WDYT?

PS if you want to look at my PR the main themes are threefold..

  1. Your ShellyColorUtils is completely replaced by my ShellyLightModel; this wraps the standard OH Core LightModel, and implements the specific behaviour variants for all existing and new Shelly lights (including the profile specific behavior).
  2. Otherwise the major change is in adapting ShellyLightHandler to use ShellyLightModel instead of ShellyColorUtils; and to pipeline transactions OH Core <=> Shelly Binding <=> API <=> Remote Device in both directions.
  3. There are some necessary tweaks in your API wrapper classes in order to accomodate 1. and 2.

@andrewfg

Copy link
Copy Markdown
Contributor

@wborn Could you please trigger a new Codex run

@wborn not knowing the capabilities of Codex .. can it do a cross reference of this PR to #21286 to identify anything that is on the wrong track? .. probably not ..

@wborn

wborn commented Aug 20, 2026

Copy link
Copy Markdown
Member

I'll give it a try to see what happens!

@wborn

wborn commented Aug 20, 2026

Copy link
Copy Markdown
Member

@andrewfg it thought long and deep to come to this conclusion:


The component modeling in this PR looks like something #21286 should build on rather than replace. The apiComponent information and the settings.lights index → Shelly RPC component/id mapping describe the actual Shelly protocol topology (RGB:0 + CCT:0, RGB:0 + Light:0/1, CCT:0/1, etc.), so that distinction needs to survive the LightModel migration.

#21286 already creates one ShellyLightModel per lightId, so the basic direction seems compatible. The part that appears to need explicit coordination after rebasing is the primary abstraction. At the moment every dirty light model can publish into the same primary group, while commands to primary resolve to light 0. For profiles such as cctx2 and rgbcct, it therefore needs to be defined whether primary represents one component or an aggregate of several components.

In particular, a composite RGB+CCT primary light could make sense, but it would need explicit routing between the separate RGB:0 and CCT:0 RPC components rather than treating them as if they were one Shelly component.

So there doesn't seem to be a reason for #19227 to duplicate or anticipate the Core LightModel abstraction. A clean split seems to be for this PR to establish the correct Shelly component discovery/addressing and existing binding channels, and for #21286 to rebase on that and define the LightModel/primary mapping.

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest changes address several of the previous issues. All five inputs are now included in the Pro RGBWW PM status/config processing, component-specific ct_range values are retained and used by the normal light-handler path, and RPC operations now translate the flat light index to the correct component-local ID.

Two functional issues still remain in the hybrid/CCT handling.

Commands to secondary lightN groups in rgbcct and rgbx2light are mapped back to the wrong settings.lights index, so they can be handled as the wrong Shelly component.

WebSocket/push CCT status updates also still use the profile-wide temperature range instead of the component-specific ct_range, which produces incorrect colorTemp percentages for customized ranges.

Requesting changes until those two remaining paths use the correct component mapping and temperature-range logic.

This review was AI-assisted.

@andrewfg

Copy link
Copy Markdown
Contributor

it thought long and deep to come to this conclusion:

Crikey! I shall have to think long and deep to figure out what that means!

@andrewfg

andrewfg commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

I guess that we really only need to agree on the hierarchy of device/component/channel-group/channel for each product variant. My working hypothesis is shown below.

I think @markus7017 if you deliver the "architecture/framework" so the correct things are discovered and created with the correct channel-groups and channels, then I shall deliver the "logic" to produce, consume, and synchronize actual data values within those channels..

BULB

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, etc.
    • Color group with: r,g,b,w, full color, effect, gain, color picker etc.
    • White (cool-warm) group with: color temperature, brightness, etc

DUO

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, etc.
    • White (cool-warm) group with: color temperature, brightness, etc

VINTAGE (PS perhaps you currently have this wrong..)

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Light (brightness only) group with: explicit brightness, implicit on-off, auto-on/off

RGBW2 COLOR MODE

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • Color group with: r,g,b,w, full color, effect, gain, color picker etc.

RGBW2 WHITE MODE

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • Four light components with:
    • Light (brightness only) group with: explicit brightness, implicit on-off, auto-on/off

RGBWW in RGB profile

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • Color group with: r,g,b, W , full color, effect, gain, color picker etc.

RGBWW in RGBW profile

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • Color group with: r,g,b,w, full color, effect, gain, color picker etc.

RGBWW in RGBCCT profile

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • Color group with: r,g,b,w, full color, effect, gain, color picker etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • White (cool-warm) group with: color temperature, brightness, etc

RGBWW in RGBX2LIGHT profile

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • One light component with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • Color group with: r,g,b,w, full color, effect, gain, color picker etc.
  • Two light components with:
    • Light (brightness only) group with: explicit brightness, implicit on-off, auto-on/off

RGBWW in LIGHT profile

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • Five light components with:
    • Light (brightness only) group with: explicit brightness, implicit on-off, auto-on/off

RGBWW in CCTX2 profile

  • Basic device component with:
    • Status group with: firmware, signal strength, alarm, updates, last event, etc,
    • Meter group with: power, energy, etc.
  • Two light components with:
    • Control group with: on-off, auto-on/off, last event, etc.
    • White (cool-warm) group with: color temperature, brightness, etc

@lsiepel

lsiepel commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Shelly PR’s have the strange ability to grow and grow and have a hard time to get to the finish.
Therefor it would be best to focus on getting support for this device done.

That being said, the lightmodel discussion is best to move to the dedicated issue at #21259

@andrewfg

Copy link
Copy Markdown
Contributor

Therefor it would be best to focus on getting support for this device done.

@lsiepel I gave my feedback because @markus7017 asked for it. I see no point in rushing through a potentially wrong architecture and regretting it later.

@andrewfg andrewfg left a comment

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.

I have a few comments, summarised as follows:

  1. in RGBWW PM if the first component is a color component it is RGB:n and not RGBW:n i.e. no white channel.
  2. in RGBWW PM any CCT:n component is a WHITE group with cool-warm, and brightness (plus either implicit, or explicit on-off, and auto-on/off, etc.)
  3. in RGBWW PM any LIGHT:n component is a LIGHT group with brightness (plus either implicit, or explicit on-off, and auto-on/off, etc.)

See this https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyProRGBWWPM


EDIT: it may be worth looking forward to #20909 and keeping in mind the following:

  • The docs say that Duo Gen 3 supports cct:0 profile. So it should probably be modelled the same as cct:n here.
  • The docs say that Color Bulb Gen 3 supports rgbcct:0 profile. Note that it is rgbcct:0 and not rgbwcct:0. Also this looks superficially the same as the rgbcct:0 profile in this PR. HOWEVER in the RGBWWPM the rgb:0 and cct:0 are independent components that can each be operated stand alone. WHEREAS in the Color Bulb Gen 3 they are mutually exclusive components where either the rgb or the cct mode is selected via the operating mode switch.

| | red | Dimmer | r/w | Red brightness: 0..100% (control only the red channel) |
| | green | Dimmer | r/w | Green brightness: 0..100% (control only the green channel) |
| | blue | Dimmer | r/w | Blue brightness: 0..100% (control only the blue channel) |
| | white | Dimmer | r/w | White brightness: 0..100% (control only the white channel) |

@andrewfg andrewfg Aug 21, 2026

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.

As described here https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyProRGBWWPM the device has 5 outputs which can be used in various combinations:

  • 5x individual light -- LIGHT profile
  • 1x RGB group, plus 2x individual light -- RGBX2LIGHT profile
  • 1x RGB group, plus 1x cool-warm pair -- RGBXCCT profile
  • 2x cool-warm pair -- CCTX2 profile

Note that the first group seems always to be RGB and not RGBW.

Therefore I would assume that the RGB mode will NOT expose a White component. i.e. RGB -only..

See my comments here #19227 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still a concrete RGB-vs-RGBW issue here. colorSettingsRGB reuses the colorFull channel type, which still offers white as an option.

The Pro RGBWW PM exposes an RGB component, not an RGBW component. Selecting white therefore makes handleFullColor() produce RGBW = 0,0,0,255, but the RGB RPC path only sends the RGB values and ignores the white value. The device consequently receives RGB = 0,0,0.

An RGB-only component should therefore not expose the White option, unless White is explicitly translated to a valid RGB value.

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.

the RGB RPC path only sends the RGB values and ignores the white value. The device consequently receives RGB = 0,0,0.

This is fixed by my PR


`Note`:
`rgbcct` and `rgbx2light` combine the RGB component above with additional CCT (`rgbcct`) or Light
(`rgbx2light`) components. Each additional component is exposed as its own `light1`/`light2` group

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.

Each additional component is exposed as its own light1/light2 group

This applies only to LIGHT or RGBX2LIGHT and not to RGBCCT or CCTX2

.. also (nit) in OH markdown convention every sentence must be on a new line.

(`rgbx2light`) components. Each additional component is exposed as its own `light1`/`light2` group
(same layout as the `light` profile below) with its own independent meter (`meter2`/`meter3`).
Since every profile has more than one meter, the device also gets the aggregated `device#accumulatedPower`/`device#totalEnergy` channels described in the general notes on channels above.

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.

Probably you should add a whole new table of channels for RGBCCT with its own comments etc.

@@ -12,16 +12,16 @@
<channel-groups>

@andrewfg andrewfg Aug 21, 2026

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.

I think in your prior code you had used typeId rgbwpmChannel and now you are proposing to rename it as rgbwChannel.

Probably these group-types are wrong for two reasons:

  1. xyzChannel should really be xyzComponent

  2. It is hard to tell from the diff, but it looks like you do not have a group for all RGBWW profiles. What you need is the following:

    • RGB component (NOTE: excluding W) .. typeId rgbComponent
    • CCT cool-warm component .. typeId cctComponent
    • LIGHT brightness-only component .. typeId lightComponent

See my comments in the ReadMe above.
And also here #19227 (comment)

// RGBW2 devices
public static final Set<ThingTypeUID> GROUP_RGBW2_THING_TYPES = Set.of( //
THING_TYPE_SHELLYRGBW2_COLOR, THING_TYPE_SHELLYRGBW2_WHITE, THING_TYPE_SHELLYPLUSRGBWPM);
THING_TYPE_SHELLYRGBW2_COLOR, THING_TYPE_SHELLYRGBW2_WHITE, THING_TYPE_SHELLYPLUSRGBWPM,

@andrewfg andrewfg Aug 21, 2026

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.

I think RGBWWPM is not strictly an RGBW thing type since it has no W component.

See other comments above and below

if (lights != null) {
ShellySettingsRgbwLight light = lights.get(idx);
String whiteGroup = profile.isRGBW2 && !profile.inColor ? group : CHANNEL_GROUP_WHITE_CONTROL;
String whiteGroup = profile.isRGBW2 && !profile.hasColorTag(idx) ? group : CHANNEL_GROUP_WHITE_CONTROL;

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.

See comments about difference between RGB and RGBW

.add(new ShellyChannel(m, CHGR_LIGHTCH, CHANNEL_TIMER_ACTIVE, "timerActive", ITEMT_SWITCH))
// RGBW2-white / RGBW PM-white
.add(new ShellyChannel(m, CHGR_LIGHT_IDX, CHANNEL_BRIGHTNESS, "whiteBrightness", ITEMT_DIMMER))
.add(new ShellyChannel(m, CHGR_LIGHT_IDX, CHANNEL_COLOR_TEMP, "whiteTemp", ITEMT_DIMMER))

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.

I think not. I think it is as follows..

  • LIGHT components have a LIGHT group which never has a color temperature channel. It only has explicit brightness (and implicit on-off).
  • CCT components have WHITE group which has brightness, cool-warm color temperature, .. and perhaps either a) a CONTROL group, or b) includes implicit on-off, and auto-on/off etc.

@@ -1 +1 @@
/*

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.

Don't worry too much about the logic here. My PR almost certainly re-writes it..

@markus7017

Copy link
Copy Markdown
Contributor Author

I agree with @lsiepel, we should focus on fixes here, create a new pr to complete the basics and then integrate light control and finally the Duo bulb

On rgbcct/rgbx2light profiles, the indexed light1..n channel groups
start after the leading color component slot, so the group number
alone was one short of the flat settings.lights index. Add back
profile.getColorComponentCount() when reversing the group name to an
index, mirroring getControlGroup()'s forward mapping.

Signed-off-by: Markus Michels <markus7017@gmail.com>
setAutoTimer built config.name from the flat settings.lights index,
but on RGBW2 hybrid profiles that index doesn't match the on-device
component id used elsewhere in the same call, so the name was
frequently wrong. This request only ever changes the auto-timer, so
just leave the name unset instead of sending an incorrect one.

Also drops the now-unused displayName field from LightRpcMethods.

Signed-off-by: Markus Michels <markus7017@gmail.com>
updateLightMode() converted light.temp with profile.minTemp/maxTemp
instead of the per-component profile.getMinTemp(i)/getMaxTemp(i),
reporting the wrong CCT percentage for custom-ranged components
pushed over the WebSocket status path. The polling path already used
the per-component range.

Signed-off-by: Markus Michels <markus7017@gmail.com>
@markus7017

Copy link
Copy Markdown
Contributor Author

@wborn Pushed fixes for the two remaining issues from your last review:

  • Fix: ShellyApiLightUtil.getLightIdFromGroup() now reverses getControlGroup() correctly — it adds profile.getColorComponentCount() back in, so on rgbcct/rgbx2light a command sent to light1/light2 resolves to the right settings.lights index instead of being off by the leading color component. Replied inline.
  • Fix: updateLightMode()'s WebSocket/push-status path now converts light.temp with the per-component profile.getMinTemp(i)/getMaxTemp(i) instead of the profile-wide default, matching the polling path.

Also found and fixed a related issue while in there: Shelly2ApiRpc.setAutoTimer() was building config.name from the flat settings.lights index, which doesn't match the on-device component id on hybrid profiles — dropped that field entirely since this call only ever changes the auto-timer, and removed the now-unused displayName field it depended on.

Full build (spotless, tests, SAT) passes; added regression tests for both hybrid profiles.

Re: the channel/group modeling discussion — agreed with @lsiepel above to keep this PR scoped to fixes and move that to a follow-up PR.

The existing updateLightMode hybrid-profile test only asserted any()
for the CHANNEL_COLOR_TEMP update, so it would not have caught a
regression in the per-component ct_range conversion. Add a test that
sets a custom minTemp/maxTemp on the CCT component and asserts the
resulting percentage, which fails against the pre-fix profile-wide
range.

Signed-off-by: Markus Michels <markus7017@gmail.com>
@andrewfg

Copy link
Copy Markdown
Contributor

move that to a follow-up PR.

@markus7017 please do not open another PR yourself. Instead I will include any necessary changes or adaptions in my own PR. Otherwise we have too many independently moving parts.

@markus7017

Copy link
Copy Markdown
Contributor Author

this one is already big, I think we should have a step in between, but up to you

Anything else for this one?

@andrewfg

Copy link
Copy Markdown
Contributor

Anything else for this one?

No.

think we should have a step in between, but up to you

I am trying to parallel track most of what you are doing here and in the Gen 3 light PR, but juggling a 3 way merge is hard; and a 4 way merge would be harder yet. So let's finish this and the Gen 3 lights asap, and then I have a stable base to work from.

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous review findings have been addressed.

One functional issue remains: the Pro RGBWW PM exposes an RGB component in the rgbcct and rgbx2light profiles, but the Thing definition still exposes RGBW controls, including white. The RPC implementation does not support white for an RGB component, so that advertised control cannot work.

The Pro color component should expose RGB-only controls, with the README updated accordingly.

This review was AI-assisted.

@markus7017

Copy link
Copy Markdown
Contributor Author

uff, the is a multi dimensional feature matrix 🤪
will fiy this later

@markus7017

Copy link
Copy Markdown
Contributor Author

So let's finish this and the Gen 3 lights asap, and then I have a stable base to work from.

ok, let's merge this one, then I'll rebase & review the Duo PR and you take it fron there

@andrewfg

Copy link
Copy Markdown
Contributor

will fiy this later (assuming you meant "fix" ..)

@markus7017 This error here is about removing the excess W channel from the group. My PR is (so far) focussed on the channel command/update process assuming that the actual list of groups and channels were correct from your side.

Therefore I think we could split this removal process into two parts:

  1. remove the excess W channel from thing-type xml and the createChannels() method
  2. my PR ignores any W channel in this case (it already ignores it)

So part 2. is already solved in my scope. The only question is if a) you want to remove the excess W channel from thing-type xml and from createChannels() in this PR?, or b) if I shall fix the thing-type.xml and createChannels() method in my PR? (As mentioned before, I think creating a third piggy- in-the-middle PR makes no sense). I would slightly prefer a) if possible, but the alternative is if you just give me the code snippets to include in mine. As you wish.

The rgb:0 component on the Pro RGBWW PM has no physical white output,
but the color channel group reused the RGBW variant's channel-group
type, exposing a white channel that always read/wrote 0%.

Signed-off-by: Markus Michels <markus7017@gmail.com>
@markus7017

Copy link
Copy Markdown
Contributor Author

Fixed the excess white channel: Pro RGBWW's rgb:0 has no white output, so color now uses a dedicated colorSettingsRGB group-type (no white channel) instead of reusing RGBW's. Went with option (a), scoped to this PR. Also replied on the two open threads — both already fixed on the branch (d33981e, 9703d68).

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One additional functional issue remains: brightness commands for secondary CCT/Light components can update the reported state of the independent RGB component instead of the component that was commanded.

The existing RGB-vs-RGBW feedback also still applies. In particular, the RGB-only color group still exposes the shared colorFull White option, although that value cannot be represented by the device's RGB component.

The previously reported issues around component IDs, CCT ranges, input count, metering, timers, and the explicit White channel appear fixed in the current HEAD.

This review was AI-assisted.

@@ -130,7 +131,7 @@ public boolean handleDeviceCommand(ChannelUID channelUID, Command command) throw
col.setGain(setColor(lightId, SHELLY_COLOR_GAIN, command, SHELLY_MIN_GAIN, SHELLY_MAX_GAIN));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command is sent to the correct secondary CCT/Light component, but the optimistic state update afterward targets the wrong openHAB channel.

For example, in the rgbcct profile:

control = RGB component
light1 = CCT component

A command such as light1#brightness = 50 is correctly sent to the CCT component, but this code then updates control#power to ON. That incorrectly changes the reported state of the independent RGB component.

The ON/OFF brightness path has a similar issue because it updates the hard-coded white#brightness group instead of the current lightN group.

Please derive the optimistic update target from the current component/group and add a regression test for brightness commands on a secondary component of a hybrid profile.

@andrewfg

Copy link
Copy Markdown
Contributor

In particular, the RGB-only color group still exposes the shared colorFull White option, although that value cannot be represented by the device's RGB component.

That AI statement is wrong!! RGB 255,255,255 is white!!

The rgb:0 component has no white parameter, so selecting "white" on the
colorFull channel sent rgb=0,0,0 with a dropped white value, switching
the light off instead of producing white. Mix full RGB (255,255,255)
instead for this component, and recognize that combination when
reporting the current colorFull state back.

Signed-off-by: Markus Michels <markus7017@gmail.com>
@markus7017

Copy link
Copy Markdown
Contributor Author

On the colorFull white debate: confirmed against the RGB.Set/GetStatus API spec — RGB component has only rgb:[r,g,b] + brightness, no white field. Root bug: colorFull's "white" set rgb=0,0,0 (white value silently dropped for the RGB-only component), turning the light off. Fixed in a928c4a: "white" now mixes rgb:[255,255,255] for this component, and status reporting recognizes that combination as "white" too.

@markus7017 markus7017 removed the work in progress A PR that is not yet ready to be merged label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

7 participants