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 device discover feature for YeeLight and lowered the color change delay #1777

Merged
merged 9 commits into from
May 17, 2020
Merged

Conversation

snake-4
Copy link
Contributor

@snake-4 snake-4 commented Nov 1, 2019

This pull request proposes the following changes:

  • Adds device discover feature for YeeLight.
  • Lowers the color change delay from 100 to 35.
  • Updated YeeLight library version to 0.0.6

Known issues/To do:

  • Nothing.

@snake-4 snake-4 changed the title Removed Roccat Vulcan and added device discover feature for YeeLight Added device discover feature for YeeLight Dec 11, 2019
@snake-4 snake-4 changed the title Added device discover feature for YeeLight Added device discover feature for YeeLight and lowered the color change delay Jan 17, 2020
snake-4 added 4 commits May 14, 2020 01:39
force-pushed, combined commits into one and improved variable registry entries of YeeLight integration.
@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

[ERROR] 08:58:37: Device YeeLight encountered an error during connecting. Exception: System.TimeoutException: The operation has timed out.
   at YeeLightAPI.YeeLightDevice.SetMusicMode(IPAddress localIP, UInt16 localPort, Boolean state)
   at Aurora.Devices.YeeLight.YeeLightDevice.Connect(IPAddress lightIP, DoWorkEventArgs token) in C:\projects\aurora\Project-Aurora\Project-Aurora\Devices\YeeLight\YeeLightDevice.cs:line 162
   at Aurora.Devices.YeeLight.YeeLightDevice.Initialize() in C:\projects\aurora\Project-Aurora\Project-Aurora\Devices\YeeLight\YeeLightDevice.cs:line 48

Getting this error. That is not my path to YeeLightDevice.cs, so not sure if it's because of that. Do any ports have to be opened on router btw?

@snake-4
Copy link
Contributor Author

snake-4 commented May 17, 2020

[ERROR] 08:58:37: Device YeeLight encountered an error during connecting. Exception: System.TimeoutException: The operation has timed out.
   at YeeLightAPI.YeeLightDevice.SetMusicMode(IPAddress localIP, UInt16 localPort, Boolean state)
   at Aurora.Devices.YeeLight.YeeLightDevice.Connect(IPAddress lightIP, DoWorkEventArgs token) in C:\projects\aurora\Project-Aurora\Project-Aurora\Devices\YeeLight\YeeLightDevice.cs:line 162
   at Aurora.Devices.YeeLight.YeeLightDevice.Initialize() in C:\projects\aurora\Project-Aurora\Project-Aurora\Devices\YeeLight\YeeLightDevice.cs:line 48

Getting this error. That is not my path to YeeLightDevice.cs, so not sure if it's because of that. Do any ports have to be opened on router btw?

You need to make sure Aurora is allowed for both outbound and inbound networking in Windows Firewall, follow https://support.microsoft.com/en-us/help/4558235/windows-10-allow-an-app-through-microsoft-defender-firewall

@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

[ERROR] 08:58:37: Device YeeLight encountered an error during connecting. Exception: System.TimeoutException: The operation has timed out.
   at YeeLightAPI.YeeLightDevice.SetMusicMode(IPAddress localIP, UInt16 localPort, Boolean state)
   at Aurora.Devices.YeeLight.YeeLightDevice.Connect(IPAddress lightIP, DoWorkEventArgs token) in C:\projects\aurora\Project-Aurora\Project-Aurora\Devices\YeeLight\YeeLightDevice.cs:line 162
   at Aurora.Devices.YeeLight.YeeLightDevice.Initialize() in C:\projects\aurora\Project-Aurora\Project-Aurora\Devices\YeeLight\YeeLightDevice.cs:line 48

Getting this error. That is not my path to YeeLightDevice.cs, so not sure if it's because of that. Do any ports have to be opened on router btw?

You need to make sure Aurora is allowed for both outbound and inbound networking in Windows Firewall, follow https://support.microsoft.com/en-us/help/4558235/windows-10-allow-an-app-through-microsoft-defender-firewall

That worked. Thanks! What's weird is I did not have this rule in before and it seemed to work in an earlier version. Maybe updating to new Win10 v2004 reset something.

@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

If selecting Away Effects in Aurora and doing Blackout (turns everything black/off), Yeelight stays at same full brightness and last color (e.g. red). Is there a way to dim it at least? I know if you turn it off it loses connection. But at least maybe set brightness to 0?

@snake-4
Copy link
Contributor Author

snake-4 commented May 17, 2020

It's not possible to set brightness to 0 and even 1 is bright enough to light a room.

@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

Which Yeelight bulb and firmware are you using? This has been definitely addressed I think. Can show you photos of my 1S bulbs (YLDP13YL) with minimum brightness vs maximum brightness. Or you mean those settings aren't exposed in API?

@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

If you could add a brightness slider into your plugin (global brightness for all effects is okay) I could show you difference on 1S bulbs.

@snake-4
Copy link
Contributor Author

snake-4 commented May 17, 2020

What I'm saying is that API doesn't allow brightness value 0, it's even specified in the API documents.

@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

Ah, yes I see that.

Method:set_brightUsage:This method is used to change the brightness of a smart LED.Parameters:3."brightness" is the target brightness. The type is integer and rangesfrom 1 to 100. The brightness is a percentage instead of a absolute value. 100 meansmaximum brightness while 1 means the minimum brightness."effect": Refer to "set_ct_abx" method."duration": Refer to "set_ct_abx" method.Request Example: {"id":1,"method":"set_bright","params":[50, "smooth", 500]}Response Example: {"id":1, "result":["ok"]}NOTE:Only accepted if the smart LED is currently in "on" state.

Could you please try setting of 1?

In mean time I think I will reach out to Yeelight and ask them to add option of passing brightness of 0 to soft turn off the light while keeping connection. Should be an easy thing for them to add.

@snake-4
Copy link
Contributor Author

snake-4 commented May 17, 2020

It won't be any useful, maybe setting to white when the color is black could be done though, as white is the default color.

@Hukuma1
Copy link

Hukuma1 commented May 17, 2020

Is there a way to turn down brightness on the specific key I got yeelight connected to at least then? e.g. all keys 100% brightness except ESC key at 25% brightness

diogotr7 added 4 commits May 17, 2020 22:18
if the chosen devicekey wasnt present in the dictionary, the FirstOrDefault() returns null
diogotr7
diogotr7 previously approved these changes May 17, 2020
@diogotr7 diogotr7 merged commit ae32ed1 into antonpup:dev May 17, 2020
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.

4 participants