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

Moonlight detection doesn't work for ceiling lamp #118

Closed
darenegade opened this issue Nov 13, 2023 · 9 comments · Fixed by #119
Closed

Moonlight detection doesn't work for ceiling lamp #118

darenegade opened this issue Nov 13, 2023 · 9 comments · Fixed by #119
Assignees

Comments

@darenegade
Copy link

First of all: thanks for the great plugin. It works pretty well overall and I really like it.

But unfortunately since version 3.0 the moonlight detection doesn't work anymore for my ceiling lamp (Yeelight JIAOYUE YLXD05YL).

I searched the log for some evidence why it's not working anymore and found a difference in the lamp initialization.

On 2.4 I get:

[12/11/2023, 19:46:40] [Yeelight] Received advertisement from ee9054.
[12/11/2023, 19:46:40] [Yeelight] Device celing3-ee9054 supports moonlight mode
[12/11/2023, 19:46:40] [Yeelight] Device ceiling3-ee9054 supports brightness
[12/11/2023, 19:46:40] [Yeelight] Device ceiling3-ee9054 supports color temperature

On 3.0 the moonlight is missing:

[12/11/2023, 16:11:56] [Yeelight] Received advertisement from ee9054.
[12/11/2023, 16:11:56] [Yeelight] Device ceiling3-ee9054 supports brightness
[12/11/2023, 16:11:56] [Yeelight] Device ceiling3-ee9054 supports color temperature

I guess the active_mode is missing somehow on the Support Field of the search response, as the feature init was changed in version 3.0 to identify the moonlight ability. But I can't verify this as the multicast udp response is hard to recreate without coding. (Do you know a way to get that response from the lamp without coding?)

If this is the case the init may not use that for feature detection. But I didn't found an other simple way from the documentation to get that information.

One solution could be to override feature detection via config for specific devices.

What do you think?

@vieira
Copy link
Owner

vieira commented Nov 14, 2023

Hello @darenegade,

I don't have a device with moonlight to test, can you please send me the search response for that device?

You should be able to get it by running something like (tested on a mac):

echo -ne 'M-SEARCH * HTTP/1.1\r\nMAN: "ssdp:discover"\r\nST: wifi_bulb' | nc -w1 -u -p 43210 239.255.255.250 1982 & nc -ul 43210

Example output:

HTTP/1.1 200 OK
Cache-Control: max-age=3600
Date: 
Ext: 
Location: yeelight://10.0.0.209:55443
Server: POSIX UPnP/1.0 YGLC/1
id: 0x00000000035e8d06
model: color
fw_ver: 75
support: get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_rgb set_hsv set_adjust adjust_bright adjust_ct adjust_color set_music set_name
power: on
bright: 2
color_mode: 3
ct: 4000
rgb: 8213247
hue: 255
sat: 68
name: 

@darenegade
Copy link
Author

darenegade commented Nov 16, 2023

@vieira

Thank you for your help. I was able to execute the command and got the following response from my ceiling light:

HTTP/1.1 200 OK
Cache-Control: max-age=3600
Date: 
Ext: 
Location: yeelight://192.168.178.33:55443
Server: POSIX UPnP/1.0 YGLC/1
id: 0x0000000005ee9054
model: ceiling3
fw_ver: 48
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 set_name set_adjust adjust_bright adjust_ct
power: off
bright: 100
color_mode: 2
ct: 3623
rgb: 0
hue: 0
sat: 0
name: 

As suspected, the support flag for active_mode is missing here, although the lamp supports moonlight-mode.

@Mimomaj
Copy link

Mimomaj commented Nov 23, 2023

Same problem here on my ceiling lights, I can also help with testing if needed.

@vieira
Copy link
Owner

vieira commented Nov 24, 2023

Unfortunately I don't see anything in the response that could be used to detect support for the moonlight mode. I will explore some other ideas and release a beta version for you to test.

@vieira vieira self-assigned this Nov 26, 2023
vieira added a commit that referenced this issue Nov 26, 2023
As reported in #118 there is no value in the `support` array or
attribute in the initial advertisement that allows for dynamically
detecting if a device supports moonlight mode.

To work around this limitation we try to proactively send a `get_prop`
request for `active_mode` and will initialize the feature accordingly.

Fixes #118.
@vieira
Copy link
Owner

vieira commented Nov 26, 2023

Hello @darenegade, @Mimomaj,

I (tried) to fix the issue in #119 and published a new beta version 3.0.1-beta.0 to npm.

Let me know if it fixes the issue for you. Also let me know if you find any other new issues with this release.

Thanks!

@Mimomaj
Copy link

Mimomaj commented Nov 26, 2023

Hi @vieir, issue is fixed, thank you for your work. I'll let you know in case I found any other issues.

@darenegade
Copy link
Author

@vieira I just tested the beta and the issue is fixed for me too.
Great work👍

@alondj99
Copy link

@vieira beta works great
Thank you so much 😊

vieira added a commit that referenced this issue Dec 15, 2023
As reported in #118 there is no value in the `support` array or
attribute in the initial advertisement that allows for dynamically
detecting if a device supports moonlight mode.

To work around this limitation we try to proactively send a `get_prop`
request for `active_mode` and will initialize the feature accordingly.

Fixes #118.
@vieira
Copy link
Owner

vieira commented Dec 15, 2023

Thanks for taking the time to test! Published 3.0.1 with the fix.

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 a pull request may close this issue.

4 participants