mariusmotea / diyHue

Philips Hue emulator that is able to control multiple types of lights
Other
627 stars 107 forks source link

Mi-Light fut089 / B8 protocol support #127

Closed yavadan closed 6 years ago

yavadan commented 6 years ago

Hi, Is there any plans to possibly add support for rgb-cct fut089 / B8 controller protocol which supports 8zones instead of 4 on supported Mi-Light bulbs.

Sidoh has added this support in thelatest versions of his esp Mi-Light hub

https://github.com/dotsam/homebridge-milight/issues/39 https://github.com/sidoh/esp8266_milight_hub/issues/95

mariusmotea commented 6 years ago

If support on milight hub exist, then i believe i only need to extend the drop down selection field from 4ch to 8ch, or there are also other changes?

yavadan commented 6 years ago

Ah ok. I had a look at the code.

I added the extra Protocol value and also 4 extra groups like the following.

<option value=\"rgbw\">RGBW</option>
<option value=\"cct\">CCT</option>
<option value=\"rgb_cct\">RGB+CCT</option>
<option value=\"rgb\">RGB</option>
<option value=\"fut089\">Fut089/B8</option>
</select>
</div>
<div class=\"pure-control-group\">
<label for=\"group\">Group</label>
<select id=\"group\" name=\"group\">
<option value=\"1\">1</option>
<option value=\"2\">2</option>
<option value=\"3\">3</option>
<option value=\"4\">4</option>
<option value=\"5\">5</option>
<option value=\"6\">6</option>
<option value=\"7\">7</option>
<option value=\"8\">8</option>

It all works ok however I am having inconsistencies with the colour I select and the colour displayed on the light. Blue seems to purple etc.

I'll try do more testing with the colours when I have time later. the bulbs are RGB+CCT so ill add some of them in as that and see if it makes a difference.

mariusmotea commented 6 years ago

If you want to record your contribution to this project you can made a PR, if not i will add. Philips Hue work with xy CIE color values, to be able to control color Milight bulbs i add the function convert_xy(), that convert the values to rgb. I'm sure this was working fine, but you can test by running the HueEmulator.py script manually (with sudo) and check the output. If RGB values are not printed you can add extra print lines in convert_xy() function. When you set the color to blue the output must be close to [r=0,g=0,b=255]. if red is also too much, then issue is with conversion function, if not then the issue is with milight hub or with bulb itself.

Marius.

pauleec commented 6 years ago

@marius Merry Christmas! I would like to get involved and offer some testing assistance if needed. I have an 8-zone environment of various types of the MiLight Full color/RGB-CCT 8-zone compatible downlighters, spotlights, bulbs and strip controller here linked to a single mi-light lamp/bridge and the B8 (panel and remote) setup for the lights in each zone. I have observed on occasions one or more lights in a zone may go out of color sync and as a result look out of place when compared to the other lights in the same zone. The light realigns itself to the correct zone color by making an adjustment to the zones color saturation setting (either with the mi-light 3 iOS or android app and through the bridge or directly via the remotes). I'm not sure if the problem described earlier was the same but the observation may be useful. Let me know if and how I can assist. Happy Holidays and I'm looking forward to working with this project and assisting where I can.

mariusmotea commented 6 years ago

Merry Christmas Paul! I need to understand exactly your setup. Your are using MiLight Hub with this project and Philips Hue official application in order to control the lights?

one or more lights in a zone may go out of color sync and as a result look out of place when compared to the other lights in the same zone

you setup more lights on same channel, so when you control that channel multiple lights are affected and sometimes the lights on that channel are out of sync? My project do a simple task here, receive xy coordinated from hue application, apply a generic conversion formula from xy to rgb and pass rgb values to milight hub. Conversion formula in not perfect, but in general is ok with most types of lights. Also, if you setup the lights this way the hue emulator see all lights as only one and it send the rgb values just for that light so the lights in that zone must have same color state, maybe there is a bug in MiLight Hub.

Marius.