-
-
Notifications
You must be signed in to change notification settings - Fork 247
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 Bluetooth Rotary Dimmer Switch YLKG07YL/YLKG08YL #289
Comments
@latel I checked the link you gave, and I noticed that they say the device isn't able to connect to MiHome, but it connects to a ceiling light directly, so it's not possible to get the encryption key easily. Can you confirm these findings?
The problem is that the messages are encrypted. I copied one of the messages from the link you gave, added the first part myself (before 95 FE) to get (almost) the full message. The dimmer switch is the last line in the table. It seems to be missing the MAC TAG, as you can see.
Could you do a check by collecting some messages with The encryption key can normally be found with method 1, 3 and 4 from our FAQ. In case it can't connect to MiHome, you will probably have to use method 4 and sniff the encryption key while connecting it to the ceiling light. |
I have this switch too and I'm also monitoring that issue for a long time and seems it's not easy to step forward...
The way how we can pair it with the ceiling light, is just to press a button on the top of it for 3 seconds, and MiHome is no needed at all during the process, so I guess we won't be able to get it's encryption key with any method of the FAQ? For now the only way I know so far about how to "see" this switch is to open the MiHome APP, open the light combined with this switch, click the three dot, click |
You might be able to use a sniffer to catch the encryption key. When you press the reset button, it will probably exchange a new key in a bluetooth message that is send from the switch to the ceiling light. But this is quite complicated (at least for me), as you have to figure out which message contains the key and how to extract it from the message. I know @Magalex2x14 has done something like this to catch the key from a message between a sensor and MiHome. I assume it works the same way for the key exchange between the switch and light. But it will only be send once (when pressing the reset button). some sniffing tools are given in the faq, method 4 example of using a sniffing tool: Unfortunately, I can't help you with this, I don't have this switch/light.
That is the next problem to solve, but that seems to be easier to solve, e.g. with dummy devices. But it might not send anything, if not coupled to a ceiling light. |
afaik they use some proprietary yeelight encryption protocol, not mible. it can only be reversed from yeelight firmware. |
I've got contact with ceo of yeelight, he told me ths device use mi ble encryption protocol |
you can get encryption key for yeelight bt devices (remote/dimmer) paired with ceiling light by sending miio cmd to device.
pid 339 is yeelink.bleremote.v1 (remote), pid 950 is dimmer. mible decryption should work after. |
If someone can send a log with the option report_unknown: "xiaomi" and the encryption key, i will have a look |
there are also remotes for bhf/fan light. virtual remote via miio cmd.
|
if you only have remote, but no ceiling, you can pair it with mijia app and check if ble adv can be decrypted. |
@Ernst79 i tested yeelight remote with mgl03 hub and looks like payload is decrypted without issues. you should be able to use it with ble_monitor even without ceiling. dimmer might be more tricky without ceiling, but should be also doable. i don't have any, can't test. from what i know it also sends 4097 (0x1001) events probably with dimmer possition. this is list of all events yeelight remote sends for keys in order on, off, sun, +, m, - and 2nd pass with long press.
|
Thanks for the info. I need a full ble message to fully understand the format. Could you make a hcidump for me with the key (and mac)? Will make it much easier for me |
sorry, i don't have any bt dongle. it should be the same as yeelink.remote.remote switch which also sends 4097 events. |
Ok. I dont have the device myself, but could you give us the miio command we have to use? I've never used miio, but i assume it's this repo. But what command do you use to get the key? Is it as simple as:
|
you can use this npm miio, python-miio, php-miio, etc. send this cmd
your dimmer/remote must be paired with ceiling light. if you don't have ceiling light like me you can pair remote (maybe also dimmer) with special version of mijia app and get key same way you get it for other mijia ble devices. |
Thanks, but its still a bit unclear how to send that command (sorry). I dont have the ceiling Light, nor the remote. Im only the developer of ble_monitor, so I need some user to provide me with the data and key @latel or @keniji can one of you try to get the encryption key with the method of @rezmus ? Please post it together with some logs generated with |
I have the ceiling light, the dimmer and the remote control, but how do I send the command? Can you send the command? |
you need IP/TOKEN of your ceiling light. you can get it with token extractor (check ble monitor faqs for details). install python-miio and send
or php-miio and send
|
Remote: F8:24:41:E9:50:74
Dimmer: F8:24:41:C5:98:8B
|
Thanks. Ill look into it the coming days. |
@rexbut The messages you posted are not encrypted, and do not contain much useful data. Both the dimmer (1st line) and the remote (2nd line) have the same data. The third line is for comparison, a regular LYWSDCGQ sensor
The dimmer and remote have two messages in one advertisement, a NAME and a PAYLOAD (besides MAC and RSSI). NAME PAYLOAD I'm not sure what the "easy pairing" parameter exactly means, probably that it is connected to a light or an app. Other useful info I think we need other messages, @rexbut can you make another log, and try to press the remote / dimmer during that time. Post all messages you get, I will try to filter it. |
yeah device sends also some adv with edata 2, you need to push buttons to get 4097. it's possible that adv won't be encrypted at all due to short beacon key (such devices in mijia are usually plain).
|
there are a few yeelight remotes. in their plugins they have support for remote/dimmer and 2 remotes designed for bhf light and fan light, but i saw some more. for example remote from this light may also talk mible. https://mi-home.pl/akcesoria/akcesoria-komputerowe/mi-computer-monitor-light-bar
pid 2038 is yeelink.light.nl1 - Mi Motion-Activated Night Light 2. from your parser 0x07F6 = 2038.
|
Ah, sorry, you're right. It was looking at the wrong line in the table. |
Remote: F8:24:41:E9:50:74
Dimmer: F8:24:41:C5:98:8B
|
it looks like remote payload is plain
and dimmer is encrypted. |
I've released 2.0.0-beta with initial support for the remote control (YLYK01YL). Dimmer will follow later. The button being pressed is presented in the state of the remote sensor, the type of press ( Please let me know if the sensors are working and are what you need. Some questions to thing about.
|
Instructions have been added to the FAQ, including a request for people who have instructions to get the key directly. @rezmus Just a silly question, you say that you can pair the remote/dimmer to MiHome Mod and then get the key with Xiaomi cloud token extractor. Why isn't it possible to pair it to the normal MiHome app and get the key with Xiaomi cloud token extractor? |
remote/dimmer does not exist in stock app. |
And it does exist in the Mod? OK, good to know. thanks |
it was added to this single specific version of mod for the purpose of getting keys. |
from faq: 'pid': 950 corresponds to the remote, 'pid': 339 corresponds to the dimmer. it's opposite ;) you should link to apk i mentioned, not mod site. this single version can be used to pair remote/dimmer. dimmer won't be in regular mod version because it can't be used in mijia. remote can with some conditions (plain payload, mgl03 hub + patched silabs binary). btw: some yeelink bhf lights comes with same remote like for ceiling/fan (6 buttons, chinese labels), but some use this one. |
I changed the links just a minute ago to the specific version, I already understood 😄 . |
I'll make the final release tonight. I think you guys have tested enough. |
it's not really paired. remote does not have knowledge if was removed from the lamp or not. it always adv clicks (plain or legacy encrypted with constant key per device) to everyone who can hear/decrypt them. |
2.1.3. has been released!. I've opened a new issue for the other remotes #352 from @bluefoxlee |
Thx, I will fix it right away. Edit, fixed |
wow, didn't notice this thread, thanks for everyone's efforts indeed 💯 |
This url is invalid. Can you share another download link. thx! |
The entire site is down. I don’t have another link unfortunately. Maybe someone else? |
|
You will need an encryption key to make it work. It uses the old encryption format, check the faq hoe to get the encryption key and add it to the device configuration. https://custom-components.github.io/ble_monitor/faq#how-to-get-the-mibeacon-v2v3-encryption-key |
Hi the new link for the Mi Home App is : |
Hey @Ernst79 :-) I went for something exactly like that in my automations:
Thank you very much:-) |
Hi, I installed the app and added the dimmer, but at the end of the process I get an error saying try again later and the pairing.txt file is not generated. |
same problem :( |
Hi, you can't pair it completly in the app. |
hello, thank you, that's what I just did but it's not better :( he can't find the switches... My Switch is New Model (YLYKQ-0004) #999 |
how did you do it? I get just the rSSI even with the encryption token |
Request from @latel for support for Yeelight Bluetooth Rotary Dimmer Switch (model YLKG08L)
https://www.aliexpress.com/item/32973439343.html?spm=2114.search0104.3.17.6edd4cb7NgQMcK&ws_ab_test=searchweb0_0,searchweb201602_2_10065_10068_319_10059_10884_317_10887_10696_321_322_453_10084_454_10083_10103_10618_10307_10820_10301_10821_10303_537_536_10902,searchweb201603_51,ppcSwitch_0&algo_expid=18475432-ec47-461e-b642-4cf806469bf6-5&algo_pvid=18475432-ec47-461e-b642-4cf806469bf6&transAbTest=ae803_5
I think what we need is here [nccchirag/yeelight-ble-rotary-dimmer#1]{nccchirag/yeelight-ble-rotary-dimmer#1)
The text was updated successfully, but these errors were encountered: