mariusmotea / diyHue

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

Hue Entertainment - Yeeligth Stripes dont change color #287

Closed UniCizin closed 6 years ago

UniCizin commented 6 years ago

Hello,

i finally got the Hue Emulator up and running (with the "downgraded Hue Android App"-Workaround) and my Entertainment Area set. I even can change the lights and color in the Hue App, but Hue Sync app or Razer Synapse cant change the colors of the stripes. The bridge is found in both apps, the light is recognized, but no output of commands.

Does anybody know how to set this up right?

Marmi86 commented 6 years ago

I have the same problem with milight (esp8266 diy wifi bridge and fut038 wifi rgbw controller) with Ws2812b strips hue entertainment works fine

mariusmotea commented 6 years ago

Hi,

Was not tested yet, so far i made a blind implementation for other devices with limitation to one request per second to not overload the destination devices that don't have proper udp streaming service. For Yeeligth i expect problems because the software limitation of requests / minute. In one day i play a little bit with the bulb controls and it stop responding very quick, so very likely will need to tune the burst rate until the light will work with no interruptions. If you want to obtain the maximum experience from Hue Entertainment i recommend to buy an Wemos D1 mini + one Ws2812B strip. One benefit is that you can create more virtual lights from single device and response time will be very fast. I expect it can be even faster that original hue devices because the wifi latency is lower on wifi than on zigbee.

mariusmotea commented 6 years ago

Now i see this:

Per default the bulb limits the amount of requests per minute to 60, a limitation which can be bypassed by enabling the music mode. In music mode the bulb is commanded to connect back to a socket provided by the component and it tries to keep the connection open, which may not be wanted in all use-cases.

If i will have time i will create suck tcp stream, but currently i'm very very busy

mariusmotea commented 6 years ago

Can somebody paste some output from hue-emulator script during the entertainment steaming process, maybe i will be able to identify the error and perform an quick fix?

UniCizin commented 6 years ago

when you give me a quick hint on how to do that, i can provide you the output.

mariusmotea commented 6 years ago

yes,

sudo systemctl stop hue-emulator
cd /opt/hue-emulator
sudo ./HueEmulator3.py
UniCizin commented 6 years ago

i guess this wont help much.. it just keeps repeating those lines.. i connect to the bridge with Razer Synapse and changed Colors there.

/opt/hue-emulator $ sudo ./HueEmulator3.py Config loaded starting ssdp... start ssdp broadcast sync with lights Starting ssl httpd... Starting httpd... 192.168.0.27 - - [17/Jul/2018 15:20:43] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:43] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:43] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:43] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups/2 HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:44] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:44] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:45] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:45] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:46] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:46] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:47] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:47] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:48] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:48] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:49] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:49] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - Sending M-Search response to 192.168.0.25 192.168.0.27 - - [17/Jul/2018 15:20:50] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:50] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:51] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:51] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - Sending M-Search response to 192.168.0.25 192.168.0.27 - - [17/Jul/2018 15:20:52] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:52] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - Sending M-Search response to 192.168.0.25 192.168.0.27 - - [17/Jul/2018 15:20:53] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:53] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:54] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:54] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:55] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:55] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:56] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:56] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:57] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/lights HTTP/1.1" 200 - 192.168.0.27 - - [17/Jul/2018 15:20:57] "GET /api/b228fcef95b57ef6b7b1064755eb3d39/groups HTTP/1.1" 200 -

mariusmotea commented 6 years ago

something is not right. Did you start hue sync ? i don't see the PUT request to start the streaming.

BTW, if the streaming remain active you may face issues to connect with hue sync. To fix this open Hue app and stop the streaming, then start again hue sync.

UniCizin commented 6 years ago

okay, there is alot of new output with hue sync

i attached it in the file below hue_sync_emu.txt

mariusmotea commented 6 years ago

these lines:

LightRequest: http://192.168.0.28
LightRequest: http://192.168.0.28
LightRequest: http://192.168.0.28
LightRequest: http://192.168.0.28

where made one at every second?

192.168.0.28 is the Yeelight bulb?

UniCizin commented 6 years ago

yes to both questions (but its a Stripe, not a bulb, if that matters)

mariusmotea commented 6 years ago

I arrived home and i test it with the yeelight color bulb. For me it was working. Did you turn on the bulb before starting the entertainment mode?

UniCizin commented 6 years ago

You tested it with the Hue Sync App? I can switch scenes in the App and get the lightning, but Game Mode or Razer Synapse connection does not work.

mariusmotea commented 6 years ago

I test with movie/video mode on Mac. I was expected to hang but yeelight bulb was able to handle the fast rate of requests. One thing that i need to improve is to add transitiontime parameter to 100ms, because default is 400ms and we don't need smooth transitions here.

UniCizin commented 6 years ago

after playing with the hue sync app in combination with razer synapse, i got this error message. (hue sync does not change any lights.. no matter what mode i choose, so i use razer to have a bit more control over the lightning).. do i need to set up an meet-hue account?

192.168.0.27 - - [18/Jul/2018 09:46:52] "PUT /api/b228fcef95b57ef6b7b1064755eb3d39/groups/2 HTTP/1.1" 200 - in PUT method /api/b228fcef95b57ef6b7b1064755eb3d39/groups/2 b'{"stream":{"active":true}}' start hue entertainment

. Seeding the random number generator... ok . Loading the CA root certificate ... ok (0 skipped) . Loading the server cert. and key... ok . Bind on udp://*:2100/ ... ok . Setting up the SSL/TLS structure... ok . Waiting for a remote connection ...192.168.0.27 - - [18/Jul/2018 09:46:52] "GET /api/a7161538be80d40b3de98dece6e91f90/ HTTP/1.1" 200 - [ { "success": { "/groups/2/stream": { "active": true } } } ] 192.168.0.27 - - [18/Jul/2018 09:46:57] "GET /api/a7161538be80d40b3de98dece6e91f90/ HTTP/1.1" 200 - connection was closed gracefully . Closing the connection... done . Waiting for a remote connection ... ok . Performing the SSL/TLS handshake... hello verification requested . Waiting for a remote connection ... ok . Performing the SSL/TLS handshake... failed ! mbedtls_ssl_handshake returned -0x6c80

Last error was: -27776 - SSL - Unknown identity received (eg, PSK identity)

. Waiting for a remote connection ... ok . Performing the SSL/TLS handshake... hello verification requested . Waiting for a remote connection ... ok . Performing the SSL/TLS handshake... failed ! mbedtls_ssl_handshake returned -0x6c80

Last error was: -27776 - SSL - Unknown identity received (eg, PSK identity)

mariusmotea commented 6 years ago

One issue that i discover is that currently is mandatory to stop streaming manually always in order to made it to work next time. For example if i close the hue sync app without to stop the streaming there will be no http request to stream => active": false, so to fix this i need to open mobile phone hue app that will popup a message and from there i stop the current entertainment process. On original hue bridge in case one application stop the streaming it will automatically change that value from active:true to active:false.

Update: for razer i need their devices in order to pair synapse with hue-emulator?

UniCizin commented 6 years ago

Update: for razer i need their devices in order to pair synapse with hue-emulator?

no, you can install razer synapse 3 and inside, the Hue module . There you can add the emulator as a bridge.

I do have a razer HDK (led strips), but i dont think it's mandatory..

ghost commented 6 years ago

@UniCizin Does this issue still exist? Do you still need support?

UniCizin commented 6 years ago

the issue is solved with not changing colors is solved. It matches with HueSync almost perfect. but the Bulb freezes form time to time, i did not find the right timings yet.