ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
135 stars 7 forks source link

Lights cooler than in Homebridge Hue - won't go above 454 mired? #39

Closed mwsimmonite closed 2 years ago

mwsimmonite commented 2 years ago

I'm beginning to migrate to the Deconz plugin, and I was running it simultaneously with Homebridge-Hue to swap presets etc. over and test run a bit. During that time, all lights colour temperatures responded the same whether sending a request to change it via the 'Deconz hub' or the 'Hue plugin' hub. Set a light to max warm white, get 500 mireds in the Homebridge log/Phoscon GUI whether through Deconz or Hue hubs etc.

I then disabled the hue hub as a trial, and noticed that the lights colour temperatures now won't go as warm, and it seems that the hue hub was overriding this setting while both were running.

The maximum mired I can get through the Deconz plugin is now 454, whereas through Homebridge-Hue I can get 500, which as expected disables the cool white LED's on the fixtures. I can see evidence of this in the Phoscon app and the Homebridge logs.

Could this be related to the 'Brightness Adjustment Factor' for Adaptive Lighting in the Homebridge Hue plugin, which I have set to 55/100? Adaptive lighting is definitely cooler in Deconz now I disabled the hue hub, however this occurs whether adjusting temperature via the adaptive lighting colour wheel, or the regular colour temperature wheel. I'm unsure how the adjustment factor works so if it applies a colour shift to everything then it could be responsible but I'm guessing to be honest!

If it is it would be great if this feature could be added to the Deconz plugin at some point in the future :)

ebaauw commented 2 years ago

Sorry, I don't understand your issue.

via the 'Deconz hub' or the 'Hue plugin' hub

What do you mean by "hub"? Are your lights connected to a deCONZ gateway or to a Hue bridge? Did you move the lights from the Hue bridge to the deCONZ gateway?

The maximum mired I can get through the Deconz plugin is now 454

Are you setting the Color Temperature manually from HomeKit, or are you looking at Adaptive Lighting?

I then disabled the hue hub as a trial, and noticed that the lights colour temperatures now won't go as warm, and it seems that the hue hub was overriding this setting while both were running.

What do you mean "disabled the Hue hub"? Power down the Hue bridge? Were you using the native HomeKit feature of the Hue bridge to expose the lights?

Could this be related to the 'Brightness Adjustment Factor' for Adaptive Lighting in the Homebridge Hue plugin

I find that Adaptive Lighting is too cool for my taste, hence this factor. As explained in the Wiki (https://github.com/ebaauw/homebridge-hue/wiki/Configuration), it adjusts the brightness used to compute the colour temperature for adaptive lighting.

If it is it would be great if this feature could be added to the Deconz plugin at some point in the future :)

It will be, once I'll have figured out how best to expose the settings in Homebridge deCONZ.

mwsimmonite commented 2 years ago

Sorry, I really poorly explained this.

I was referring to my Homebridge-Deconz instance as 'Deconz hub', and my original Homebridge-Hue instance as 'Hue plugin hub/hue hub'. Awful choice of terms - I don't own a Philips Hue Hub at all it didn't even click that it would obviously get mistaken for that. My lights are connected via a Deconz Conbee II.

Let me try better explain myself from scratch.

I had lights connected to HomeKit, via Homebridge using Homebridge-Hue with the Deconz gateway. On the Apple Home app, If I adjusted brightness on the Adaptive Lighting slider to minimum, in Homebridge logs, and in Phoscon's Web App I could see lights would eventually reach 500 mired and the cool white LED's would turn off. Also, if I adjusted the colour temperature wheel itself (not Adaptive Lighting) on the light, I could set lights at their warmest to a temperature above 454 mired according to Homebridge logs/Phoscon Web App (and based on the cool white LED turning off). So I saw warmer colour temperatures with both Adaptive Lighting AND setting Colour Temperature manually (this is why I was uncertain if the Brightness Adjustment Factor could be related as it sounded like it's effect was limited to Adaptive Lighting, whereas this seems an overall change).

I then set up a second Homebridge instance, running the Homebridge-Deconz plugin and added this to my HomeKit simultaneously. At this point I had two of every light as expected. When I set Adaptive Lighting to minimum brightness, or Colour Temperature to warm on a light (still through the Apple Home app) it would still go up to 500 mired as per Homebridge logs/Phoscon Web App/cool white LED's going off. It didn't matter whether I set this on either 'version' of the same light (the 'Deconz' or 'Hue' plugin version). If I set the 'Homebridge-Deconz' version of a light to what I'd expect to be as warm as white as possible, it's cool white LED's would go off.

I then removed the old Homebridge instance running the Homebridge-Hue plugin from HomeKit. Now the lights will only go up to 454 mired. I'm still setting them through Apple Home app, both via Adaptive Lighting adjusted to minimum, and altering the Colour Temperature wheel manually.

Since then, I've found lights can be set via the Phoscon Web App to the 'old' maximum warmth, where the cool white LED's will go off. However I've spotted that if I adjust Colour Temperature in the Phoscon Web App, when making adjustments Homebridge's logs will pick up on the changes from cooler mireds, up to 454 (about 90% of the way up the Web App's Temperature slider). Once it hits 454 mireds, it stops reporting in the Homebridge logs, even though you can continue making the light warmer in Phoscon's Web App up to presumably 500 mired, and the light responds. I've attached a clip of this.

https://user-images.githubusercontent.com/44989573/164877724-f84c5370-c8a5-4768-b4dc-64f4284fa988.mov

I hope I've made more sense this time around - thanks for your time (and I definitely agree about Apple's lighting being a bit too 'cool'!)

ebaauw commented 2 years ago

Yeah, when adaptive lighting is enabled, the plugin updates the colour temperature based on time of day and brighness, using the mapping table provided by HomeKit. When both Homebridge Hue and Homebridge deCONZ have adaptive lighting enabled, both would try and set colour temperature. Homebridge deCONZ would disable adaptive lighting when Homebridge Hue sets the colour temperature (since the colour temperature is updated by some-one else). Homebridge Hue doesn't disable adaptve lighting when only the colour temperature is set (see e.g. https://github.com/ebaauw/homebridge-hue/issues/1090). So effectively, you were only using Homebridge Hue's adaptive lighting.

What lights are you using? Could you please attach the debug dump file by Homebridge deCONZ? I don't use Phoscon; I really need to see what ct value deCONZ is reporting after you change the colour temperature from Phoscon. For this, you'd need to run Homebridge with debug mode enabled, and set Log Level on the light accessory to 2.

What happens if you set the colour temperature directly from the API, e.g. deconz put /lights/xx/state '{"ct": 500}'?