Skip to content

Conversation

@xLerate
Copy link

@xLerate xLerate commented Jan 23, 2026

The PR looks bigger than it actually is. I had to swap some code blocks.

FYI: converting colors here is useful when Zigbee2MQTT is connected to Matterbridge-Zigbee2MQTT for example, because most Matter controllers (Alexa, Google Home) primarily send HSV colors.

… light-color converter; added hsv->xy color conversion to support devices with xy color mode only, when sent hsv color
@Koenkk
Copy link
Owner

Koenkk commented Jan 24, 2026

Could you add a test case for this to

describe("light_onoff_brightness", () => {
?

@xLerate
Copy link
Author

xLerate commented Jan 26, 2026

added two tests for hsv color sent to xy color only device

  • xy color mode forced by color: { mode: ["xy"] }
  • xy color mode given by color: true (which also defaults to xy color only)
    for both tests the incoming hsv color has to be converted to xy color and sent to the device via moveToColor command.

tests are added in own block (-> "light_color") inside toZigbee.test.ts

@Koenkk
Copy link
Owner

Koenkk commented Jan 27, 2026

I checked this against the z2m tests cases but it makes https://github.com/Koenkk/zigbee2mqtt/blob/3a49c95786c2fba749e7696aab4cc38e467d2c4c/test/extensions/publish.test.ts#L1322 fail:

Screenshot 2026-01-27 at 20 40 33

This test runs against the Philips 7146060PH which uses the default args so it should support ehancedHue:

Could you check?

@xLerate
Copy link
Author

xLerate commented Jan 27, 2026

Are supportsHueAndSaturation and supportsEnhancedHue independent of each other. Or does supportsEnhancedHue implies supportsHueAndSaturation, meaning supportsEnhancedHue is as a special case of supportsHueAndSaturation ?

@Koenkk
Copy link
Owner

Koenkk commented Jan 28, 2026

Or does supportsEnhancedHue implies supportsHueAndSaturation, meaning supportsEnhancedHue is as a special case of supportsHueAndSaturation ?

Yes, when supportsEnhancedHue = true, then supportsHueAndSaturation must also be true.

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.

2 participants