Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Wizard Support for more Yeelight products, and workaround for music-mode reset by some of them. (Fixes: #748) #750

Merged
merged 8 commits into from
Feb 5, 2024

Conversation

ratawhisk
Copy link
Contributor

@ratawhisk ratawhisk commented Jan 27, 2024

Summary

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@ratawhisk ratawhisk changed the title Added Wizard Support for more Yeelight products, and workaround for music-mode reset by some of them. Added Wizard Support for more Yeelight products, and workaround for music-mode reset by some of them. (Fixes: #748) Jan 27, 2024
@awawa-dev
Copy link
Owner

awawa-dev commented Jan 27, 2024

Hi
I took your changes, modified them a bit but I do not have a Yeelight setup to test them.
Could you test it? Branch testing_750 and also Github Action should finish build installers soon.

If it works, then I could merge both our changes into this PR.
Or can you do it in this case?

Unfortunately, the Yeelight controller probably suffers from other serious problems because it is very similar to the old Philips Hue controller, which took me a lot of time to sort out and take into account various possible scenarios. Without a test kit, I won't even attempt to refactor this driver in a similar way. So let's hope this small fix will be enough at least for this issue.

@ratawhisk
Copy link
Contributor Author

Hi, I already made a build with my changes, and testet them for about an hour, mostly the music-mode workaround.
But I will test the new version from you for some extendet time tomorrow.

@awawa-dev
Copy link
Owner

Great! Let me know if it works later and merge changes if it is OK. I suspect that the testing time will not be crucial, but rather the turning on and off of the driver , e.g. when the video source has changed. Or physically turning Yeelight lamp off/on to simulate various device state. But I suspect that other things may come out that are not related to this problem, just like in Philips Hue.... Installers: https://github.com/awawa-dev/HyperHDR/actions/runs/7679690184

@ratawhisk
Copy link
Contributor Author

Okay, so i tested different States.

Switching the video source (grabber to color/effect or back) works without problems
restarting HyperHDR didn't cause any problems
Restart the driver from HyperHDR, no problem.

Up to now, the only issue I found, is when I powercycle the bulb.
HyperHDR can't reconnect to the bulb, and disables the device. Reactivating the LED Device component in HyperHDR after some seconds, and it is back to normal.

2024-01-28T14:44:06.669Z [LEDDEVICE4_YEELIGHT] Yeelight device 'yeelink-light-colorc_miapABBB' signals error: 'Write Error: Socket is not connected'
2024-01-28T14:44:06.676Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:381) Stopping refresh timer
2024-01-28T14:44:06.676Z [LEDDEVICE4_YEELIGHT] Device 'yeelight' is disabled due to an error: 'All Yeelights in error - stopping device!'
2024-01-28T14:44:06.676Z [COMPONENTCTRL4] LED device: disabled

2024-01-28T14:44:45.392Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:247) Enable the device
2024-01-28T14:44:45.392Z [LEDDEVICE4_YEELIGHT] (LedDeviceYeelight.cpp:1203) The music mode server is running at 192.168.1.2:38491
2024-01-28T14:44:45.392Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:64) Switch on
2024-01-28T14:44:46.914Z [LEDDEVICE4_YEELIGHT] Yeelight device 'yeelink-light-colorc_miapABBB' signals error: '(-5001) invalid params'
2024-01-28T14:44:47.414Z [LEDDEVICE4_YEELIGHT] Ignoring Yeelight error when turning off music mode
2024-01-28T14:44:48.079Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:367) Starting timer with interval = 10ms
2024-01-28T14:44:48.079Z [COMPONENTCTRL4] LED device: enabled

@awawa-dev
Copy link
Owner

Thank you for your tests and feedback. I added an autoresume for Yeelight: can you check it? https://github.com/awawa-dev/HyperHDR/actions/runs/7687019660

@ratawhisk
Copy link
Contributor Author

Tested it a few times, and yes, works perfectly! Always at the first Switch on try, the LED gets back in action.

2024-01-28T18:29:23.380Z [LEDDEVICE4_YEELIGHT] Yeelight device 'yeelink-light-colorc_miapABBB' signals error: 'Write Error: Socket is not connected'
2024-01-28T18:29:23.394Z [LEDDEVICE4_YEELIGHT] Device 'yeelight' is disabled due to an error: 'All Yeelights in error - stopping device!'
2024-01-28T18:29:23.394Z [COMPONENTCTRL4] LED device: disabled
2024-01-28T18:29:26.546Z [LEDDEVICE4_YEELIGHT] The LED device is not ready... trying to reconnect (try 1/60).
2024-01-28T18:29:26.546Z [LEDDEVICE4_YEELIGHT] (LedDeviceYeelight.cpp:1206) The music mode server is running at 192.168.1.2:40219
2024-01-28T18:29:26.685Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:64) Switch on
2024-01-28T18:29:27.718Z [LEDDEVICE4_YEELIGHT] Yeelight device 'yeelink-light-colorc_miapABBB' signals error: '(-5001) invalid params'
2024-01-28T18:29:28.218Z [LEDDEVICE4_YEELIGHT] Ignoring Yeelight error when turning off music mode
2024-01-28T18:29:28.859Z [LEDDEVICE4_YEELIGHT] (LedDevice.cpp:392) Stopping retry timer
2024-01-28T18:29:28.860Z [COMPONENTCTRL4] LED device: enabled

@awawa-dev
Copy link
Owner

Thank you again. I combined our changes in this PR. Check if it's OK and test the latest build. If you don't find any new problems then I will merge your PR within a few days.

@ratawhisk
Copy link
Contributor Author

Okay, i will do that.

@ratawhisk
Copy link
Contributor Author

Up to today, everything worked fine.

No new problems!

@awawa-dev awawa-dev merged commit e1b3287 into awawa-dev:master Feb 5, 2024
17 checks passed
@awawa-dev
Copy link
Owner

OK, thank you for the feedback. I just merged these changes.

@DrConflict
Copy link

Just to confirm, it's normal to get this " Ignoring Yeelight error when turning off music mode" log in v20.0 right? There's no way to permanently disable the music mode?

@awawa-dev
Copy link
Owner

awawa-dev commented May 6, 2024

You really do not want to disable the music mode which is using UDP even if it is possible (I dont know if it is). For Philips Hue there is a huge difference when similar entertainment mode (UDP) is enabled or not (REST on TCP). But Philips Hue is a different league in terms of API quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants