-
-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Yeelight Discovery #26574
Comments
Hey there @rytilahti, @zewelor, mind taking a look at this issue as its been labeled with a integration ( |
Any update on this topic? I'm from Yeelight and we recently received lots of complaint about the discovery issue. Yeelight discovery mechanism is not changed, the new firmware only adds Homekit function. |
Interesting I am facing the same issue. My yeelight disappeared from Home assistant and only appeared as Homekit Accessories... This concerns the yeelights with v.2.0.6_0051, the ceiling one with 1.5.9_0184 are working well. |
I'm not sure which multicast discovery protocol are you talking about (mdns or ssdp-like), but There has been some changes related to discovery of mdns/upnp devices to make it more straightforward, maybe this is related to that? Ping @zewelor |
@rytilahti mDNS discovery in Yeelight devices is never the official way, in our API spec, only ssdp-like protocol is documented. We will remove mDNS in our further firmware update. For Homekit compatible devices, mDNS is used for Apple's Bonjour protocol and should not be used for Yeelight local discovery either. |
The reason for not using the custom protocol was that there was no proper way to integrate custom discovery protocols to homeassistant (https://github.com/home-assistant/netdisco). As mdns information provided enough information to detect the device and its type, it was used there. For reference, there was discussion about including custom protocols, I'll leave this here just for reference: home-assistant-libs/netdisco#193 However, you should really consider using the SSDP as it was designed to (i.e., using the standard port), this would make integration much easier (where it would be simple matter of adding some metadata: https://developers.home-assistant.io/docs/en/next/creating_integration_manifest.html#ssdp). So just to be clear, was the mDNS advertisements for Now that we have a way to add custom discovery protocols, it could be possible to move away from mDNS to use the custom protocol. As I do not have access to any devices at the moment, I hope someone else will work on that, though. edit: while we have your attention, could you please reconsider extending the API wrt the points 2 & 3 mentioned in https://forum.yeelight.com/t/topic/7075/3 ? |
Thanks for your information. I can confirm mDNS advertisement for _miio._udp will be removed completely in the new firmware. The reason is that our App doesn't use mDNS to discover device anymore and mDNS stack from all chip vendors are not stable and good enough. Regarding extending the API, we will put these items on our to-do list. |
@rytilahti , sorry for what is potentially a stupid question, but is this resolved now? I have a ct2 bulb on 2.0.6_0041 which no longer does mDNS but still responds to SSDP (and is found by python yeelight's |
@mikeage I don't think this is resolved yet. The current yeelight integration should be converted to be a fullblown component with support for discovery, which also requires a modification to the backend library to make targeted discovery possible. The good thing is, with that we can finally have unique ids and make the devices renameable from the UI. |
Thanks. I saw people claiming that 2.0.6_0065 "fixed" whatever problems happened in 2.0.6_0051, but I guess that just means that they were defining explicit IPs, since mDNS based discovery didn't come back. Thanks for the clarification. |
@rytilahti Any news regarding this topic? |
@TheZoker alas no, I have had no time and won't have any in the near future to work on that. Nor have I heard anyone working on converting the platform to a proper integration which is required for that. The backend library supports the discovery, but it will require adaptation to allow unicast discovery (for manually configured ones). |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This is still a legit issue, however, #35448 will pave the path towards a proper discovery support! edit: fixed the link.. |
I have 6 Yeelight both module color 1 and 2 running Home Assistant 0.111.4 both discovery and YAML configuration are not working anymore. |
Here's a silly hack "solution" piggybacking on the homekit announcements: --- /tmp/yeelight.py 2020-06-24 20:51:51.206289000 +0300
+++ lib/python3.8/site-packages/netdisco/discoverables/yeelight.py 2020-06-24 21:09:14.761612000 +0300
@@ -2,7 +2,7 @@
from . import MDNSDiscoverable
from ..const import ATTR_DEVICE_TYPE
-DEVICE_NAME_PREFIX = 'yeelink-light-'
+DEVICE_NAME_PREFIX = 'YeelightColorBulb-'
class Discoverable(MDNSDiscoverable):
@@ -10,15 +10,16 @@
def __init__(self, nd):
"""Initialize the Yeelight discovery."""
- super(Discoverable, self).__init__(nd, '_miio._udp.local.')
+ super(Discoverable, self).__init__(nd, '_hap._tcp.local.')
def info_from_entry(self, entry):
"""Return most important info from mDNS entries."""
info = super().info_from_entry(entry)
- # Example name: yeelink-light-ceiling4_mibt72799069._miio._udp.local.
- info[ATTR_DEVICE_TYPE] = \
- entry.name.replace(DEVICE_NAME_PREFIX, '').split('_', 1)[0]
+ # Example name: YeelightColorBulb-1337._hap._tcp.local.
+ info[ATTR_DEVICE_TYPE] = "color2"
+
+ info["properties"]["mac"] = info["properties"]["id"]
return info
Would be possible to determine the model based on |
+1 Bulb firmware 2.0.6_0065 is not being discovered, neither automatically nor manually through configuration.yaml |
I just got a Yeelight bulb and it was not getting discovered in HomeAssistant. Playing around with ssdp (shameless self plug for https://github.com/MoshiBin/ssdpy) I realized two things:
$ ssdpy-discover -p 1982 wifi_bulb -j | jq
[
{
"cache-control": "max-age=3600",
"date": "",
"ext": "",
"location": "yeelight://X.X.X.X:55443",
"server": "POSIX UPnP/1.0 YGLC/1",
"id": "0x0000000010XXXXXX",
"model": "ceiling1",
"fw_ver": "24",
"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": "on",
"bright": "100",
"color_mode": "2",
"ct": "3500",
"rgb": "0",
"hue": "0",
"sat": "0",
"name": ""
}
] I checked the discovery code (https://github.com/home-assistant/core/blob/dev/homeassistant/components/discovery/__init__.py) but couldn't find a way to replace the port number. |
Home Assistant release with the issue:
0.98.1
Last working Home Assistant release (if known):
unknown
Operating environment (Hass.io/Docker/Windows/etc.):
Docker
Component/platform:
Discovery
Yeelight
Description of problem:
After debugging and talking with the developer of yeelight he informed me that with the latest firmware of the Yeelight Colour there has been no changes to the multicast discovery code.
The issue might have something to do with the Homekit discovery #26129
I tested with a previous firmware of yeelight, before the Homekit update and the bulbs were discovered normally.
In his debug testing he informed me that the packets are the same as before the latest firmware and showed that a third party multicast discovery finds both old and new firmware
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):discovery:
Traceback (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered: