Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

[Bug]: Invalid saturation light with XY color #142

Closed
MrEbbinghaus opened this issue Jul 1, 2024 · 2 comments
Closed

[Bug]: Invalid saturation light with XY color #142

MrEbbinghaus opened this issue Jul 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MrEbbinghaus
Copy link

What happened?

There seems to be a bug in the colour conversion.
It produces an out of spec saturation value for a light that is pure red.

Here is the state of the light.

min_color_temp_kelvin: 2000
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 500
supported_color_modes:
  - color_temp
  - xy
color_mode: xy
brightness: 255
color_temp_kelvin: null
color_temp: null
hs_color:
  - 359.765
  - 100
rgb_color:
  - 255
  - 0
  - 0
xy_color:
  - 0.7007
  - 0.299
mode: normal
dynamics: none
supported_features: 40

This error prevents the add-on from starting up.

Your configuration

included: light

Relevant log output

ValidationError: Validation error for attribute "currentHue": (Validation/135) Invalid value: 254.83333333333334 is above the maximum, 254.
    at TlvNumberSchema.validateBoundaries (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvNumber.js:58:13)
    at TlvNumberSchema.validate (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvNumber.js:83:10)
    at AttributeServer.validateWithSchema (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/cluster/server/AttributeServer.js:119:19)
    at AttributeServer.validator (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/cluster/server/AttributeServer.js:267:12)
    at AttributeServer.processSet (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/cluster/server/AttributeServer.js:326:10)
    at AttributeServer.setLocal (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/cluster/server/AttributeServer.js:319:10)
    at ClusterServer.result.<computed> [as setCurrentHueAttribute] (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/cluster/server/ClusterServer.js:249:98)
    at ColorControlAspect.update (file:///usr/local/lib/node_modules/matterbridge-home-assistant/lib/devices/aspects/color-control-aspect.js:46:37)
    at LightDevice.updateState (file:///usr/local/lib/node_modules/matterbridge-home-assistant/lib/devices/home-assistant-device.js:21:26)
    at async HomeAssistantMatterAdapter.create (file:///usr/local/lib/node_modules/matterbridge-home-assistant/lib/home-assistant/home-assistant-matter-adapter.js:91:9) {
  code: 135,
  clusterCode: undefined,
  fieldName: undefined
}

Version

1.5.1-72

@MrEbbinghaus MrEbbinghaus added the bug Something isn't working label Jul 1, 2024
t0bst4r added a commit that referenced this issue Jul 2, 2024
t0bst4r added a commit that referenced this issue Jul 2, 2024
@t0bst4r
Copy link
Owner

t0bst4r commented Jul 2, 2024

fixed it with 1.5.2 - please test and provide feedback 👍

@t0bst4r t0bst4r closed this as completed Jul 2, 2024
@MrEbbinghaus
Copy link
Author

Will do.

While we are at it. Do you know why the max value in Matter is $2^n-1$?
Is 0xFF… used as the value for null?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants