Yeah, we’d have to build out the infrastructure to send/catch the colors of the lights, which I think might require identifying whether the component is in fact a light with RGB capabilities.
I have done some research with ha-bridge and it seems that when I am asking to Google Home to change the color, it gives the XY values of that color.
Before changing the color:
"2":{"state":{"on":true,"bri":254,"hue":0,"sat":0,"effect":"none","ct":0,"alert":"none","reachable":true},"type":"Extended color light","name":"Color Light","modelid":"LCT001","manufacturername":"Philips","uniqueid":"00:17:88:5E:D3:02-02","swversion":"5.23.1.13452"}}
After changing the color to Green:
"2":{"state":{"on":true,"bri":254,"hue":0,"sat":0,"effect":"none","ct":0,"alert":"none","reachable":true,"xy":[0.7006062269210815,0.29930099844932556]},"type":"Extended color light","name":"Color Light","modelid":"LCT001","manufacturername":"Philips","uniqueid":"00:17:88:5E:D3:02-02","swversion":"5.23.1.13452"}
Interesting. I know that we can provide an XY value in the turn_on service, but I don’t think it’s particularly well-implemented, especially in non-hue components. I wonder if there’s a formula out there to convert XY to RGB.
Philips hue provides one, I’m assuming this value is using Gamut B since that’s what they use for their bulbs. They provide the objective C to convert it, I’m currently working on turning it into Python. Then, we could throw that into the package for an individual component to do a quick and dirty conversion when no RGB value is sent but an XY value is.
That part is definitely within my capabilities but it’s a hacky solution, the most efficient solution is probably to use the emulated_hue component which I have limited experience with. I think it would be more efficient to have emulated_hue offer both the xy and rgb values, then the individual lights could choose which to handle; this wouldn’t require any additional changes to the individual lights.
I wonder if @balloob, @jeremydk or @hoopty could comment here, since github has them as the suggested reviewers for emulated_hue.
I put together a basic function which does the conversion as per Phillips Hue’s formula. It’s a little hacky, since we’re ignoring the limits Phillips puts on their bulb’s XY input (which in their case serve to prevent the bulb from displaying an impossible color, something we’re not concerned about here).I don’t know if the edge cases can even occur in Emulated_Hue, since the sender (Google Home/Alexa) might force any colors to live within the color range.
Nice, I hope you guys get it working. I noticed this this past weekend when I was setting up my emulated hue. For me though, I have the physical hue bridge as well so I just use both and don’t include lights on my emulated hue.
This well definitely be useful for lights that aren’t hue lights though
FYI, this is currently in development (by someone other than I); I’ve done some testing and it works perfectly. I don’t know if it will be ready for the next release, but it will definitely be showing up at some point.
That’s very good news!!
Please let me know if you need help with anything. I’m happy to help!
So you can tell google home to change the color of lights thru emulated hue?
Yes, like I said it’s still in development and I don’t know when the dev will be finished with it, but you’ll be able to say 'hey google, turn (light name) (color).
Bumping this… Can’t find anymore info and this… Would love to have it.
or if you ever get some time maybe you can tell us how you got this working @dramamoose, or tell us who is developing this so I can check out their work or something
So the pull request is right here. Looks like the dev has temporarily paused working on it. I’ll follow up and see if I can help out with anything to get it finished up.
Thanks ill go check it out
@dramamoose I have made some test with my Yeelight bulbs and it is working perfectly! It will be available in the next update?
I also am using it now, works well with my hue lights. Props to the dev
Can’t guarantee anything since I’m not the dev, but I know he’s looking to work on it this week.
Also tried the code. Works well to get the colours. Can’t get it back to white though… tried white, warm white, cool white. Using them with limitless Led bulbs… Any other ideas?
is it in the official HASS? Or I need to install the code?
That isn’t an option with the hue hub itself and google home, so it won’t be an option here either.
Revisiting this because mine stopped working. Probably because I updated my home assistant last week. Will try to install again…
FYI this option is already implemented in Philips hue hub and is working very well with Google Home.