awawa-dev / HyperHDR

Highly optimized open source ambient lighting implementation based on modern digital video and audio stream analysis for Windows, macOS and Linux (x86 and Raspberry Pi / ARM).

Home Page:http://www.hyperhdr.eu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for the yeelight w1 Bulb

ratawhisk opened this issue · comments

Feature request

Support for the w1 Bulb from Yeelight

What problem does this feature solve?

The W1 Bulb ist a cheap rgbw spotlight bulb (GU10) from Yeelight. I bought the bulb to throw light at my ceiling at intense moments (lightning/explosions)

But the Bulb is not yet supportet by the yeelight wizard. Also, after adding the bulb manualy, has a bug that if the bulb is disconnected, she stays in music mode, which HyperHDR dosn't handle correctly.

What does the proposed API look like?

How should this be implemented in your opinion?

By adding the light to the wizard.
Her the logfiles:

2024-01-24T18:13:40.122Z [WEBSOCKET] (HyperAPI.cpp:1133) response: [{"devices":[{"cache-control":"max-age=3600","domain":"lan","hostname":"yeelink-light-colorc_miapABBB","id":"yeelight://192.168.1.119:55443","ip":"192.168.1.119","location":"yeelight://192.168.1.119:55443","other":{"bright":"100","color_mode":"2","ct":"4000","date":"","ext":"","fw_ver":"16","hue":"200","id":"0x000000001b4083a7","model":"colorc","name":"","power":"off","rgb":"14414847","sat":"14","support":"get_prop set_default set_power toggle set_bright set_scene cron_add cron_get cron_del start_cf stop_cf set_ct_abx adjust_ct set_name set_adjust adjust_bright adjust_color set_rgb set_hsv set_music udp_sess_new udp_sess_keep_alive udp_chroma_sess_new"},"port":55443,"server":"POSIX UPnP/1.0 YGLC/1","st":"","usn":""}],"ledDeviceType":"yeelight"}]

And the Logs from the error:

024-01-24T18:54:21.747Z [LEDDEVICE4_YEELIGHT] (LedDeviceYeelight.cpp:959) 2| 192.168.1.119| writeCommand() : {"id":3,"method":"set_music","params":[1,"192.168.1.2",35667]}
2024-01-24T18:54:21.747Z [LEDDEVICE4_YEELIGHT] (LedDeviceYeelight.cpp:959) 1| 192.168.1.119| writeCommand(): : Wait 1000ms, elapsedTime: 1ms < quotaTime: 1000ms
2024-01-24T18:54:22.748Z [LEDDEVICE4_YEELIGHT] Yeelight device '192.168.1.119' signals error: '(-5001) invalid params'
2024-01-24T18:54:23.248Z [LEDDEVICE4_YEELIGHT] (LedDeviceYeelight.cpp:959) 2| 192.168.1.119| setMusicMode() rc : 0, isInMusicMode[0]
2024-01-24T18:54:23.249Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:354) Stopping refresh timer
2024-01-24T18:54:23.249Z [LEDDEVICE4_YEELIGHT] Device 'yeelight' is disabled due to an error: 'All Yeelights in error - stopping device!'

Are you willing to work on this yourself?

I am not good enough to write code, but it seems to be the same issue like this one:

hyperion-project/hyperion.ng#1372

Thank you for your work, and time to look at my "problem"

Okay, after tinkering for a while, I was able to implement the changes in a fork, tested them, and created a pull request

OK, thank you. I will take a look later.

Sorry to revive this, but is the W1 currently supported in the release version?

It should work in v20. I merged @ratawhisk changes and added auto-resume feature.