-
-
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
[New Sensor]: yeelight dimmer YLKG07YL / YLKG08YL new model YLYKQ-0004 #999
Comments
First I checked the BLE message with the unknown object. the unknown object is 0x0002, which seems to indicate that "easy pairing" is avaiable. This probably means that you need to connect it to some other device (the light). It is indeed recognized as the YLKG07YL, so it should probably work if you can get the key. The other error seems to be some bluepy error. I'm not sure how to solve that. Perhaps @rexbut can help us out, he came up with this script in the past. |
I also got a YLYKQ-0005 (The wall dimmer) paired to a yeelight. Here's what I got from miiocli:
Tried using: Debug Log:
|
It looks like these new devices use the V5 encryption, so we should be looking for a 16 bytes (32 char) encryption key. |
The dimmers are not supported in Mi home yet. So cloud token extraction and sniffing the Mi home app is out of the equation for now. What's left are web Telink flasher and modded mi app. I got the Telink flasher to connect to the dimmer, but it won't activate, tried it on serval devices. The dimmer does show up and pairs with the modded mi home app, but once I exit the pairing screen, the app shows an error prompt, nothing was logged. Maybe the issue with my device as I only got 1 android device on hand.
|
These bytes are also added by BLE monitor if the device is using the legacy MiBeacon V2/V3 Beacon key (12 bytes key)
This 12 bytes key is a format that was used by Xiaomi in the past for some devices. In the sensor attributes you can check this, if it says "MiBeacon V2/V3 (encrypted), it will use the 12 byte key, if it says MiBeacon V4/V5, it will use the 16 byte key. There is a version flag in the BLE monitor to tell MiHome (and BLE monitor) which version is being used. The YLKG07YL / YLKG08YL use V2/V3, the new models YLYKQ-0004 / -0005 use V4/V5. So, in short, adding these 4 bytes is NOT the way to get/create the 16 bytes key. You might ask the developer of modded mi home app if he can create something similar for the new YLYKQ-0004 / -0005. |
Sorry guys, I gave you some wrong info. It looks like it isn't even encrypted at all. The data from @Blacksli {'rssi': -36, 'mac': '102D416AF060', 'type': 'YLKG07YL/YLKG08YL', 'packet': 44, 'firmware': 'Xiaomi (MiBeacon V3)', 'data': True, 'motion': 1, 'motion timer': 1} But the message from @GhostStone seems to indicate that his dimmer is reporting as MiBeacon V5 encryption.
Now I'm really confused @GhostStone can you make some logs for this device, by enabling the |
Can I somehow collect more debugging information for analysis? |
Yes, you can enable https://custom-components.github.io/ble_monitor/sensor_request If you can send some logs, I can analyze it further, such that at least we understand what kind of encryption it uses. There seems to be a difference between you and @GhostStone |
@Ernst79 I think you're right about it not using encryption. The 7th byte of the service data seems to be the knob position. Incrementing from The Setup:
LOG
|
click
double click
triple click
long hold
rotate right 1 step
rotate right 3 step
rotate left
press and rotate right
press and rotate left
|
The data by @Blacksli is definetely encrypted with a 16 byte MiBeacon V5 encryption key
the data by @GhostStone is also encrypted with a 16 byte MiBeacon V5 encryption key
Only the data which @GhostStone gave at "pairing" isn't encrypted and is strangely enough still in MiBeacon v3 format
giving the following result
So, to conclude: we definitely need a 16 byte encryption key. |
@GhostStone does it work when paired to yeelight light? can you check with miio if key changes when you delete dimmer from light (mi home should have ui for this) and pair again? |
The previous comment that I made was done while the dimmer is paired to the light. The dimmer works as usual, advertises to both HA and the light at the same time.
@rezmus, about the Modded Mi Home dimmer version: |
i saw some app <> cloud logs from new dimmer pair and it looks like app fails to do proper auth. it does not even request virtual ble did from the cloud and does not send ble bind to cloud. which light model you use for the bind and fw version? |
https://home.miot-spec.com/s/yeelink.light.ceiling14 |
I have the same problem. still no solution? |
Same problem here, any possible solution |
No, I'm still waiting for someone who can give me the BLE Advertisements of this device with an encryption key. |
Good morning, I received two YLYKQ-0004 drives because I saw that in the FAQ no comments about it not working they seemed to be supported by BLE Monitor :( I extracted the Mi-beacon key with the miiocli tool (this is the only method that worked) but Home Assitant asks me for a 32 character key while the extracted key is only 24 characters :( And if I enter the key directly in BLE Monitor I get this error
Suddenly, while searching I came across post and I discovered that this product is not supported, Grrrr (it would be wise to indicate it in red in the FAQ). How can I get it to work? Logs :
Thanks |
You will need to find the 32 chatacter long key. Try any of the methods for v4/v5 encryption Keys. If you are alle to find it, post it here and i will try to add the device. |
24 character key is not enough by modifying home assistant requirement? |
I don't understand here : https://github.com/custom-components/ble_monitor/releases/tag/2.1.3 it is indicated to pass in key of 24 characters, but home assistant asks for 32 characters. |
24 character Keys are for MiBeacon V2 and V3. 32 character Keys are for MiBeacon V4 and V5. The old YLKG07YL / YLKG08YL is using MiBeacon V3. The new model YLYKQ-0004 is using V5. So you need a 32 character key. And i need to add this device in BLE monitor, for which I need some BLE data + key first. |
ok, i tested 👍 Method 1:No BindKey on my ceiling lights, the remotes do not appear and yet I have many different ceiling lights and different remotes, they are all up to date) Method 2:Once connected and after clicking (Do Activation), no Mi Bind Key and it disconnects
Method 3 (vevs):I get a 24-character key also even after a total reset of the switch (reset 20s) and a new association, the MAC address changes but the key is still 24 characters. Method 3 (vevs dimmer): After adding, message "unable to complete the action" and the logs are empty Method 4:Too long and complicated for the moment... Are we sure it wouldn't work with a 24 character key by forcing home assistant to accept it? I don't see what I can do now... |
Im afraid that there is nothing more you can do. We need someone who is able to find a method to get the key. Im pretty sure it wont accept the 24 character key, but if you post it here. I can do some checks next week. |
Here are the two keys and the MAC addresses of my two switches.
(After a complete reset of 20s the keys and the MAC address change) Thanks |
@xekil @Ernst79 Same issue here. I was wondering, could it be possible to add the Yeelight dimmer switch to Mijia, and then access it using "Xiaomi Gateway 3" integration in HA? (Given there is a Xiaomi Gateway somewhere, I have the Multimode v2 in my case). |
I dont know, i think the xiaomi gateway integration is accessing the data via the gateway, White ble monitor tries to access the BLE data directie. But we can try to see if we can read your data. If you make a log with BLE data via the report unknowndata fuction of ble monitor and if you send me the encryption jey, i can try it again. |
Yes, the xiaomi gateway integration (https://github.com/AlexxIT/XiaomiGateway3) is accessing the devices through the gateway (acting as a proxy?). I currently don't know how to trigger the pairing between the physical gateway (I have this model: https://fr.aliexpress.com/item/1005004408311471.html?gatewayAdapt=gloMsite2fraPcglo2fra with details here AlexxIT/Blog#1) and the dimmer switch. Didn't have much time to test for the time being. Also, in case I succeed to pair these, I don't know how to get the BLE logs.... Will keep updated If I make progress |
no luck? |
@Ernst79 Hello, do you have any news on this problem? Thanks in advance |
There hasn't been any developments on this for months, it's nearly impossible without using another device like a ceiling lamp to connect with it. Otherwise, directly is impossible and nobody managed to. |
ok, thank you :( |
I have similar experience. I bought yeelight wireless dimmer to control my Zigbee bulb via HA and I don't have any Yeelight lamp to pair 😞 My tries so far:
I think there's no other possibilities to try.
|
wow, great finding. I'll add that as a tip in the FAQ. |
I receive this error, can you help me?
python3 get_beacon_key.py XX:XX:XX:XX:XX:XX 950
Activate pairing on your XX:XX:XX:XX:XX:XX device, then press Enter:
Connection in progress...
Successful connection!
Authentication in progress...
Traceback (most recent call last):
File "/home/pi/get_beacon_key.py", line 159, in <module>
main(sys.argv)
File "/home/pi/get_beacon_key.py", line 155, in main
get_beacon_key(mac, product_id)
File "/home/pi/get_beacon_key.py", line 113, in get_beacon_key
peripheral.writeCharacteristic(HANDLE_AUTH_INIT, MI_KEY1, "true")
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 543,
in writeCharacteristic
return self._getResp('wr')
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 407,
in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 368,
in _waitResp
raise BTLEGattError("Bluetooth command failed", resp)
bluepy.btle.BTLEGattError: Bluetooth command failed (code: 3, error:
Attribute can't be written)
Il giorno lun 22 gen 2024 alle ore 23:37 Blacksli ***@***.***>
ha scritto:
… *Solved it!*
I have had the same problems with two new YLKG07YL devices. The device
type is reported to be 950, the get_beacon_key.py got me a 24 character
beacon key but version byte in the data said version 5. There were eight
hex characters missing.
Brute forcing the missing eight characters on a GPU finally got me the
answer: I had two append eight f characters to the end of the beacon key
to enable the decryption. That worked for both of my devices.
It works! Thank you!
I got the key from the script and added 8 f characters to the end
image.png (view on web)
<https://github.com/custom-components/ble_monitor/assets/74769766/684859f4-271d-4042-b8c5-d72400f0f313>
image.png (view on web)
<https://github.com/custom-components/ble_monitor/assets/74769766/7ed51fc2-4de6-4dba-b0d8-45e07a4cca3c>
—
Reply to this email directly, view it on GitHub
<#999 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEBGHU5K34YSAYHL7AWCJCTYP3S3FAVCNFSM5766CCZKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJQGQ4TKMJXHE2A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
*Ing Gennaro Mellone*
|
@frickeo Great thank you very much, I confirm that it works, I will be able to take my switches out of the cupboard!!!! |
Yes, it seems so. I added the solution in the FAQ, but please let us know if it worked for you. Big thanks for @frickeo for solving this!!! |
Hi, I used the script linked in the FAQ. However, following your instructions I was able to use the version of the script contained in the latest release of the custom component and everything worked. |
Getting this error:
|
The error says it all, install bleak |
Is your Bluetooth adapter enabled on your windows PC? Can it be accessed by python? Hard to say what is wrong. Do you have access to a Linux system? |
@itsmartinho I had same issue on my Mac. Couldn't resolve it, so I've returned the yeelight dimmer. |
@itsmartinho You can try the following simple python script to check the connection:
After starting the script you have to push the little pairing button at the top side of the dimmer, until the the little LED at the bottom starts blinking. Here is the output of the script on my machine (Windows 10 with git bash, Python 3.12.0):
|
@itsmartinho It might be that your dimmer is still paired to some other computer/service/program. Try to disconnect that. If disconnecting is not possible, you may try a hard reset of the dimmer (press the pairing button longer then 20 seconds). But beware, that a hard reset will give you a new mac address. |
How do I get the new address? It still shows the same Bluetooth Address on Home Assistant and I've tried that. @ edit Also, thank you for the help so far! That sounded really harsh/ungrateful but not on purpose lol |
On the top of the dimmer is a small pairing button. You have to press for 3 seconds on it and the LED on the bottom of the front panel begins to blink. Now the dimmer is in pairing mode and the script should give you some data. If you continue to press the small button for another 20 seconds or so, the LED will do a double blink and is then going dark. Now your dimmer device has got another MAC. To get that MAC, I am using the web site https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html in the chrome browser (firefox will not work). Make sure to disconnect. If you got the new MAC, try it out with the script. Please be sure to press down the small button again until the small LED blinks if running anyone of both scripts. |
Also, screenshot of the error I'm getting on the terminal by using: I don't know how to use the script you gave me, can you please elaborate if isn't asking for too much? |
That is not the script. You have to save and execute the raw file and not its presentation in the browser. |
Hello everyone, I post here because lot of people having trouble with their YLKG07YL dimmer, and I was like you, been nuts to have beacon_key or adding it in home assistant... take me hours of digging to fix it ! Here what i've test, done, and check : First of all, recover the MAC adresse of the device with phone app for me "A4:C1:38:35:4F:62" Be carefull, pressing the pariring button during 20s will change this MAC address After that use the method 5 from Passive BLE integration FAQ : 5. get_beacon_key python script In my case :
Be sure to use a relevant linux, bluetooth and python configuration If you can't connect to your device or if it's say "Disconnected!", try this before launching the script :
After that you will have something like this : notifyData: 'ce6b3f6f42adc97421cf015f' Now you have you beacon_key, you can configure the BLE device to HASS on But cherry on the cake you have to add eight
Hope it will help ! Thanks to [frickeo] |
Sensor Description
yeelight dimmer YLKG07YL / YLKG08YL model YLYKQ-0004
Additional information
I ordered a yeelight dimmer on aliexpress on batteries YLKG07YL / YLKG08YL
The seller sent some new version
On the body of the inscription YLYKQ-0004
I don't have a yeelight lamp, I just needed a dimmer.
When paired with BLE Monitor, it is defined as YLKG07YL / YLKG08YL but there is no data:
Method for obtaining a key by a script:
Method for obtaining a key through a modified mihome (dimmer):
The device finds, loads the plugin, but then an error will appear.
There is nothing in the log folder.
Windows 10 sees the device as: yeelink.remote.seesaw
Is there any way to search for a key without a lamp and add support?
I will collect any information / dumps
dump.txt
BLE advertisements
No response
The text was updated successfully, but these errors were encountered: