Homebridge-hue: Adaptive lighting on iOS14

Created on 17 Sep 2020  Â·  82Comments  Â·  Source: ebaauw/homebridge-hue

Hi there,

is there anything to to in homebridge-hue for supporting adaptive lightning in iOS14?
If so, I would love this feature :)

Kind regards,
Tim

question

Most helpful comment

Looks like adaptive lighting is now working (more or less) as per the (assumed, reverse-engineered) specs:

  • Adaptive lighting is supported only for lights that support setting the colour temperature (i.e. lights whose /lights resource exposes state.ct in the Hue or deCONZ API). On startup, Homebridge Hue should log a message when it announces to HomeKit that the light supports adaptive lighting:
    [Hue] Living 9: set homekit supported transition configuration to {"configuration":[{"iid":27,"characteristic":1},{"iid":29,"characteristic":2}]}
    (I'm using Living 9 as example light name here)
  • You can enable adaptive lighting (per light) only from the Home app, by selecting the adaptive lighting preset colour. Once enabled, it remains active, until the light's colour is changed or Homebridge restarts. Homebridge Hue logs a message when adaptive lighting is enabled:
    [Hue] Living 9: set homekit active transition count to 1
  • You can disable adaptive lighting (per light) from the Home app, by selecting another preset colour from the home app. Adaptive lighting is disabled automatically by Homebridge Hue, when light's colour is changed, from any HomeKit app, from any other API client, directly or through a scene. Note that adaptive lighting is not disabled when the light's colour temperature is changed. Homebridge Hue logs a message when adaptive lighting is disabled:
    [Hue] Living 9: set homekit active transition count to 0
  • When Homebridge restarts, Homebridge Hue has lost the adaptive lighting settings and reports the light with no adaptive lighting. However, sometimes Home doesn't take the hint and still shows adaptive lighting as enabled. In this case, select another colour preset and then (re-)select the adaptive lighting preset.
  • When enabling adaptive lighting, HomeKit sends a transition curve to the accessory (i.c. Homebridge Hue). This curve is a recipe to compute the adaptive colour temperature based on the time of day and and brightness. HomeKit should update the curve every 24 hours. The initial curve is sent from your iPhone or iPad (on which you enable adaptive lighting); the subsequent curves are sent from the home hub. Note that Homebridge Hue does not disable adaptive lighting when no subsequence curve has been received; instead it continues to apply the previous curve. When it receives a curve, Homebridge Hue logs a message:
    [Hue] Living 9: homekit transition control set to {"colorTemperature":{"iid":29,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-21T08:42:35.859Z","2.1.2.3":"73D8252359D93D1D"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.6222221851348877,"mired":357.22222900390625,"offset":0},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1045000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":1800000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000,"duration":10800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6222221851348877,"mired":357.22222900390625,"offset":755000}],"adjustmentIid":27,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}
  • Homebridge Hue applies the recipe every minute and when the light state is changed (either from HomeKit or through another API client). When the colour temperature needs to be updated, it logs a message:
    [Hue] Living 9: homekit adaptive lighting color temperature changed from 335 mired to 334 mired
  • With 100% brightness, the recipe yields colour temperature values between 181 (~5500K) and 333 (~3000K). With 10% brightness, it yields values between 333 mired (~3000K) and 500 mired (2000K). Most of my on/off lights produce 2700K (370 mired), so for full brightness, adaptive lighting looks unpleasantly white. I've added a brightnessAdjustment config.json key, to set a correction factor for the light brightness, to soften the adaptive lighting temperature. It defaults to 100% (using the light brightness) on Homebridge startup. When you set it to 50%, it applies the recipe for a half the light brightness; when you set it to 10%, it applies the 10% brightness recipe for all brightness values.

With the support of adaptive lighting, Apple has also changed how HomeKit handles colour temperature, see https://github.com/ebaauw/homebridge-hue/issues/814.

All 82 comments

Also very interested in this. It looks like Apple hasn’t updated their Specification yet though. (At least the non-commercial one.)

Same here

Don’t know yet. We’ll have to see how this will work natively with the Hue bridge. I understand Apple defined some new characteristics for that, but they’re TLV8, so we’ll have to reverse engineer the encoding of the schedule. My guess/hope is the schedule will translate to some rules or schedules on the Hue bridge, which Homebridge Hue should be able to do as well.

I have everything here - anything I can help you with? A Wireshark recording maybe?

What do you mean by “everything”? Do you actually have a light for which Home exposes the adaptive lighting? Please post some screenshots of what that looks like.

The traffic between Home / the HomeKit runtime should be HAP and is encrypted. You would probably need to setup a man-in-the-middle to see anything useful in Wireshark. I’ve seen reports that they managed to do that for the Hue API, but I haven’t for HAP. Typically, you need a HomeKit app to see how the Hue bridge exposes the adaptive lighting characteristics to HomeKit and to reverse engineer how they work. They use a modified version of HMCatalog (distributed as XCode sample app) to reverse engineer the Eve history, see https://github.com/simont77/fakegato-history#how-to-contribute. Not sure if that still compiles with the latest versions of Swift, XCode, and iOS.

Next, we need to figure out how the Hue bridge implements the adaptive lighting. I’m guessing/hoping it would be thru regular Hue bridge rules and/or schedules, and not in the light firmware. In that case, a full state dump (ph get /) before and after would suffice. If not, we might need to sniff the Zigbee traffic between the Hue bridge and the Hue lights.

Here are some screenshots: https://www.homekitauthority.com/philips-hue-homekit-adaptive-lighting-feature-close-to-launch/?amp=1

However this seems to be associated with the lights firmware.

Here are some screenshots

Do you actually have this running? Seen this before, not really useful for reverse engineering.

However this seems to be associated with the lights firmware.

What makes you think that? The linked text and previous information suggests it's linked to the bridge firmware.

If it’s linked to the firmware I am hopefully that the conbee is getting it - what do you think?

Do you actually have this running? Seen this before, not really useful for reverse engineering.

No, I do not own a hue bridge, just Deconz.

What makes you think that? The linked text and previous information suggests it's linked to the bridge firmware.

Behause according to a hueblog.de post, only Philips Hue White and Color Ambiance Lights are supported.

There are indeed some extra characteristic, as is also mentioned in homebridge/homebridge#2687.

By the way, @jensflorian, the reason that those are the only lights supported, is probably because those lights are the only ones that support changing the color temperatures (Hue has some light that have a fixed temperature and are only dimmable, and some others that only have RGB support).

By the way, @jensflorian, the reason that those are the only lights supported, is probably because those lights are the only ones that support changing the color temperatures (Hue has some light that have a fixed temperature and are only dimmable, and some others that only have RGB support).

Exactly! According to the latest non-commercial HAP docs, Color temperature characteristic only can be added to non-RGB lights and I think Adaptive Lighting characteristics only can be added to Light service with Color Temperature (and Brightness) characteristic only.

RGB lights with both cold and warm white LEDs (so not RGBW lights) are tricky: When CCT LEDs used it disables the RGB ones completely and CCT disabled when RGB used 😁
Color Temp characteristic using Mired scale for setting Color temp _(Mired value = 1000000/ Kelvin)_ and since RGB Light characteristics are using HSV colors its nearly impossible to convert it to Mired😅 I’ve spend a few days for understanding what’s happening based on Tasmota😂

BTW I’m also curious about the Adaptive Lighting code đŸ™ŒđŸ€“

Just got a mail from Eve that their lightstrip now supports adaptive lighting with the latest firmware. It does mention, that Adaptive Lighting requires a home hub, suggesting the actual adaptations are triggered from HomeKit automations, rather than by the light itself. See https://www.evehome.com/en/eve-light-strip and https://www.evehome.com/en/blog/adaptive-lighting.

I hope it will eventually be possible to imitate this feature in the plugin or in deCONZ using any CCT adjustable bulbs.

My Hue bridge just received a firmware update and now supports Adaptive Lighting. I’ll have a detailed look this weekend.

It has been implemented in the beta HAP-NodeJS. But it's accidentally called "Ambient Lightning": https://github.com/homebridge/HAP-NodeJS/blob/beta/src/accessories/Light-AmbientLightning_accessory.ts

It has been implemented in the beta HAP-NodeJS. But it's accidentally called "Ambient Lightning": https://github.com/homebridge/HAP-NodeJS/blob/beta/src/accessories/Light-AmbientLightning_accessory.ts

I've created a PR for that :)

https://github.com/homebridge/HAP-NodeJS/pull/855

Should the early beta implementation be working with 5c006f02424561f1ddd0651643888ffb2b3fdb35 installed?

That’s still work in progress. I think I have the interaction with HomeKit working (without the need for Homebridge beta or HAP-NodeJS beta), but I am still working on updating the lights.

okay - I read #814. Any way I can test this? I updated my setup to 5c006f0 but I don't see the adaptive icon in my HomeKit. I also couldn't find any other branch to try.

I'm 100% aware that this is pre alpha at this point, but I'm willing to try out some stuff at my place

Please try beta v0.12.1-2 v0.12.1.3.

I tried the latest 0.12.1.5 now, and immediately as I clicked the button to active Adaptive Lightning in the Home app on iOS 14, homebridge crashed:

[18.11.2020, 08:30:26] [Hue] LED-stripe: homekit transition control set to {"control":{"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T07:30:26.542Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.4222222566604614,"mired":374.22222900390625,"offset":0},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1774000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":1800000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000,"duration":10800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":374.22222900390625,"offset":26000}],"adjustmentIid":11,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}}
[18.11.2020, 08:30:26] [Hue] LED-stripe: set homekit transition control to {"control":{"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T07:30:26.542Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":361}}}
[18.11.2020, 08:30:26] [Hue] LED-stripe: set homekit active transition count to 1
[18.11.2020, 08:30:26] [Hue] LED-stripe: homekit adaptive lighting color temperature changed from 459 mired to 339 mired
[18.11.2020, 08:30:26] [Hue] LED-stripe: set homekit hue from 222˚ to 39˚
[18.11.2020, 08:30:26] [Hue] LED-stripe: set homekit saturation from 0% to 48%
[18.11.2020, 08:30:26] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T07:30:26.542Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":436}}
[18.11.2020, 08:30:26] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T07:30:26.542Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":443}}
[18.11.2020, 08:30:27] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T07:30:26.542Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":471}}
[18.11.2020, 08:30:27] TypeError: Cannot read property 'colorTemperature' of undefined
    at AdaptiveLighting.parseControlWrite (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:221:35)
    at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1761:13)
    at _Characteristics.<computed>.emit (events.js:315:20)
    at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
    at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._this._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1281:10)
    at HAPServer.emit (events.js:315:20)
    at HAPServer.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
[18.11.2020, 08:30:27] [Hue] heartbeat 40, drift 283
[18.11.2020, 08:30:27] Got SIGTERM, shutting down Homebridge...
[18.11.2020, 08:30:32] [Hue] goodbye

After restarting homebridge, it seemed to work fine for a bit (hard to say since it's just a white color when observed for just a minute), but after changing colors a few times in the Home app to test more it crashed again:

[18.11.2020, 08:43:16] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T07:41:51.523Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":85213}}
[18.11.2020, 08:43:17] TypeError: Cannot read property 'colorTemperature' of undefined
    at AdaptiveLighting.parseControlWrite (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:221:35)
    at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1761:13)
    at _Characteristics.<computed>.emit (events.js:315:20)
    at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
    at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._this._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1281:10)
    at HAPServer.emit (events.js:315:20)
    at HAPServer.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
[18.11.2020, 08:43:17] Got SIGTERM, shutting down Homebridge...

The light in question is a Gledopto RGB+CCT controller with a LED strip attached.

Can you please provide the full debug logfile? I think HomeKit is sending a slightly different transition control value that Homebridge Hue chokes on.

Note to self: need to guard this stuff with try / catch, so Homebridge won’t crash.

This is what I got with homebridge -D

[18.11.2020, 11:22:47] [Hue] LED-stripe: homekit transition control set to {"control":{"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T10:22:47.191Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":0},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000,"duration":4033000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":1800000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000,"duration":10800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1367000}],"adjustmentIid":11,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}}
[18.11.2020, 11:22:47] [Hue] LED-stripe: set homekit transition control to {"control":{"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T10:22:47.191Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":43}}}
[18.11.2020, 11:22:47] [Hue] LED-stripe: set homekit active transition count to 1
[18.11.2020, 11:22:47] [Hue] LED-stripe: homekit adaptive lighting color temperature changed from 371 mired to 227 mired
[18.11.2020, 11:22:47] [Hue] Philips hue: bridge request 20: put /lights/6/state {"ct":227}
[18.11.2020, 11:22:47] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T10:22:47.191Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":63}}
[18.11.2020, 11:22:47] [Hue] Philips hue: bridge request 20: ok
[18.11.2020, 11:22:47] [Hue] LED-stripe: light xy predicted to change by ct from [0.6936,0.2961] to [0.3641,0.3659]
[18.11.2020, 11:22:47] [Hue] LED-stripe: set homekit hue from 354˚ to 44˚
[18.11.2020, 11:22:47] [Hue] LED-stripe: set homekit saturation from 100% to 20%
[18.11.2020, 11:22:47] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":22,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-18T10:22:47.191Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":132}}
[18.11.2020, 11:22:47] TypeError: Cannot read property 'colorTemperature' of undefined
    at AdaptiveLighting.parseControlWrite (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:221:35)
    at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1761:13)
    at _Characteristics.<computed>.emit (events.js:315:20)
    at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
    at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._this._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1281:10)
    at HAPServer.emit (events.js:315:20)
    at HAPServer.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
[18.11.2020, 11:22:47] Got SIGTERM, shutting down Homebridge...
[18.11.2020, 11:22:47] [Hue] last heartbeat 56, drift 0

Thanks. The LED-stripe is actually looking good. I think the type Error comes from the request to set adaptive lighting for the next light. Unfortunately, the log gives no clue which light that is. Can you list all the set homekit supported transition configuration messages?

I'll cook a new beta version logging the raw value and guarding the parsing.

[18.11.2020, 12:01:42] [Hue] LED-stripe: set homekit supported transition configuration to {"configuration":[{"iid":11,"characteristic":1},{"iid":22,"characteristic":2}]}

Is that the only light you have, supporting colour temperature?

No, I also have two IKEA TRADFRI bulb E27 CWS opal 600lm lights through Homebridge-Hue, and 3 Philips Hue bulbs with native Homekit support. nativeHomeKitLights is true.

The IKEA CWS doesn’t support colour temperature. And with nativeHomeKitLights, Homebridge Hue shouldn’t touch the Hue light. Just to be sure: you only see one set homekit supported transition configuration message, for the LED-stripe?

Ah I thought you meant support for changing the temperature of the white.

Yeah, that's the only message of that kind.

Could you try the latest beta? The issue won't be solved, but Homebridge shouldn't crash anymore, and there should be additional debug messages with the raw values.

I double-checked the 1ID GLEDOPTO GL-C-008 (paired to a Hue bridge): adaptive lighting seems to be working for that controller.

None of my homebridge-hue lights works at all now, the log says:
[Hue] homebridge: error: Accessories must be created with a non-empty displayName.

Which beta are you on? I got this once testing the new name sync between HomeKit and the bridge, because Eve cleared the name. I now added a check to ignore an empty name being set. Best check the Hue app (or Phoscon app if you’re using deCONZ) to see if each light still has a name. Sorry for this.

Thanks, one was missing a name and adding it fixed it.

I tried 0.12.1-6, here's the result:

[19.11.2020, 09:22:49] [Hue] LED-stripe: light xy changed by ct from [0.5052,0.4153] to [0.5053,0.4152] [19.11.2020, 09:22:50] [Hue] LED-stripe: homekit transition control set to Av8B/wEBGwImARDE8z2pY8lMD4uJbDajPu+eAgiTI/IXkgAAAAMIMqzSQ2Tvy8YDAQEF/wEPAQSf9Mm/AgSOY7RDAwEAAAABEgEEzczMvwIEAAC0QwMEsI8GAAAAARIBBD/p078CBBzHsUMDBEB3GwAAAAESAQRswda/AgSOY7BDAwRAdxsAAAABEgEEgy3YvwIEx3GvQwMEQHcbAAAAARIBBIMt2L8CBMfxrkMDBEB3GwAAAAEYAQRswda/AgSO465DAwRAdxsABASA7jYAAAABEgEEgy3YvwIEx/GuQwMEQHcbAAAAARgBBD/p078CBBxHr0MDBEB3GwAEBIDuNgAC/wAAAf8BEgEE5DjOvwIEOQ6wQwMEQHcbAAAAARIBBHIcx78CBBzHsUMDBEB3GwAAAAESAQQF/7y7u78CBFVVs0MDBEB3GwAAAAESAQQGW7C/AgSOY7ZDAwRAdxsAAAABEgEEUPqkvwIEx/G5QwMEQHcbAAAAARIBBN7dnb8CBKsqv0MDBEB3GwAAAAESAQT1SZ+/AgTkuMZDAwRAdxsAAAABEgEEfdKnvwIEOQ7QQwMEQHcbAAAAARIBBKVPur8CBBzH20MDBEB3GwAAAAESAQQREdG/AgSrqudDAwRAdxsAAAABEgEEq6rqvwIEq6rzQwMEQHcbAAAAARIBBAAAAAL/wAIEAAH/AP5DAwRAdxsAAAABEgEEW7AFwAIE5DgCRAMEQHcbAAAAARIBBCIiAsACBFUVAkQDBEAF/3cbAAAAARIBBNIn/b8CBMfxAUQDBEB3GwAAAAESAQQGW/C/AgTH8QBEAwRAdxsAAAABEgEE2ILtvwIEjqMBRAMEQHcbAAAAARgBBH3S578CBBwHAEQDBEB3GwAEBIDLpAAAAAESAQQLtuC/AgQcx/tDAwRAdxsAAAABEgEEVVXVvwIEVVX1QwMEQHcbAAAAARIBBJ/0yb8CBI5j7kMDBEB3GwAAAAESAQTSJ72/AgSOY+dDAwRAdxsAAAABEgEE2IKtvwIEAtkcx99DAwQB0UB3GwAAAAESAQT1SZ+/AgTkuNhDAwRAdxsAAAABEgEEP+mTvwIEHMfRQwMEQHcbAAAAARIFkQEEERGRvwIEq6rLQwMEQHcbAAAAARIBBIMtmL8CBMfxxUMDBEB3GwAAAAESAQRmZqa/AgQAgMBDAwRAdxsAAAABEgEEYQu2vwIEcpy7QwMEQHcbAAAAARIBBERExL8CBKuqt0MDBEB3GwAAAAESAQSf9Mm/AgSOY7RDAwSQ5xQAAgELAwwBBAoAAAACBGQAAAAGAmDqCATAJwkA [19.11.2020, 09:22:50] [Hue] LED-stripe: homekit transition control set to {"control":{"colorTemperature":{"iid":27,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-19T08:22:50.003Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.5777777433395386,"mired":360.77777099609375,"offset":0},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":430000},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":1800000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000,"duration":10800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":360.77777099609375,"offset":1370000}],"adjustmentIid":11,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}} [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit transition control to AjABLgEBGwImARDE8z2pY8lMD4uJbDajPu+eAgiTI/IXkgAAAAMIMqzSQ2Tvy8YDAS4= [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit transition control to {"control":{"colorTemperature":{"iid":27,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-19T08:22:50.003Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":46}}} [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit active transition count to 1 [19.11.2020, 09:22:50] [Hue] LED-stripe: homekit adaptive lighting color temperature changed from 454 mired to 291 mired [19.11.2020, 09:22:50] [Hue] Philips hue: bridge request 8: put /lights/6/state {"ct":291} [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit transition control to AS4BARsCJgEQxPM9qWPJTA+LiWw2oz7vngIIkyPyF5IAAAADCDKs0kNk78vGAwFh [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":27,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-19T08:22:50.003Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":97}} [19.11.2020, 09:22:50] [Hue] Philips hue: bridge request 8: ok [19.11.2020, 09:22:50] [Hue] LED-stripe: light xy predicted to change by ct from [0.5053,0.4152] to [0.4089,0.3926] [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit hue from 36˚ to 41˚ [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit saturation from 68% to 37% [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit transition control to AS8BARsCJgEQxPM9qWPJTA+LiWw2oz7vngIIkyPyF5IAAAADCDKs0kNk78vGAwIYAQ== [19.11.2020, 09:22:50] [Hue] LED-stripe: set homekit transition control to {"colorTemperature":{"iid":27,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-19T08:22:50.003Z","2.1.2.3":"32ACD24364EFCBC6"},"runtime":280}} [19.11.2020, 09:22:50] [Hue] LED-stripe: homekit transition control set to AQMBARs= [19.11.2020, 09:22:50] [Hue] TypeError: Cannot read property 'colorTemperature' of undefined at AdaptiveLighting.parseControlWrite (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:221:35) at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1785:15) at _Characteristics.<computed>.emit (events.js:315:20) at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22) at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24 at Array.forEach (<anonymous>) at Bridge.Accessory._this._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1281:10) at HAPServer.emit (events.js:315:20) at HAPServer.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22): cannot handle transition control: %s

Did I understand correctly that adaptive lighting is only possible with RGB lights but not with warm-cold-white bulbs?

No, it's the other way around.

[19.11.2020, 09:22:50] [Hue] LED-stripe: homekit transition control set to AQMBARs=

So that's new. I'll need to analyse what HomeKit is trying to say here.

I assume/hope that Homebridge continues to run after the error message? Would be interesting to see if your Home hub still sends an updated transition control curve after ~24h.

Yeah, it keeps running fine now :)

It's also quite hard to trigger the error now, but I sometimes manage to do it while switching wildly between regular colors and the adaptive color.

@NewsGuyTor could you try beta v0.12.1-7?

Nice, I couldn't get the error to appear now. However some colors switched themselves to other colors though:

https://streamable.com/006vz3

The video may contain two separate bugs, the UI glitches at first, then the turquoise switching to yellow by itself near the end of the video.

Please see #814 for jumping colours.

hey, I installed beta v0.12.1-7 on my system. I have a RPi with rasbee module and various lights ranging from tradfrii, hue to Dresden Elektronik. But with none of the lights I see adaptive lighting on my Home app. Everything is orchestrated by my HomePod (iOS 14.2). My Raspbee Module is on the latest firmware, Node is on 14.15.1

What am I doing wrong?

Are these lights that support colour temperature? What version of iOS are you running? Please attach the debug dumpfile so I can have a look.

I‘ve been running into problems using the latest beta and my hue lights connected trough a conbee stick. Not sure what the problem is

[11/19/2020, 6:20:39 PM] [Hue] Couch: cannot handle transition control: TypeError: value.readUint32LE is not a function at parseTlv (/usr/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:71:27) at parseTlv (/usr/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:90:19) at parseTlv (/usr/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:90:19) at parseTlv (/usr/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:90:19) at parseTlv (/usr/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:90:19) at AdaptiveLighting.parseControl (/usr/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:225:15) at HueLight.setTransitionControl (/usr/lib/node_modules/homebridge-hue/lib/HueLight.js:1786:15) at _Characteristics.<computed>.emit (events.js:223:5) at _Characteristics.<computed>.EventEmitter.emit (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22) at _Characteristics.<computed>.Characteristic._this.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)

My bad, should be readUInt32LE (with capital I).

Please try beta v0.12.1-8.

Now it works. Thank you very much!

@letszock What lights are you using it with? Hue bridge or deCONZ gateway?

I‘m using it with hue ambient bulbs (Just white) and they‘re connected to a deCONZ gateway. Funnily enough it even shows that it works with my hue lightstrip and the hue go, even though those are RGB and shouldn’t work?

Hello,

I just tested it with my Hue light with a Hue Bridge, and all Color and White Ambiance are working fine with Adaptive Lighting.

Good job!

The Hue lightstrip plus is RGB+CCT so it should support Adaptive Lighting. The first-gen lightstrip doesn’t support ct. I don’t know the details of the Go, but it’s fairly recent, so I guess it would support ct as well.

Would it be possible for support to be added for lights with the ability to change whites, but that doesn't support ct?

Unless I'm misunderstanding the log it seems like the calculation might be similar to the light xy predicted to change by ct one.

Short answer: in theory: yes; in practice: no, there are no such lights.

Long answer below.

That ct to xy calculation is used to show the colour in HomeKit, as it still only half supports colour temperature. You can now set _Color Temperature_ through Home, but neither Home nor Eve (with the iOS 14 update) displays it. The light accessory needs to provide the _Hue_ and _Saturation_ values for the colour more or less equivalent to the colour temperature to be displayed in the app. Decent lights (like Hue and dresden elektronik) will provide the xy values, but the cheaper lot won't. Also, on larger networks it takes deCONZ (or the Hue bridge) some time to poll the light, so it would "jump" back to the old colour until the light state is refreshed.

Lights that don't support ct typically have only three channels, RGB, optimised for brilliant colours. They cannot mix proper colour temperatures, so sending the more or less corresponding xy values to these lights won't result in acceptable (WAF-proof) whites. See the whole discussion on pre-iOS14 Home not being able to drive the CCT channels.

You need CCT channels for mixing proper whites. Or special RGB LEDs, like the gamit-B Hue lights, that are optimised for whites, at the expense of brilliant green and blue. These lights do support ct.

I know, I'm late to the party... But I got it working. I restarted home bridge and my home app on my iOS device and voila I got prompted with the adaptive lighting dialogue asking if I want to enable adaptive lighting.
From the logs I can't see any errors with v0.12.1-8 so far. Color changes worked well so far. Here is a list of my devices so far:

Philips LCT007
Philips LCT015
Ikea lumi.remote.b186acn01
dresden elektronik FLS-CT

All listed devices work fine so far

Ikea lumi.remote.b186acn01

Huh? The lumi.remote.b186acn01 is a Xiaomi device, I think a wired in-wall switch, that doesn't support colour temperature. Do you mean an Ikea tunable white spectrum?

Whops - I meant TRADFRI bulb E27 WS opal 1000lm

Edit: Yes that is a WallSwitch by Xiaomi

Tested beta v0.12.1-9.
Works with IKEA FLOALT and Hue LTA001, LCA001, LTW001 and LTW010.
Great work, @ebaauw !

Looks like adaptive lighting is now working (more or less) as per the (assumed, reverse-engineered) specs:

  • Adaptive lighting is supported only for lights that support setting the colour temperature (i.e. lights whose /lights resource exposes state.ct in the Hue or deCONZ API). On startup, Homebridge Hue should log a message when it announces to HomeKit that the light supports adaptive lighting:
    [Hue] Living 9: set homekit supported transition configuration to {"configuration":[{"iid":27,"characteristic":1},{"iid":29,"characteristic":2}]}
    (I'm using Living 9 as example light name here)
  • You can enable adaptive lighting (per light) only from the Home app, by selecting the adaptive lighting preset colour. Once enabled, it remains active, until the light's colour is changed or Homebridge restarts. Homebridge Hue logs a message when adaptive lighting is enabled:
    [Hue] Living 9: set homekit active transition count to 1
  • You can disable adaptive lighting (per light) from the Home app, by selecting another preset colour from the home app. Adaptive lighting is disabled automatically by Homebridge Hue, when light's colour is changed, from any HomeKit app, from any other API client, directly or through a scene. Note that adaptive lighting is not disabled when the light's colour temperature is changed. Homebridge Hue logs a message when adaptive lighting is disabled:
    [Hue] Living 9: set homekit active transition count to 0
  • When Homebridge restarts, Homebridge Hue has lost the adaptive lighting settings and reports the light with no adaptive lighting. However, sometimes Home doesn't take the hint and still shows adaptive lighting as enabled. In this case, select another colour preset and then (re-)select the adaptive lighting preset.
  • When enabling adaptive lighting, HomeKit sends a transition curve to the accessory (i.c. Homebridge Hue). This curve is a recipe to compute the adaptive colour temperature based on the time of day and and brightness. HomeKit should update the curve every 24 hours. The initial curve is sent from your iPhone or iPad (on which you enable adaptive lighting); the subsequent curves are sent from the home hub. Note that Homebridge Hue does not disable adaptive lighting when no subsequence curve has been received; instead it continues to apply the previous curve. When it receives a curve, Homebridge Hue logs a message:
    [Hue] Living 9: homekit transition control set to {"colorTemperature":{"iid":29,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-21T08:42:35.859Z","2.1.2.3":"73D8252359D93D1D"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.6222221851348877,"mired":357.22222900390625,"offset":0},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1045000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000,"duration":3600000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":1800000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000,"duration":10800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6222221851348877,"mired":357.22222900390625,"offset":755000}],"adjustmentIid":27,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}
  • Homebridge Hue applies the recipe every minute and when the light state is changed (either from HomeKit or through another API client). When the colour temperature needs to be updated, it logs a message:
    [Hue] Living 9: homekit adaptive lighting color temperature changed from 335 mired to 334 mired
  • With 100% brightness, the recipe yields colour temperature values between 181 (~5500K) and 333 (~3000K). With 10% brightness, it yields values between 333 mired (~3000K) and 500 mired (2000K). Most of my on/off lights produce 2700K (370 mired), so for full brightness, adaptive lighting looks unpleasantly white. I've added a brightnessAdjustment config.json key, to set a correction factor for the light brightness, to soften the adaptive lighting temperature. It defaults to 100% (using the light brightness) on Homebridge startup. When you set it to 50%, it applies the recipe for a half the light brightness; when you set it to 10%, it applies the 10% brightness recipe for all brightness values.

With the support of adaptive lighting, Apple has also changed how HomeKit handles colour temperature, see https://github.com/ebaauw/homebridge-hue/issues/814.

WOW! Many thanks! That is phenomenal work. Thanks a lot!

Thank you! You mentioned this brightness characteristic, but how/where can I configure this?

I've added a Brightness characteristic in the bridge/gateway accessory to set a correction factor for the light brightness, to soften the adaptive lighting temperature. It defaults to 100% (using the light brightness) on Homebridge startup. When you set it to 50%, it applies the recipe for a half the light brightness; when you set it to 10%, it applies the 10% brightness recipe for all brightness values.

It's on the accessory for the bridge or gateway. Home shows this as _Not Supported_; you need to use a decent HomeKit app, like Eve, to use it.

Found it! Thanks for your quick reply!

Great work! Using the -10 beta right now and pretty much all of my lights (various Osram/Ledvance + Hues) are working well!
The only one thats a big off is an IKEA Tradfri E27 bulb (1000lm). Whenever switched to Adaptive mode, Brightness seems to stop working (turning the brightness control in the home app only affects color temperature, but does not actually make the bulb brighter. Works with non-Adaptive colors).

Couldn't find anything off in the Logs.
Used via current Phoscon/deCONZ

[11/21/2020, 7:39:57 PM] [Hue] Ceiling Light: state changed event: {"alert":null,"bri":38,"colormode":"ct","ct":414,"on":true,"reachable":true}
[11/21/2020, 7:39:57 PM] [Hue] Ceiling Light: light ct changed from 424 to 414
[11/21/2020, 7:39:57 PM] [Hue] Ceiling Light: recently updated - ignore changed ct
[11/21/2020, 7:39:57 PM] [Hue] Ceiling Light: homekit brightness changed from 15% to 11%
[11/21/2020, 7:39:57 PM] [Hue] Ceiling Light: homekit adaptive lighting color temperature changed from 424 mired to 430 mired
[11/21/2020, 7:39:57 PM] [Hue] Mattberry: gateway request 58: put /lights/27/state {"ct":430,"bri":28}
[11/21/2020, 7:39:57 PM] [Hue] Mattberry: gateway request 58: ok
[11/21/2020, 7:39:57 PM] [Hue] Ceiling Light: state changed event: {"alert":null,"bri":28,"colormode":"ct","ct":430,"on":true,"reachable":true}

Update: Nevermind, it seems to be related to https://github.com/ebaauw/homebridge-hue/issues/801 (A transitionTime of 0 fixes it)

I've added a _Brightness_ characteristic in the bridge/gateway accessory to set a correction factor for the light brightness, to soften the adaptive lighting temperature

Good idea. My light was also a little too cool so I like it better with this at 90%. I suggest renaming this to _Adaptive color offset_ or something more descriptive. Also, this value is reset to 100% every time I restart homebridge. Does that happen to you?

Yeah, a better name would be welcome. It’s not an offset though (subtracted from the brightness), but a factor (multiplied with the brightness).

The reset happens because Homebridge Hue still doesn’t persist state between restarts, see #4.

Ah ok. Can this be set in config.json so it sticks? I don’t really need to change it more than once.
I can’t think of a great name that is short enough for HomeKit. Mired factor? It would probably be more clear to add it to config.json instead, this way you can have a proper description of how it works in the GUI, and clarify that it only applies adaptive lighting.
Also, this would make it easy to type a value over 100%. Not sure if this is necessary, but maybe someone wants to match the cool color of a cloudy day.

I had it in config.json originally, but then wanted to test a number of values, so made it dynamic. Could do both: set startup value in config.json and still allow dynamic change.

I don’t think you appreciate how the correction factor works: it is applied to the light’s brightness, not to the colour temperature.

Added brightnessAdjustment config.json parameter and removed the _Brightness_ characteristic from the Hue bridge.

Published v0.12.2.

This test was done at 10:30pm. I think the ranges change throughout the day. With factor 10 the color doesn't change at all dimming from 0-full.

brightnessAdjustment | Min Mireds | Max Mireds | dimmer range where color adapts
---------------------- | --------- | ------------| -----------
10 | 495 (2020K) | 495 (2020K) | none
20 | 495 (2020K) | 475 (2100K) | 20-100%
50 | 495 (2020K) | 415 (2410K) | 20-100%
100 | 495 (2020K) | 318 (3140K) | 10-100%

Got the following error on install:

image

[11/23/2020, 8:25:33 PM] [Hue] Bathroom Left: homekit transition control set to {"colorTemperature":{"iid":20,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-23T19:25:33.681Z"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.7999999523162842,"mired":483,"offset":0},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":267000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":0},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":9000000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.7999999523162842,"mired":483,"offset":1533000}],"adjustmentIid":11,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}
[11/23/2020, 8:25:34 PM] [Hue] Bathroom Left: cannot handle transition control: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (buffer.js:333:9)
    at tlvFromHexString (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:159:37)
    at AdaptiveLighting._generateControl (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:195:9)
    at AdaptiveLighting.generateControlResponse (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:205:34)
    at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1801:37)
    at _Characteristics.<computed>.emit (events.js:315:20)
    at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
    at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24
    at Array.forEach (<anonymous>)
[11/23/2020, 8:25:34 PM] [Hue] Walk-in Closet: set homekit motion from 0 to 1
[11/23/2020, 8:25:35 PM] [Hue] Diego 4: set homekit transition control to ""
[11/23/2020, 8:25:35 PM] [Hue] Hallway Entrance Sensor: set homekit motion from 0 to 1
[11/23/2020, 8:25:38 PM] [Hue] Kitchen: set homekit motion from 0 to 1
[11/23/2020, 8:25:38 PM] [Hue] Kitchen Left: homekit on changed from 0 to 1
[11/23/2020, 8:25:38 PM] [Hue] Kitchen Right: homekit on changed from 0 to 1
[11/23/2020, 8:25:57 PM] [Hue] Bathroom Left: homekit transition control set to {"colorTemperature":{"iid":20,"transitionParameters":{"2.1.2.1":"C4F33DA963C94C0F8B896C36A33EEF9E","startTime":"2020-11-23T19:25:56.548Z"},"runtime":1,"curve":{"entries":[{"adjustmentFactor":-1.8111110925674438,"mired":484.1111145019531,"offset":0},{"adjustmentFactor":-1.8333333730697632,"mired":487.3333435058594,"offset":244000},{"adjustmentFactor":-2,"mired":508,"offset":1800000},{"adjustmentFactor":-2.0888888835906982,"mired":520.888916015625,"offset":1800000},{"adjustmentFactor":-2.0333333015441895,"mired":520.3333129882812,"offset":1800000},{"adjustmentFactor":-1.9777777194976807,"mired":519.7777709960938,"offset":1800000},{"adjustmentFactor":-1.8777778148651123,"mired":515.7777709960938,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":1800000},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":0},{"adjustmentFactor":-1.855555534362793,"mired":518.5555419921875,"offset":9000000},{"adjustmentFactor":-1.8111110925674438,"mired":512.111083984375,"offset":1800000},{"adjustmentFactor":-1.755555510520935,"mired":503.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6666666269302368,"mired":490.6666564941406,"offset":1800000},{"adjustmentFactor":-1.5777777433395386,"mired":476.77777099609375,"offset":1800000},{"adjustmentFactor":-1.4777777194976807,"mired":462.77777099609375,"offset":1800000},{"adjustmentFactor":-1.355555534362793,"mired":447.5555419921875,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":433.4444580078125,"offset":1800000},{"adjustmentFactor":-1.1555556058883667,"mired":419.5555419921875,"offset":1800000},{"adjustmentFactor":-1.1333333253860474,"mired":407.3333435058594,"offset":1800000},{"adjustmentFactor":-1.1888889074325562,"mired":395.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2999999523162842,"mired":385,"offset":1800000},{"adjustmentFactor":-1.4222222566604614,"mired":375.22222900390625,"offset":1800000},{"adjustmentFactor":-1.5333333015441895,"mired":367.3333435058594,"offset":1800000},{"adjustmentFactor":-1.600000023841858,"mired":360,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":352.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":350.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6777777671813965,"mired":349.77777099609375,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6888889074325562,"mired":349.8888854980469,"offset":1800000},{"adjustmentFactor":-1.6555556058883667,"mired":350.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6111111640930176,"mired":352.1111145019531,"offset":1800000},{"adjustmentFactor":-1.5555555820465088,"mired":355.5555419921875,"offset":1800000},{"adjustmentFactor":-1.4666666984558105,"mired":358.6666564941406,"offset":1800000},{"adjustmentFactor":-1.3777778148651123,"mired":364.77777099609375,"offset":1800000},{"adjustmentFactor":-1.288888931274414,"mired":371.8888854980469,"offset":1800000},{"adjustmentFactor":-1.2333333492279053,"mired":382.3333435058594,"offset":1800000},{"adjustmentFactor":-1.244444489479065,"mired":397.4444580078125,"offset":1800000},{"adjustmentFactor":-1.3111110925674438,"mired":416.1111145019531,"offset":1800000},{"adjustmentFactor":-1.4555555582046509,"mired":439.5555419921875,"offset":1800000},{"adjustmentFactor":-1.6333333253860474,"mired":463.3333435058594,"offset":1800000},{"adjustmentFactor":-1.8111110925674438,"mired":484.1111145019531,"offset":1556000}],"adjustmentIid":11,"adjustmentRange":{"min":10,"max":100}},"updateInterval":60000,"notifyIntervalThreshold":600000}}
[11/23/2020, 8:25:57 PM] [Hue] Bathroom Left: cannot handle transition control: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (buffer.js:333:9)
    at tlvFromHexString (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:159:37)
    at AdaptiveLighting._generateControl (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:195:9)
    at AdaptiveLighting.generateControlResponse (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:205:34)
    at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1801:37)
    at _Characteristics.<computed>.emit (events.js:315:20)
    at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
    at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24
    at Array.forEach (<anonymous>)
[11/23/2020, 8:26:15 PM] [Hue] Hallway Bathroom: set homekit motion from 1 to 0
[11/23/2020, 8:26:15 PM] [Hue] Bathroom: set homekit motion from 1 to 0
[11/23/2020, 8:26:24 PM] [Hue] Bathroom Left: homekit transition control set to {"colorTemperature":{"iid":20}}
[11/23/2020, 8:26:24 PM] [Hue] Bathroom Left: cannot handle transition control: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (buffer.js:333:9)
    at tlvFromHexString (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:159:37)
    at AdaptiveLighting._generateControl (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:195:9)
    at AdaptiveLighting.generateControlResponse (/usr/local/lib/node_modules/homebridge-hue/lib/AdaptiveLighting.js:205:34)
    at HueLight.setTransitionControl (/usr/local/lib/node_modules/homebridge-hue/lib/HueLight.js:1801:37)
    at _Characteristics.<computed>.emit (events.js:315:20)
    at _Characteristics.<computed>.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)
    at _Characteristics.<computed>.Characteristic._this.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:652:12)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1439:24
    at Array.forEach (<anonymous>)
[11/23/2020, 8:26:30 PM] [Hue] Bathroom Left: homekit adaptive lighting color temperature changed from undefined mired to 376 mired
[11/23/2020, 8:26:30 PM] [Hue] Bath

Do you see the cannot handle transition control error for all your 16 lights or only for the three listed? Could you please attach the debug dump file and the full log file, preferably with Homebridge debug mode enabled?

@ebaauw all of the lights. I tried removing the once that showed the error but same message

Sent with GitHawk

What iOS version are you on? What brands and models of lights do you have? Home seems to be sending a slightly different transition control setting here; I wonder what's causing the difference.

Could you try v0.12.3. I hope it fixes the error, but lacking a debug log file, I cannot test it myself.

I don’t think you appreciate how the correction factor works: it is applied to the light’s brightness, not to the colour temperature.

I actually wonder if it'd be possible to add an offset to that. I also find the lights a bit too cool throughout the day and night settings on max brightness. (In all fairness, I know this is more on Apple's side since Homebridge-Hue is fairly in line with first-party adaptive lighting colors like eve strip or hue)

That's what brightnessAdjustment is for: the light displays the colour temperature corresponding to a lower brightness than the light is actually at.

Ahhh, I see. This is what I understood in the first place, but then got confused after your comment to @llamafilm . Thanks for clarifying 👍 :)

Suppose something a bit more verbose like brightnessToColorAdjustment could be helpful? Just a thought though

I'm not very creative in making up names, I'm afraid, but there is a description in the Wiki: https://github.com/ebaauw/homebridge-hue/wiki/Configuration.

@ebaauw so brightnessAdjustment is used to offset color temp to bulb brightness, but my question is, is there any way to verify that the bulbs are applying the correct ct by design

I'm running AdaptiveLighting on a variety of bulbs, Hue color 1st gen, Hue white ambiance 3rd, innr white ambiance, innr color, and they all look a bit bland, and not much change happens over the course of a day. Since I haven't got the official update from Hue yet, I have nothing to compare these bulbs to.

I'm wondering if the gradual change is as Apple intended, and is homebridge-hue simply receiving the data from Apple and offering it up to the light, or is the plug-in or individual bulbs interpreting Apple's data in their own way

is there any way to verify that the bulbs are applying the correct ct by design

Apple hasn’t published any design for this, so the only way is comparing it to lights that natively support adaptive lighting.

I'm wondering if the gradual change is as Apple intended, and is homebridge-hue simply receiving the data from Apple and offering it up to the light, or is the plug-in or individual bulbs interpreting Apple's data in their own way

RTFM, https://github.com/ebaauw/homebridge-hue/issues/766#issuecomment-731560178

In my log i can see the following:

[11/12/2020, 18:06:50] [Hue] Schreibtisch: set homekit supported transition configuration to {"configuration":[{"iid":11,"characteristic":1},{"iid":13,"characteristic":2}]}

Its a Tradfri Bulb E14 WS opal 400lm on Firmware 2.3.50 on deconz 2.7.0

But in HomeApp adaptive Lighting does not show up the function does not show up.

All my devices are on IOS 14.2 .

Homebridge is on 1.2.4
homebridge-hue v0.12.11
Node.js Version | v14.15.1
NPM | v6.14.9

Haven’t seen that before. Did you restart your iOS device? Otherwise, turn on debug mode in Homebridge and capture and attach the log file, from Homebridge startup to running for a couple of minutes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clipse2004 picture clipse2004  Â·  3Comments

imbaimbaimba picture imbaimbaimba  Â·  11Comments

zeromancer1972 picture zeromancer1972  Â·  7Comments

th3cube picture th3cube  Â·  10Comments

derthobo picture derthobo  Â·  3Comments