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

Add support for yeelink.light.lamp10 (YLLD01YL) #78

Open
mrumpf opened this issue Mar 2, 2024 · 7 comments
Open

Add support for yeelink.light.lamp10 (YLLD01YL) #78

mrumpf opened this issue Mar 2, 2024 · 7 comments

Comments

@mrumpf
Copy link
Contributor

mrumpf commented Mar 2, 2024

miiocli device --ip ... --token ....
Model: yeelink.light.lamp10
Hardware version: esp32
Firmware version: 2.0.6_0013

https://de.xiaomiplanet.sk/Yeelight-ylld01yl-Lampenaktion-12/
https://www.amazon.de/Yeelight-Warmwei%C3%9F-Dimmbare-Stehleuchte-Kompatibel/dp/B07YSFTH9G

@helgek
Copy link

helgek commented Mar 2, 2024

There is support already for this lamp. You can also see this thread #72 where I added a photo of how I flashed it.

@mrumpf
Copy link
Contributor Author

mrumpf commented Mar 3, 2024

Thanks for the hint!

However, as I had no sophisticated equipment, I had to improvise ...

I was able to solder 3 wires to the board to some larger pads:

  • RX - green
  • TX - blue
  • GPIO0 - black

And use alligator clips with simple pins to connect GND and 3.3V from my USB to serial adapter to the ESP32.

IMG_5963

So far I was able to read the 4MB original firmware from the lamp. This takes several minutes and you need a steady hand :) When you move the pins even slightly, the transfer of the original firmware will fail.

I'm a little bit hesitant, flashing ESPHome now because I do not see a file that matches the name of the floor lamp in this project.
My floor lamp has this touch panel with 3 functions:

  • ON/OFF Button
  • Slider (Dimmer)
  • Program Change Button (white, colors...)

Where do I find the ESPHome YAML file that supports those features?

@helgek
Copy link

helgek commented Mar 3, 2024

Congrats! :D When you managed the reading part you will certainly manage the writing part as well. Another way you could probably achieve this without soldering and without investing into the PCBite equipment would be to e.g. use the pins you used or to e.g. use acupuncture needles. One could tie some thick foam onto the esp32 chip and push the needles through the foam. The foam would hold them in place. Just another idea that just came to my mind. Nevertheless I'm glad I invested into the PCBite since I've used it to flash six lamps so far. The other lamp's esp32s were more difficult to access, so the PCBite was my rescue.

@mrumpf
Copy link
Contributor Author

mrumpf commented Mar 3, 2024

Related: #61
IMG_5946

IMG_5964

@mrumpf mrumpf changed the title Add support for yeelink.light.lamp10 Add support for yeelink.light.lamp10 (YLLD01YL) Mar 3, 2024
@helgek
Copy link

helgek commented Mar 3, 2024

Ah sorry, I just realized you're not trying to flash a meteorite pendant light but this lamp also identifies as yeelink.light.lamp10. The pendant light doesn't have manual controls on the lamp itself. The bedside lamp has such controls included: https://github.com/syssi/esphome-yeelight-ceiling-light/blob/main/yeelight_light_lamp9.yaml

@mrumpf
Copy link
Contributor Author

mrumpf commented Mar 3, 2024

I also have the bedside lamp, but it identifies as yeelink.light.bslamp2. I already flashed that one with the guide from here:
https://devices.esphome.io/devices/Xiaomi-Mijia-Bedside-Lamp-2
This has the same control panel as the Staria floor lamp yeelink.light.lamp9.

I tried to flash the ESPHome config from the bslamp2 above, but I could not turn on the light. I flashed back the original firmware and the lamp is working again. So at least I know that I can go back to the original firmware if something is not working.

@mrumpf
Copy link
Contributor Author

mrumpf commented Mar 9, 2024

OK, I managed to solder the necessary wires directly to the ESP32 since the reverse engineering is taking much more time than expected. I first flashed the firmware from esphome-xiaomi_bslamp2, but I could not turn on the light. I suspected that the I2C bus was connected to different GPIO pins or that the I2C address of the front panel was different. So I flashed some I2C scanner tool to the ESP32 using the same GPIO pins of the esphome-xiaomi_bslamp2 firmware:

  • GPIO21 SDA
  • GPIO19 SCL

That revealed that there is an I2C device discovered at address 0x50:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Then I modified the example.yaml by overwriting the I2C address of the front-panel from the core.yaml file:

xiaomi_bslamp2:
  front_panel:
    address: 0x50

After flashing it to the ESP32 of the lamp, I received messages from the front-panel like this:

[E][xiaomi_bslamp2:149]: Front panel I2C event error:
[E][xiaomi_bslamp2:150]:   Error: prefix is not 04:04:01:00
[E][xiaomi_bslamp2:151]:   Event: [0a:01:03:00:00:00:02]
[E][xiaomi_bslamp2:152]:   Parsed part: n/a
[E][xiaomi_bslamp2:153]:   Parsed event type: n/a
[W][xiaomi_bslamp2:255]: Skipping unsupported message from front panel

That is a good sign because it means that the I2C address 0x50 is the address of the front-panel. But the events from the front-panel seem to be different and the firmware cannot interpret the content (yet).
Receiving messages with the button press also means that the same GPIO16 is used for the trigger to read data from the front-panel.

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

No branches or pull requests

2 participants