Zry.IO

Back

Hardware

To disassemble the lamp, simply remove the three screws hidden underneath the rubber pads on the bottom panel, then follow the Tasmota documentation [Archive] to solder the necessary wires to the ESP module:

pinout

Source: https://github.com/gsimon75/Tasmota_MiDeskLamp_Notes

  1. Black: GND, to any of PIN3, 5, 6, 7, 15, 16, 19 or 20
  2. White: Vcc (+3.3 V), to PIN8
  3. Gray: UART RxD, to PIN17
  4. Purple: UART TxD, to PIN18

wiring

Also short PIN4 (GPIO0) and PIN3 (GND), then short PIN9 (RST) and PIN7 (GND) with tweezers and release, to reset the ESP module and enter flashing mode.

Software

ESPHome configuration example:

Source: https://github.com/syssi/esphome-mi-desk-lamp

After resetting the ESP module, wait a minute for Home Assistant to automatically discover the new ESPHome device, then simply select to adopt it. After that, you can add a native light card with brightness and color temperature control to Lovelace.

lovelace-card

About Extra Features

Previously, according to the last section [Archive] in the Tasmota documentation,

As the lamp has external power supply, and the LEDs are in the upper part of the lamp, the temperature of the base is the same as of the ambient, and by its nature the lamp is situated on your desk, so it’s a perfect place for temp+humidity measurements.

So I connected a DHT22 temperature and humidity sensor to GPIO0. However, after some time I found it’s not working well, the temperature reading would rise by about 5 ℃ as soon as the lamp was turned on.

MJTD01YL Xiaomi Mijia Desk Lamp
https://zry.io/smart-home/mjtd01yl-xiaomi-mijia-desk-lamp
Author zry98
Published at January 28, 2022
Copyright CC BY-NC-SA 4.0