Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.49k stars 3.1k forks source link

Implement diyHue #40

Open pete111 opened 6 years ago

pete111 commented 6 years ago

Hi @Aircoookie , because I don't have Philips Hue bridge, I am trying it with this emulator https://github.com/mariusmotea/diyHue. Philips Hue mobile app successfully found this bridge, but when I save bridge IP in Wled, no wled device is added to Hue bridge. I also initiated http://bridgeIP/hue/linkbutton?username=Hue&password=Hue&action=Activate (on diyHue) but I am constantly getting Hue status: Inactive on Wled. Could you please try it, too? Probably I should buy one of that expensive Philips bridges :)

Aircoookie commented 6 years ago

Hey,

it's not your Hue emulators fault. WLED can't emulate a Hue lamp, all it does is poll the state of an official hue lamp every few seconds and set itself to the same color. Try adding a virtual hue light in your hue emulator and then, in wled sync settings, tick the checkbox after "poll hue light 1 every X ms". You can thrn change the wled light by changing the virtual hue light in the hue app. However I don't think this would make sense if you just use WLED, it is intended to sync WLED to some other real lights :)

pete111 commented 6 years ago

oh, thanks Aircoookie for clarification. Now I see how hue integration in wled works. It would be nice to have also option in Wled to emulate Hue lamp if possible in future :)

Aircoookie commented 6 years ago

I know, I'd love that feature! I'll add it as soon as the hue protocol supports adding "non-Zigbee" lights! (which it currently doesn't, unfortunately)

pete111 commented 6 years ago

great 👍 I currently tested color cloning from hue bulb (emulated). It mostly works, but momentarily esp reboots (just wanted to let you know).

Aircoookie commented 6 years ago

Yeah, I'll admit it is not the most stable. It helps a bit if you increase the polling interval to 2000ms or something, but of course this means more latency. The ESP doesn't like sending requests all the time somehow. But currently this is the only possible way to sync to hue lights :)

juanesf commented 5 years ago

Hello Aircoookie and thanks for your excellent work I also use the @mariusmotea emulator and you could implement your sketch to add direct support to the emulator

https://github.com/mariusmotea/diyHue/blob/master/Lights/Arduino/WS2812BHueStrip/WS2812BHueStrip.ino

nightflasher commented 5 years ago

Hi, I know this issue is a bit old, but I've found an older project I've used till last weekend I've found yours. It's the esp hue emulator which is controlled by any third party app for the hue system (the ones that I've used so far worked quite well). Please have a look at this and eventually you could implement this? https://github.com/probonopd/ESP8266HueEmulator

Aircoookie commented 5 years ago

In fact I'm already using similar code that was inspired by that project for the Alexa function! Integrating the emulator into WLED would add compatibility with many hue clients, which would be super awesome, but it is quite complex and not a library, so I'd need to do some restructuring to make it compatible and I'm afraid it might have a high performance impact if I add too many new interfaces. Still, I'll keep this in mind and will consider implementing it sometime soon!

juanesf commented 5 years ago

hello again @Aircoookie, @mariusmotea has several sketch to emulate huestrip and huelamps for the diyHue emulator which also has support for hue entertainment. the next sketch has the option to define the amount of lights to emulate by a led strip, and also define from which led the following light begins: https://github.com/diyhue/Lights/blob/master/Arduino/WS2812BHueRing/WS2812BHueRing.ino

while the following can define the amount of lights to emulate per LED strip: https://github.com/diyhue/Lights/blob/master/Arduino/WS2812BHueRing/WS2812BHueRing.ino

with those sketchs you can have direct support from diyHue which can be controlled by an Original Hue Bridge and extend the lights by wifi without the need to add ZigBee. The emulator can be installed on Raspberry, linux, Docker, OpenWrt and I think I saw on YouTube a video where it was running on Windows. Any additional info can enter the chat in Slack: https://slackinvite.squishedmooo.com/

juanesf commented 5 years ago

or perhaps add only the hue entertainment protocol

juanesf commented 5 years ago

https://github.com/diyhue/Lights/commit/9a2479097c0da251b318e6388a44d4c870218270

juanesf commented 4 years ago

This is the link to the last state that worked for diyHue which can serve as something

https://github.com/diyhue/Lights/blob/master/Arduino/wled00/wled06_usermod.ino

juanesf commented 4 years ago

And @alexyao2015 has added a protocol for ESPHome that can serve as a guide, regards

https://github.com/diyhue/diyHue/commits/master/BridgeEmulator/protocols/esphome.py

snickers2k commented 3 years ago

+1 maybe this helps: https://github.com/linuzer/Arduino-HueAPI (another DIYhue arduino implementation with auto discovery)

bravery10 commented 3 years ago

I can sync with Hue Bridge but not with Hue Emulator, I clicked activate on Huelinkbuton page and entered the correct number of lights and checked all box.

juanesf commented 3 years ago

This thread should be closed since diyHue makes discovery directly, it is not necessary to make any changes in wled

juanesf commented 3 years ago

What you should consider is that diyHue is in a protocol transition and the branch that works best is beta but I recommend using docker

bravery10 commented 3 years ago

thank you! i am using docker on raspberry 4B, i have 1 Hue brigde v2 and 1 Hue emulator, i want use wled to clone philip hue light or diyhue light, wled is being used as a ambilight.

Aircoookie commented 1 year ago

I think this could be implemented well as a usermod, adapted from this sketch: https://github.com/diyhue/Lights/blob/master/ESP8266/Hue_Gradient_Lightstrip_SK6812/Hue_Gradient_Lightstrip_SK6812.ino

juanesf commented 1 year ago

The support in diyhue is complete, it is not necessary. There is already a wled protocol in diyhue.

https://github.com/diyhue/diyHue/blob/master/BridgeEmulator/lights/protocols/wled.py