Zacknetic / HomebridgeMagicHome-DynamicPlatform

Homebridge Plugin for MagicHome LED controllers and light bulbs
Apache License 2.0
61 stars 11 forks source link

Issues with temperature control #25

Closed kevinjohncutler closed 4 years ago

kevinjohncutler commented 4 years ago

I recently got this 6-channel controller (RGB+warm white+cool white) and it works nicely in Magic Home, but there seems to be an issue with how the plugin is controlling its temperature. Both the RGB or CCT disks in Magic Home can fine-tune the color precisely as one would expect, but adjusting temperature within the Home app is very unpredictable. Depending on how I've set the color threshold and saturation threshold for simultaneous devices (I've gone through all pairs of 0 and 100 besides the default 5 and 50), the temperature annulus gives occasional flashes of color before settling on a purely warm white + cool white combo; or, with that problem eliminated by the right thresholds, the temperature typically does not match what is shown on the annulus or what my other (native homekit) bulbs are displaying - e.g. super warm when it is down in the cool white region of the annulus.

Let me know what logs could be helpful in debugging this. I could also try to coordinate a video to go with the logs to illustrate what's happening.

Zacknetic commented 4 years ago

Hey, thanks for waiting.

A video would be helpful. Make sure you are staying in the "Color" section and don't click "Temperature" in the homekit colorwheel selection.

I've just posted a new update which works perfectly, mixing color and white under 50 saturation, then under 5 saturation only white. After updating checkmark "purge all next restart" and restart a few times to be sure. Then uncheckmark and restart. See if that solves any issues.

kevinjohncutler commented 4 years ago

Awesome, thanks! I just flashed these controllers with HAA (still waiting on full 5-channel support though), but I’m getting a third one in a few days and will definitely set it up via homebridge and your plugin. Can’t wait to test it out!

kevinjohncutler commented 4 years ago

Ok, so I now have an extra couple controllers. We are actually truing to figure out the right color mixing algorithm on the HAA discord, so maybe working this bug out will give some insights. Idk, I have yet to really sink my teeth into any of the code. Anyway, your plugin is doing much, much better at handling temperature. However, it does have some odd behavior remaining. For example, the 'most amber' setting via the Home app should probably map to the 'most amber' CCT setting in Magic Home - which corresponds to only the WW LED turned on), or it should be a combo of WW and RGB to give it a deeper orange hue (as my native HomeKit lights do; I have grouped them to change the color simultaneously for comparison). The current behavior is that it only turns on the RGB LEDs and emulates a 'neutral white' tone. I notice at various points in temperature adjustment that sometimes only the WW and CW LEDs are on, and at other times all are on but the RGB tends to dominate or make the tone seem over-saturated (always towards the blue). If you point me towards the part of your code that is doing the color mixing, I might be able to make some comparisons to what we are trying to do with HAA.

Zacknetic commented 4 years ago

In the Home app, are you using the "Color" tab with the RGB color disk or the "Temperature" tab with the Amber/Florescent gradient ring? The odd behavior your describing reminds me of controlling the temperature tab which my plugin does not use due to its low granularity, incompatibility with Siri, and... unpredictable behavior. There is no logic tied to the temperature ring so the Home app simply changes the colors on the color wheel causing all sorts of weird colors.

Secondly, ensure your config settings are set to default.

In terms of getting your program working, I'd be happy to share any insight I have. Lets keep it to another channel of communication so that I can keep this issues section focused on this plugin. Please join me in my new magichome discord server and bring anyone else you think would like to collaborate.

kevinjohncutler commented 4 years ago

Ah, that would make sense. The odd behavior only occurs with the temperature ring, not the color disk. I’ll join the discord and we can pick this up there!

Zacknetic commented 4 years ago

Great to hear, closing this issue then!