rainlake / homebridge-platform-lightify

MIT License
13 stars 5 forks source link

Color Temperature #19

Open stephenfsnow opened 5 years ago

stephenfsnow commented 5 years ago

As far as I know, all of the Lightify bulbs and light strips accept both RGBW and Color Temperature (in Kelvin). However, when attempting to set Color Temperature using the Temperature wheel in the Home app, the color of the bulb is set with far too much red or far too much blue. It seems that with color bulbs, this plugin attempts to do some calculation to convert Temperature from the Home app to RGB values instead of just converting the Mired temperature value to Kelvin and sending that to the bulb.

In index.js on line 223 if I remove the else condition for temperature support, color temperature is properly set on the bulbs using the temperature wheel but then a few issues pop up when attempting to set color...

1) When navigating to the edit color screen in Home app, it defaults to the temperature wheel always, even if the last color set was by HSV/RGB. 2) When setting temperature on the temperature wheel, the color dot will sometimes show last color set and sometimes temperature. I can't seem to pinpoint when it decides to show a color dot or a temperature dot. img_2867

3) Automations and scenes do not seem to want to set color temperature when selected from the wheel.

I've been tinkering to see if I can make it all come together but if anyone has any insight that'd be much appreciated.

benjackson1111 commented 4 years ago

I have exactly the same experience, although the way I got the Home App to set mired temperature was adding in the code from the temperature bulb as an additional set of functions etc to the color bulb code. Unfortunately, I have the same bugs as you. Probably why the dev didn't make it work this way. What's frustrating is that RGB values for 'white' etc are nowhere NEAR as bright as mired white. Otherwise I wouldn't have bothered.

I'm close to giving up. I've ordered a Hubitat Hub (which can itself be put on Homebridge via it's own plugin) and I'm hoping that is better at doing this with proper mired temperature. However, I'm not holding out hope for that either as when I was using a Wink hub (before it went subscription) the Home App was not able to set proper mired temperature either. My workaround with the Wink was to have Siri Shortcuts app send an IFTTT request via Wink to set a proper Wink scene - that would honor proper settings for temperature. The Hubitat Hub also has IFTTT support (unlike the Osram hub) so that's my planned workaround again if it still doesn't work. I'm surprised more people aren't talking about this.

The other, expensive, fix is to get the new Philips Hue recessed lights that are still to be released. It'll cost be about $2000 to do it, so hence my desire to try to make these old Sylvania/Lightify lights act appropriately. Obviously it depends on the software controlling them, and this plugin doesn't do the right thing, nor did the Wink Homebridge plugin. I'm just hoping the Hubitat Homebridge plugin will be better coded...

If we could figure out (maybe from the dev?) as to why the code in this plugin is so flakey when going between color and mired temp....and why scenes don't work. For me, any scene I set using mired temp works for 1/2 a second and then resets back to some arbitrary color. I can SORT OF make the manual setting of a color temp or color work within home, but with the bugs you mentioned already.

Anyway. Sorry for long post. Would have loved to figure this out (I thought I was so smart getting the color temp code added to the colorbulb code, and it all suddenly worked initially before I noticed all the bugs!)

:)

benjackson1111 commented 4 years ago

If anyone is ever reading this... I found a good workaround. Doesn't use this plugin.

  1. Create your scenes (moods) in Osram app, or in whatever hub you have for these lights - this app should have the ability to connect to Alexa, and share it's scenes with Alexa. Test your scenes in the app - should be immediate and perfect how you want them.
  2. Download/install homebridge-dummy-switch and install that (the one with the contact sensor included as part of the switch). Add as many switches as you want for each scene, name them sometihng sensible to reference the scene you're going to trigger.
  3. Download/install homebridge-alexa, and make sure you set that up properly with the option to send contact sensors through to Alexa for routines.
  4. Make sure you can see the dummy switch and the contact sensor, as well as your scenes in Alexa. Sometimes need to re-discover devices or restart homebridge.
  5. Make an Alexa routine that looks for the contact sensor to 'open', that triggers your scene.
  6. Try it out - go to Home and turn 'on' the dummy switch. By defaut the switch and contact sensor are grouped, you can ungroup if you want. The switch should run the routine.
  7. Use Shortcuts app to make more complicated steps that may include things that would be better to run from Home rather than Alexa routines. For instance, I have a Philips Hue scene state as one step, then the contact sensor for the 2nd set of (non-Philips) lights. The entire scene is set.

Seems pretty fast. Much faster than my other workaround with Wink of sending web requests using webhooks from Shortcuts, to IFTTT, then over to Wink via the web... and then having Wink send the scene request to the lights. Could take up to 60 seconds for this!! This new workaround only takes 2-3 seconds. Not as good as the instant-ness of using the native app (Osram, which is pretty decent now it has local processing). I'm still going to get a Hubitat Hub as they just seem good, and it has an ethernet port which the Osram bridge doesn't. But, I could probably cancel the order and just do it this way and I'd be pretty happy.

Hope this helps someone.

csmith408 commented 4 years ago

Hey i read it!! i hate when i say turn the lights white they dont it turns them a pink color, i wwas hooping to have a feature like moods enabled kind of how you can set groups to true so you can see them, so i could say siri turn the lights white and the mood would be set to 5000k etc

but someone said there servers are going down next year so it wont be worth it pretty much

benjackson1111 commented 4 years ago

Ya. So I bought a Hubitat hub. It’s 99% reliable, doesn’t require cloud or their servers to keep running and just processes the requests locally. The sylvania / osram products can be made decent with the hubitat.

benjackson1111 commented 4 years ago

Including asking for white from Siri (using the hubitat homebridge plugin) and it actually switching to white not a color

csmith408 commented 4 years ago

i had it returned it, but only used it for a week. bought it for 85 off amazon, in my head i thought it would be a little more user friendly with making nodes to do things etc

i wanted it to do something basic like turn a light red when the garage door opened but was a pain. i went back to homebridge i tried home assiant to but im a apple fan. an homebridge makes it happen

csmith408 commented 4 years ago

maybe i should look back into getting it i have a smart things hub i bought for a lock

csmith408 commented 4 years ago

but this thing would be gold if when i say turn the lights white it does that and doesnt make them pinkish!! so what youre saying to do is to make a dummy switch and have alexa trigger it by doing that task, but what about with siri, i have the alexa homedridge installed

dalethomas81 commented 4 years ago

i had it returned it, but only used it for a week. bought it for 85 off amazon, in my head i thought it would be a little more user friendly with making nodes to do things etc

i wanted it to do something basic like turn a light red when the garage door opened but was a pain. i went back to homebridge i tried home assiant to but im a apple fan. an homebridge makes it happen

There is a homebridge plugin for hubitat.

csmith408 commented 4 years ago

yeah i used it the hubitat program for it but i used wink for it because it was pretty much the same thing and had instant aka local control. (not doing a few lights at time and sometimes missing) i have 20 in my living room so it was a nightmare!!

so got rid of hubitat used wink then wink started chargign so went back to the ligitfy hub which works great (the app itself) but with alexa and siri the controls are off for white

like my wife will come in and say make the lights white and they go pink. you say blue they go blue!! but white is what i need to make my wife happy she just wants white lol

dalethomas81 commented 4 years ago

yeah i used it the hubitat program for it but i used wink for it because it was pretty much the same thing and had instant aka local control. (not doing a few lights at time and sometimes missing) i have 20 in my living room so it was a nightmare!!

so got rid of hubitat used wink then wink started chargign so went back to the ligitfy hub which works great (the app itself) but with alexa and siri the controls are off for white

like my wife will come in and say make the lights white and they go pink. you say blue they go blue!! but white is what i need to make my wife happy she just wants white lol

I hear you. But unfortunately Lightify is shutting down it’s servers next year so there’s no point in putting any more effort into this. After August 2021 you will lose most all functionality of the hub including pairing new devices and configuring current devices. https://www.google.com/amp/s/www.techhive.com/article/3532053/osram-turning-off-cloud-servers-for-lightify-smart-bulbs-next-august.amp.html

csmith408 commented 4 years ago

yeah that sucks for sure thanks for sharing, what hub are you goign to use, i have smarthings i could use them on. maybe i should just do that now so i dont have to worry but a year is far away

dalethomas81 commented 4 years ago

yeah that sucks for sure thanks for sharing, what hub are you goign to use, i have smarthings i could use them on. maybe i should just do that now so i dont have to worry but a year is far away

I have already started migrating over to node-red using node-red-contrib-zigbee and a cc2531 zigbee coordinator. I use node-red-contrib-homekit-bridged for my HomeKit integration.

csmith408 commented 4 years ago

so you use your pie with that cc2531? i tried the node red awhile back thats what made me want to check out the hubatit but got prety confusing to a simply thing like i wanted something like when i hit this switch make these lights goo on etc... so i just set it up like that in teh apple home app instead

dalethomas81 commented 4 years ago

so you use your pie with that cc2531? i tried the node red awhile back thats what made me want to check out the hubatit but got prety confusing to a simply thing like i wanted something like when i hit this switch make these lights goo on etc... so i just set it up like that in teh apple home app instead

No I have a Dell r610 server running Windows Server. Yeah I know what you mean. It is a bit of a learning curve but it gives you so much control. You can literally do anything with it and chances are that if you get stuck someone else has had the same problem and can help you.

However, I do use the home app for a lot of my automations. Like you said, it is really easy to do it that way. What node-red is good for is converting things so that they can all talk together well.

csmith408 commented 4 years ago

oh nice. prob way faster then the pie!! i watched a bunch of youtube videos with a dude with almost no hair but still keeps it with gel and all talking about it and showing you how to set up a node. i not a total noob but just dont fully understand all the differnt commands to do this and that. and if etc...

so the red node is on homebridge now i will have to check that out then, here is a example of something i would like is at a certain time of day i want these lights to bee 3000k instead of 5000k, but it kinda sucks because i have these lights on a smart switch simple on and off/ so my lights are not wired on constantly there for it cant say hey at 6am when your wife wakes up. make sure the lights are 5000k and not blue lol

i tried having them wired on all the time and used the home app to say when i hit this switch turn on the livingroom lights but there was anywhere from a 3-5 second delay and i have kids so they would be even more impatient