Skip to content

[hue] Improve support for third party lights - #21062

Open
andrewfg wants to merge 72 commits into
openhab:mainfrom
andrewfg:hue-min-dim-level
Open

[hue] Improve support for third party lights#21062
andrewfg wants to merge 72 commits into
openhab:mainfrom
andrewfg:hue-min-dim-level

Conversation

@andrewfg

@andrewfg andrewfg commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This PR resolves many issues with "exotic" light models. In this context "exotic" mostly means lights made by third parties other than Philips / Signify ("Friends of Hue") which are therefore not certified for full compliance with the Hue API v2. Albeit it covers a special case with the Philips / Signify "Signe" model as well.

For testing purposes the JAR is here:

Specifically this PR does the following:

  1. In the prior version of the binding code I had wrongly assumed that the min .. max range of the dimming channels were "minimum dimming level .. 100%). This PR refactors the code so the min .. max range of the dimming channels are now "0% .. 100%" regardless of the actual minimum dimming level.

  2. Therefore, this PR changes the threshold for a light being deemed ON from brightness >= minimum dimming level to brightness > 0.0.

  3. Some non certified lights fail to provide a minimum dimming level anyway - see [hue] IKEA Trådfri bulb turns off when setting low brightness #21057 So with 2. above, this PR resolves this issue.

  4. Some certified lights do provide a minimum dimming level of 0.0 (e.g. Philips Signe) and currently therefore sending 0.0 to the bulb fails to turn it off. So with 2. above (changing b >= 0.0 check to bri > 0.0) this PR ensures that a precise 0.0 command will turn the lamp off.

  5. Some non certified lights fail to provide minimum and maximum supported Mirek values. So analogous to the case with dimming level above, this PR defaults to the min .. max range of 153Mk .. 500Mk.

  6. Previously the binding did not use the Gamut provided by certified lights. It always used the default Gamut instead. As a general rule Philips / Signify lights do provide a Gamut, whereas non certified products generally do not. With this PR now we use the Gamut if provided, and only use the default if none is provided.

  7. Some non certified lights provide invalid minimum and maximum supported Mirek values. So this PR checks those values and if necessary defaults to the min .. max range of 153Mk .. 500Mk.

  8. As a consequence of the above changes, the thing handler calls a new extra added method that ensures the light state cache contains all the required parameters for mirek schema, and gamut -- be they provided by the device itself in its initial GET response, or otherwise using the system defaults.

  9. Often non certified lights will respond to a PUT request with an HTTP 207 error rather than HTTP 200. In the past, when the bridge returned an HTTP 207 response "soft off" the binding would produce an INFO log output. This PR reduces that to DEBUG level.

  10. On some non certified lights, when the bridge returned an HTTP 207 response, the devices would not send an SSE event update with the new state. This PR adds a loopback whereby the JSON of the PUT request that caused the 207 response is looped back to the binding as a dummy event. This prevents the states in the UI from "flapping".

  11. As a consequence of my misunderstanding about the min .. max range of the dimming channels, the binding was incorrectly calculating the threshold to be used when determining the changeover point between sending a hard on or a hard off command. This applied in particular to non certified products that do not provide their own minimum dimming level. This PR adds an extra Setters method that fixes the threshold and implements the hard on/off logic.

  12. The prior version of the binding code would wrongly produce Channel State values of UNDEF in some cases when certain DTO fields were missing. Again in particular it occurred for non certified products. In this PR some UNDEF cases are eliminated, and instead an exception may be thrown at runtime (see next point).

  13. .. therefore, in this PR now when a device delivers a DTO with incomplete data, rather than producing the opaque UNDEF state, the binding now logs the detailed error with a full stack trace instead. The extra transparency should help fixing future non certified light models.

  14. In order to test the above changes I purchased both a Lidl Livarno TS0502A E27 CT bulb that should be similar to the TS0505A of @kaikreuzer and also an Ikea Tradfri 1055 lumen E27 bulb that should be similar to the Tradfri lamp of @jlaur, for testing the code. And as far as I can tell the errors reported in the below mentioned issues have now been resolved.

  15. It seems that the (also non certified) "Ikea Tradfri" bulbs suffer the same bug as the "LK Wiser Dimmer". So this PR extends the same fix to those Tradfri bulbs.

  16. Furthermore, if a room or zone contains such a Tradfri or LK Wiser light, then the bug also occurs on the respective room or zone. So this PR applies the same fix to such things. It also applies the fix to the "all lights zone".

  17. Some older (legacy) lights operate in a dual mode manner. Either they are in 'CT' mode, or 'XY' mode. By contrast the API v2 is designed to operate in a mode-less manner. In such mode-less operation the bridge and respective lights provide notifications containing both colour temperature and color xy values which are simultaneously valid. Whereas older legacy lights provide notifications where EITHER the colour temperature OR the color xy value is valid. And such notifications may be interleaved, thus causing flapping between channel states. So this PR introduces a new LegacyLightState class that implements a state machine to model the the operating mode of such lights, and apply a work-around to processes the notifications to only present values that belong to the correct legacy mode.

  18. The Junit tests have been adapted to the above. And a new test class has been introduced to test the LegacyLightState state machine class.

Resolves #21057
Resolves #21044
Resolves #21045
Resolves #21043
Resolves #21011

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

andrewfg added 3 commits June 26, 2026 14:28
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg self-assigned this Jun 26, 2026
@andrewfg andrewfg added the bug An unexpected problem or unintended behavior of an add-on label Jun 26, 2026
@andrewfg
andrewfg marked this pull request as draft June 26, 2026 13:48
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg changed the title [hue] Tweak minimum dimming level [hue] Tweaks to minimum dimming level Jun 26, 2026
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg
andrewfg requested review from Copilot and maniac103 June 26, 2026 15:51

This comment was marked as outdated.

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg changed the title [hue] Tweaks to minimum dimming level [hue] Tweaks to min dim level and min/max color temperature Jun 26, 2026
@andrewfg andrewfg changed the title [hue] Tweaks to min dim level and min/max color temperature [hue] Tweaks to min dim level and min/max color temp. Jun 26, 2026
andrewfg added 3 commits June 26, 2026 19:15
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
andrewfg added 7 commits June 26, 2026 19:47
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
- harmonize contract between handler and resource
- log stack trace if critical field is missing
- fix brightness and on/off handling
- fix test cases for brightness and on/off and missing critical field
- apply full dto's for min dim level, mirek schema, gamut
- change color transforms to use actual gamut if available

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
- support delta commands
- refactor hard on/off into own method
- differ behavior of light and grouped light
- move two methods to other classes

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg
andrewfg requested a review from wborn August 10, 2026 10:45

@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.

AI re-review

AI re-reviewed the current head 5bf1fffe387802a8dcd7e36964545db8c906d744 after the latest delta-command revert. The previous INCREASE / DECREASE findings have been addressed and are no longer applicable.

Changes are still requested for the following regression risks:

  • The optimistic loopback is currently triggered for every successful response containing an errors entry, rather than only for the known benign attribute_may_have_no_effect case. This can publish a requested state even when an attribute was actually rejected.
  • The recursive room/zone workaround detection adds per-child HTTP GETs during initialization and can repeatedly fetch the same devices through different room/zone/home hierarchies.
  • The existing unresolved transition-duration concern still applies: #21062 (comment). The new room/zone propagation makes its scope broader because a single affected child can cause grouped OFF commands to include dynamics.duration = 0, changing the transition behavior of unaffected lights in the same group.

The updateLightCacheRequiredFields() documentation and corresponding PR description are also stale after the recent refactoring. The remaining delta DTO/classes and setters appear unused after the revert and could be removed as non-blocking cleanup.

The LegacyLightState implementation looks internally consistent, but targeted hardware regression testing is still advisable for CT → color, color → CT, repeated XY notifications, restart/power-cycle behavior, and commands while soft-off.

A human maintainer review is still needed after the issues above are addressed.

@jlaur jlaur 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.

A few very minor comments/questions in addition to the AI comments.

I have verified that #21057 is fixed and that the LK Wiser work-around still works.

I have not tested anything related to color temperature, i.e. that the other linked issues are fixed. Hopefully @kaikreuzer can confirm that the scenarios he experienced are now as expected.

@jlaur jlaur changed the title [hue] Improvements for exotic light models [hue] Improve support for third party lights Aug 10, 2026
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg
andrewfg requested review from jlaur and wborn August 10, 2026 17:27
@andrewfg

This comment was marked as outdated.

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
- fix off transition work-around intitialization
- fix compiler warning

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
wborn
wborn previously requested changes Aug 11, 2026

@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.

AI re-review

AI re-reviewed the current head 388f53b63aa602fe86aebf9d3eeb912cf2ac8599.

The latest changes address the previous repeated per-child HTTP lookup concern and substantially improve the 207 error handling. The earlier INCREASE / DECREASE findings also remain addressed after those changes were reverted.

Changes are still requested for the three issues noted inline: mixed 207 errors can still trigger an optimistic loopback, fixed-width Mirek schemas can cause a zero-denominator percentage calculation, and the off-transition work-around ID set is concurrently rebuilt and read without safe publication.

The existing unresolved TRÅDFRI transition-duration concern still applies, and point 8 of the PR description should still be updated because updateLightCacheRequiredFields() now fills the Mirek schema and gamut, but not a minimum dimming level.

A human maintainer review is still needed after these issues are addressed.

@andrewfg

Copy link
Copy Markdown
Contributor Author

The existing unresolved TRÅDFRI transition-duration concern still applies

I have no idea what it is talking about. So ignoring it.

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@wborn

wborn commented Aug 11, 2026

Copy link
Copy Markdown
Member

I have no idea what it is talking about.

The existing unresolved TRÅDFRI transition-duration concern still applies

I have no idea what it is talking about. So ignoring it.

Now you are ignoring @jlaur 😉

#21062 (review)

@andrewfg

Copy link
Copy Markdown
Contributor Author

Now you are ignoring @jlaur 😉
#21062 (review)

Well that is AFAIK resolved, so the AI was wrong.

@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.

AI re-review

The latest changes address the previously raised 207 handling, startup lookup, and workaround-set concurrency concerns.

One remaining correctness issue was found in the refresh of the OFF-transition workaround IDs: an unsuccessful refresh can still publish a partial result and discard the previous known-good state.

There is also one narrower question about the TRÅDFRI 1055l workaround. The device testing indicates that dynamics is required for combined on:false + dimming requests, while a plain on:false succeeds without it. The current implementation also adds dynamics to plain OFF requests. This may be intentional for grouped resources, so this is raised as a question rather than as a confirmed regression.

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@wborn

wborn commented Aug 12, 2026

Copy link
Copy Markdown
Member

Great! It's functionally correct now. 👍
Catching bugs and edge cases in the review phase saves debugging them after the code is merged.

@wborn
wborn dismissed their stale review August 12, 2026 05:13

Issues resolved

@jlaur jlaur 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.

LGTM. I would still like to hear if this resolves @kaikreuzer's color temperature issues, as these fixes accounts for most of the changes made here.

: "%s .. %s".formatted(toKelvin(mirekMinimum), toKelvin(mirekMaximum));
}

public static int toMirek(double kelvinValue) {

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.

Minor note: This appears to be unused. Left-over or on purpose?

@andrewfg

Copy link
Copy Markdown
Contributor Author

would still like to hear if this resolves @kaikreuzer's color temperature issues

Indeed. Please don't merge until @kaikreuzer has tested.

@jlaur jlaur added the additional testing preferred The change works for the pull request author. A test from someone else is preferred though. label Aug 15, 2026
@kaikreuzer

Copy link
Copy Markdown
Member

I'll try to test asap!

@kaikreuzer

Copy link
Copy Markdown
Member

@andrewfg I've just tested the latest version - unfortunately with no improvements over the last time. 😢
Two of my lights are still not behaving as desired. Here's the log for one of them with my test rule from above:

2026-08-19 16:05:57.977 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> handleCommand() put resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:05:58.983 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> handleCommand() put resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:05:59.051 [TRACE] [.hue.internal.connection.Clip2Bridge] - onEventData() data:[{"creationtime":"2026-08-19T14:05:59Z","data":[{"color":{"xy":{"x":0.3122,"y":0.3282}},"color_temperature":{"mirek":153,"mirek_valid":true},"id":"cf519310-5af8-40ba-b645-4e3b6e9baf0b","id_v1":"/lights/52","owner":{"rid":"9d33eb95-63a7-43ef-bd7d-fe0350b2fa84","rtype":"device"},"service_id":0,"type":"light"}],"id":"81ab04ca-5271-4cf0-a19c-725d260b1f78","type":"update"}]
2026-08-19 16:05:59.052 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() from resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:05:59.052 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() operating mode work-around legacy state 'mode=COLOR_TEMP, mirek=153, colorTempXY=[0,3122,0,3282], fullColorXY=null' transformed [188.5715,4.1300,100]->[188.5715,4.1300,100] and 0->0
2026-08-19 16:05:59.053 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color' update with '188.5715,4.1300,100' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.053 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-xy-only' update with '188.5715,4.1300,100' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.053 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature' update with '0' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.054 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature-abs' update with '6535.947712418300653594771241830065 K' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.054 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'dimming-only' update with '100' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.054 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'on-off-only' update with 'ON' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.054 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'alert' update with 'NO_ACTION' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.054 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'last-updated' update with '2026-08-19T16:05:59.054827+0200' (fullUpdate:false, isDefined:true)
2026-08-19 16:05:59.055 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> onResource() consumed resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light, flags:12
2026-08-19 16:05:59.985 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> handleCommand() put resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:00.070 [TRACE] [.hue.internal.connection.Clip2Bridge] - onEventData() data:[{"creationtime":"2026-08-19T14:05:59Z","data":[{"dimming":{"brightness":77.13},"id":"2cecd40e-88c5-4dfc-acba-6bbb09d8ad54","id_v1":"/groups/0","owner":{"rid":"8b6fcddd-1575-409b-8d9b-1d281dc92b34","rtype":"bridge_home"},"type":"grouped_light"}],"id":"dc192f22-a6c5-46b2-9eba-3eb6f4e7800d","type":"update"},{"creationtime":"2026-08-19T14:06:00Z","data":[{"id":"cf519310-5af8-40ba-b645-4e3b6e9baf0b","id_v1":"/lights/52","on":{"on":false},"owner":{"rid":"9d33eb95-63a7-43ef-bd7d-fe0350b2fa84","rtype":"device"},"service_id":0,"type":"light"},{"dimming":{"brightness":0.0},"id":"cf519310-5af8-40ba-b645-4e3b6e9baf0b","id_v1":"/lights/52","owner":{"rid":"9d33eb95-63a7-43ef-bd7d-fe0350b2fa84","rtype":"device"},"service_id":0,"type":"light"}],"id":"e746a9f7-9241-4e4e-8937-dab35ec300c0","type":"update"}]
2026-08-19 16:06:00.071 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() from resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:00.072 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() operating mode work-around legacy state 'mode=COLOR_TEMP, mirek=153, colorTempXY=[0,3122,0,3282], fullColorXY=null' transformed [188.5715,4.1300,0]->[188.5715,4.1300,0] and 0->0
2026-08-19 16:06:00.072 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color' update with '188.5715,4.1300,0' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.072 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-xy-only' update with '188.5715,4.1300,100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.073 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature' update with '0' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.073 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature-abs' update with '6535.947712418300653594771241830065 K' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.073 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'dimming-only' update with '0' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.073 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'on-off-only' update with 'OFF' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.073 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'alert' update with 'NO_ACTION' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.074 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'last-updated' update with '2026-08-19T16:06:00.074050+0200' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:00.074 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> onResource() consumed resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light, flags:12
2026-08-19 16:06:00.988 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> handleCommand() put resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:01.018 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 command '100' for channel 'hue:device:1:3c125de3-8baf-4b41-a9b1-0617483ebfe5:color-temperature' succeeded with error(s): device (light) cf519310-5af8-40ba-b645-4e3b6e9baf0b is "soft off", command (.color_temperature.mirek) may not have effect
2026-08-19 16:06:01.019 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> loopBackNotify() with resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:01.019 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() from resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:01.020 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() operating mode work-around legacy state 'mode=COLOR_TEMP, mirek=500, colorTempXY=[0,5267,0,4133], fullColorXY=null' transformed [35.462,74.42800,0]->[35.462,74.42800,0] and 100->100
2026-08-19 16:06:01.020 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color' update with '35.462,74.42800,0' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.020 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-xy-only' update with '35.462,74.42800,100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.020 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature' update with '100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.021 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature-abs' update with '2000 K' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.021 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'dimming-only' update with '0' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.021 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'on-off-only' update with 'OFF' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.021 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'alert' update with 'NO_ACTION' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.021 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'last-updated' update with '2026-08-19T16:06:01.021693+0200' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:01.021 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> onResource() consumed resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light, flags:12
2026-08-19 16:06:01.995 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> handleCommand() put resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:02.083 [TRACE] [.hue.internal.connection.Clip2Bridge] - onEventData() data:[{"creationtime":"2026-08-19T14:06:02Z","data":[{"id":"cf519310-5af8-40ba-b645-4e3b6e9baf0b","id_v1":"/lights/52","on":{"on":true},"owner":{"rid":"9d33eb95-63a7-43ef-bd7d-fe0350b2fa84","rtype":"device"},"service_id":0,"type":"light"},{"dimming":{"brightness":100.0},"id":"cf519310-5af8-40ba-b645-4e3b6e9baf0b","id_v1":"/lights/52","owner":{"rid":"9d33eb95-63a7-43ef-bd7d-fe0350b2fa84","rtype":"device"},"service_id":0,"type":"light"}],"id":"9ad10acb-c8fd-4f44-b23e-cbc6a73cdd26","type":"update"}]
2026-08-19 16:06:02.084 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() from resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light
2026-08-19 16:06:02.085 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateChannels() operating mode work-around legacy state 'mode=COLOR_TEMP, mirek=500, colorTempXY=[0,5267,0,4133], fullColorXY=null' transformed [35.462,74.42800,100]->[35.462,74.42800,100] and 100->100
2026-08-19 16:06:02.085 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color' update with '35.462,74.42800,100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.085 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-xy-only' update with '35.462,74.42800,100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.085 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature' update with '100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.085 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'color-temperature-abs' update with '2000 K' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.086 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'dimming-only' update with '100' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.086 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'on-off-only' update with 'ON' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.086 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'alert' update with 'NO_ACTION' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.086 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> updateState() 'last-updated' update with '2026-08-19T16:06:02.086545+0200' (fullUpdate:false, isDefined:true)
2026-08-19 16:06:02.086 [DEBUG] [e.internal.handler.Clip2ThingHandler] - 9d33eb95-63a7-43ef-bd7d-fe0350b2fa84 -> onResource() consumed resource id:cf519310-5af8-40ba-b645-4e3b6e9baf0b, type:light, flags:12

Let me know if you need anything else for debugging - thanks for your efforts!

@andrewfg

andrewfg commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

unfortunately with no improvements over the last time

@kaikreuzer I lost track of what particular error applied to what particular light, so "no improvements" does not help me much. => could you please say precisely what is not working?

In the meantime, I can see from the logs the following:

  • your log is missing the full trace of the HTTP GETs and PUTs => can you please TRACE everything?
  • you are sending script commands at 1 second intervals; generally a device should send one eventData per handleCommand but your device in the first case only sent one eventData after the second handleCommand => can you please try increasing the script interval to (try to) separate into one eventData per handleCommand?

What is the exact model of this device? it may help if I can buy one on eBay and test it myself

@kaikreuzer

Copy link
Copy Markdown
Member

Sorry @andrewfg for not providing the details, I am aware that you are addressing a lot of different issues with this PR.

My issue that I am still looking to be solved is the one I described here and the rule is the one I provided there: #21018 (comment)

The problem is still that after changing CT while the light is (soft-)off, it is not considered when it is turned on.
I will run the tests this weekend with full traces and send you the details as a PM.

@andrewfg

Copy link
Copy Markdown
Contributor Author

run the tests this weekend with full traces and send you the details as a PM.

Many thanks in advance. Please try with say 10 seconds interval in your script rather than 1 second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

additional testing preferred The change works for the pull request author. A test from someone else is preferred though. bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

6 participants