Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homekit light color switcher #19251

Closed
SebDominguez-zz opened this issue Dec 13, 2018 · 38 comments · Fixed by #30756
Closed

Homekit light color switcher #19251

SebDominguez-zz opened this issue Dec 13, 2018 · 38 comments · Fixed by #30756

Comments

@SebDominguez-zz
Copy link

SebDominguez-zz commented Dec 13, 2018

Home Assistant release with the issue:

0.83.3
Edit: updating to 0.84.1 doesn't fix the problem

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io running on a Raspberry Pi 3B+

Component/platform:

yeelight / Homekit

Description of problem:

When setting the RGB light color / temp with the "hue / temp wheel" the color is correctly set.
But when setting the color / temp using the "shortcut / saved / preset color / temp" thing on home.app the color is set incorrectly or the input is just ignored sometimes.

The problem is the same using home.app on a Mac / iPad / iPhone with respectively macOS Mojave 10.14 and iOS 12.1

Describing this problem is difficult so I made a little screen recording

IMAGE ALT TEXT HERE

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

...
homekit:
...
light: !include light.yaml

light.yaml

  - platform: yeelight
    devices:
      192.168.0.21:
        name: Yeelight
        model: color1
@warcanoid
Copy link

Same problem with z-wave light and home kit

@cdce8p
Copy link
Member

cdce8p commented Dec 13, 2018

Due to technical reasons the homekit component uses a short delay when setting the color and/or temperature of a light. Normally this shouldn't effect anybody, but depending on the connection of your devices it could sometimes be the case that although there was enough time in between, the actual commands got send directly after another. Keep in mind that the connection is always going through Home Assistant first, so it isn't as good as a direct one.

Can you try the following:

  1. Add the light.demo platform and check if the color is changed correctly.
  2. Change the color of your lights from the frontend. Check if that works without any issues. The Homekit component does use the exact same commands.

For all: don't change the color that fast. The delay is 0.5s, but try giving it a few more in between (3-5s should be enough).

@SebDominguez-zz
Copy link
Author

I can confirme that setting the color trough the webUI is working.
Also setting the color in HomeKit using the — COLOR WHEEL— works great (same for the temp).

What isn't working is: setting the color using the 6 slot color picker (whatever this is called) in HomeKit.

There is a new recording with I hope enough delay between each command.

IMAGE ALT TEXT HERE

@SebDominguez-zz
Copy link
Author

SebDominguez-zz commented Dec 14, 2018

I'm actually experimenting the same glitchy behavior with the color picker using Homebridge + homebridge-mqtt only when I set a light with BOTH hue saturation AND colorTemperature, so it could be a Homebridge problem.

IMAGE ALT TEXT HERE

This is the configuration of my 3 dummy bulb on Homebridge + homebridge-mqtt

RGB Light

{
    "name": "RGB Light",
    "service": "Lightbulb",
    "Brightness": "default",
    "Hue": "default",
    "Saturation": "default"
}

Temp Light

{
    "name": "Temp Light",
    "service": "Lightbulb",
    "Brightness": "default",
    "ColorTemperature": "default",
    "Saturation": "default"
}

RGB and Temp Light

{
    "name": "RGB and Temp Light",
    "service": "Lightbulb",
    "Brightness": "default",
    "Hue": "default",
    "ColorTemperature": "default",
    "Saturation": "default"
}

Edit: It seems that this only happened when the light is set with both RGB and Temp settings with homebridge-mqtt

@cdce8p
Copy link
Member

cdce8p commented Dec 15, 2018

I was able to reproduce the error with the demo light platform as well. However this seems to be an issue in the Home App. I checked the logs and Home Assistant never received the color changes, just the color temperature once. I also noticed that this behavior only happens with colors which have been set manually the default ones work. Unfortunately I can't do much in that case.

@cdce8p
Copy link
Member

cdce8p commented Dec 15, 2018

Have you tried iOS 12.1.1 yet?

@SebDominguez-zz
Copy link
Author

SebDominguez-zz commented Dec 15, 2018

I'm already using iOS 12.1.1

Is it possible that Homeassistant configure the light the same way as my buggy homebridge-mqtt light?

I think that setting a light in Homebridge with both RGB and Temp feature end up to be glitchy in home.app.

It seems that RGB light should only have hue/sat properties. (They end up having the temperature setting anyway)

@cdce8p
Copy link
Member

cdce8p commented Dec 15, 2018

We only add the temperature support if the light support it. You're right that it seems to work fine if the light doesn't support color temp. However we cannot remove that feature since some lights are able to use it.

This really locks like a bug that should be solved in HomeKit.

@SebDominguez-zz
Copy link
Author

I'm not asking to remove any features, just asking if adding temperature feature to an RGB light in Homebridge is right since apparently hue/sat light already have temperature settings. Adding Temperature control to a light that already have RGB settings isn't adding any more feature, and seems to mess with the way HomeKit/home.app handle those lights

@cdce8p
Copy link
Member

cdce8p commented Dec 15, 2018

It might be redundant, but then again if HA supports it I think every implementation should support it as well. I'm not completely sure but there might be lights that process color temp settings differently then just color ones.

If you think that should be change so that color and temperature are exclusive, you can start that discussion here: https://github.com/home-assistant/architecture

@SebDominguez-zz
Copy link
Author

"How many developers does it take to fix a light bulb" immaright?

I'm actually running Homebridge and RGB light are happy with colorTemperature payloads so no problem with that.

That's sad, I wish it was easier to get such basics and native features to work flawlessly...

@warcanoid
Copy link

"How many developers does it take to fix a light bulb" immaright?

I'm actually running Homebridge and RGB light are happy with colorTemperature payloads so no problem with that.

That's sad, I wish it was easier to get such basics and native features to work flawlessly...

Very sad that such basic things don’t work

@cdce8p
Copy link
Member

cdce8p commented Dec 16, 2018

As I've said before: This isn't Home Assistants fault. The integration works as expected. If the input we are getting from Homekit is wrong, we can't do much about it.

The longer discussion would be necessary if we want to change the default behavior for all light platforms in order to bypass this issue. However in my opinion we shouldn't do that. Instead the HomeKit API needs to be fixed, but that is out of our reach.
Someone could open a bug report in the Apple Bug Tracker. That might help.

@SebDominguez-zz
Copy link
Author

Well there are some Homebridge Plugin (for instance homebridge-yeelight-wifi) that work correctly with HomeKit, the plugin simply doesn't mix both characteristics of the lightbulb.

@cdce8p
Copy link
Member

cdce8p commented Dec 16, 2018

Yeah that might work, but to reiterate myself here: That's not how the HA integration works and thus the platform definition would need to be changed.

@SebDominguez-zz
Copy link
Author

So you are saying that Apple must update they API according to HomeAssistant's integration?

@cdce8p
Copy link
Member

cdce8p commented Dec 16, 2018

No! It just seems as if they are only saving the white values in custom colors. The default ones in the set worked fine for me.

@SebDominguez-zz
Copy link
Author

Well not for me, as my recording clearly point out how I'm unable to use the green preset for instance but the blue color is working fine. And this seems to be completely random for me. Also I'm unable tu use the color temperature as well.

@cdce8p
Copy link
Member

cdce8p commented Dec 16, 2018

As I've said it only works with the default color choices. Not custom ones.
The fact the some custom ones do work cleary shows that's an issue that needs to be resoved in Homekit.

@SebDominguez-zz SebDominguez-zz changed the title Yeelight RGB lightbulb + Homekit color switcher Homekit light color switcher Dec 16, 2018
@SebDominguez-zz
Copy link
Author

SebDominguez-zz commented Dec 16, 2018

Ok so no solution then.
Well hassio was interesting, but I guess it need a little more time to be fully functional or maybe more testing...
I'll be waiting to see how well this is going on, but until then I'll switch back to Homebridge / Node-RED has some plugin seems to handle HomeKit integration correctly.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@SebDominguez-zz
Copy link
Author

Nope, the update doesn't solve this issue.

@asjmcguire
Copy link

v0.90 has been released - does the issue persist with it?

@stale
Copy link

stale bot commented Jul 7, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2019
@dezmob
Copy link

dezmob commented Jul 7, 2019

This is still an issue

@dodepier
Copy link

I have exactly the same issue with homekit and Lifx on Hassio 0.98.1

@stale
Copy link

stale bot commented Dec 18, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2019
@SebDominguez
Copy link

I think this problem will last for a while...

@stale stale bot removed the stale label Dec 18, 2019
@stesto
Copy link

stesto commented Jan 9, 2020

I googled a lot to find an answer because this bug really annoys me... Then I came across Apples documentation pdf when it comes to HAP (non commercial version) and it says the following:

9.21 Color Temperature

[...] If this characteristic is included in the "8.23 Light Bulb" (page 147), "9.44 Hue" (page 179) and "9.82 Saturation" (page 197) must not be included as optional characteristics in "8.23 Light Bulb" (page 147). This characteristic must not be used for lamps which support color. [...]

So it seems intentional that we can't use colors and temperature... Which is quite sad actually.

@SebDominguez
Copy link

So it seems intentional that we can't use colors and temperature... Which is quite sad actually.

If the bulb is configured with color properties it automatically get temperatures characteristics as well.

I really don’t get why this is so complicated for the homeassistant dev to understand that

@stesto
Copy link

stesto commented Jan 9, 2020

I actually don't use HomeAssistant. I use ioBroker. I want to build a custom led controller, where I can control rgb (strip) with (another) warm white and cold white leds (strip). So if Apple implemented that color AND temperature thing right, I could do that. Now I have to rely on hsb values only and "extract" the white-values from that.

If the bulb is configured with color properties it automatically get temperatures characteristics as well.

So in HomeAssistant you can't "uncheck" that? I can choose if I want the temperature characteristic enabled or not.

@SebDominguez
Copy link

SebDominguez commented Jan 9, 2020

I’m actually using homebridge-mqttthing.

There is the link where I discussed this wired homekit behavior with the plugin author

arachnetech/homebridge-mqttthing#71

I configured a light bulb with only color properties and I have no problem sending color temperatures values to it.

In homeassistant I didn’t find a way to disable the temperature property for color light bulb.

@stesto
Copy link

stesto commented Jan 9, 2020

You can still see the temperature-tab in Homekit that's right, but this selection is represented as "rgb" (in this case hsb) values. When using the dedicated temperature characteristic (without color of course) you get nice Mired-values which I can apply to the white leds quite easily. Now I have to use some weird function to calculate the mired values from rgb and apply it all the time, because I don't know if the user selected a color or a temperature... I wonder if the result will be good.

Are you okay with the hsb values only?

@SebDominguez
Copy link

Are you okay with the hsb values only?

Yes unfortunately the plugin that I’m currently using is reporting me hex values when I pick a color temp from the home.app.

Maybe there is a way to configure it to accept directly kelvins values or whatever... I didn’t changed my configuration since last year

@stesto
Copy link

stesto commented Jan 9, 2020

Hex values are okay i guess. Depends on the context.
Hopefully Apple is able to manage to implement both color and temperature. I mean, they could just make a value which says whether a color or a temperature was selected. So the home.app doesn't need to struggle which color it should show as a preview and the developer can just use the color values or the temperature value (depending on the new value) and apply it on the bulb/strip/whatever. But that would probably wouldn't work when it comes to backwards compatibility...
I don't have any philips hue bulbs but you can control them via the home.app right? They have a "color and white" bulb. Is it possible to control it properly through the home.app?

@SebDominguez
Copy link

Yeah, Apple implementation is wired, but it’s the Apple way to do it.

I have no experience with Philips Hue bulbs, I’m using Yeelight bulbs (RGB bulb and White bulb)

They are kind of finicky (limitation of payloads per minutes, and struggle to get back on wifi after a power outage)

If you find a better way to handle both HSV and temp characteristics with homebridge please share your solution, I didn’t change my setup since I managed to get it “somewhat” working and I gave up this topic since Apple / Homeassistant doesn’t care about this getting patched.

@frenck
Copy link
Member

frenck commented Jan 14, 2020

@SebDominguez Sure I care: #30756

@SebDominguez
Copy link

Finally after nearly 400 days someone decided to fix this despite the fact that according to @cdce8p there wasn't any problem at all and the whole HomeKit thing needed to be updated and not the homeassistant integration.

Thanks you very much @frenck, I'll try to check if this fix the problem once for all.

I really wish it that the process of reporting a problem was easier thought

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

Successfully merging a pull request may close this issue.