Cant setup Xiaomi Mijia Smart LED Desk Lamp

Hi all. I’m no longer able to conect the lamp. Through the yeeelink integration, via IP I have a ‘Failed to connect’ error.
Anyone can help me?

1 Like

Same problem here with the integration of MJTD01YL, tried via yaml and yeelight integration without success.

This is the error i get:

Logger: homeassistant.components.yeelight.config_flow
Source: components/yeelight/config_flow.py:152
Integration: Yeelight (documentation, issues)
First occurred: 12:44:16 PM (1 occurrences)
Last logged: 12:44:16 PM

Failed to get properties from 192.168.1.220: A socket error occurred when sending the command.

Found my problem after some googling: Yeelight Bedside Lamp 2 - LAN Control issue after update fw to 2.0.6_0041 - #300 由 Pabert - YEELIGHT Bedside Lamp - Yeelight Forum

It looks with new yeelight app updates they disabled LAN control inside app, i had to install and old yeelight app, (Yeelight 3.2.00 version) and then enable LAN control, after that integration works perfectly fine again.

1 Like

Hi, can you please tell me how to install the 3.2.00 version?
Thankyou

On an android device you can install the app via an APK like: https://www.apkmirror.com/apk/yeelink/yeelight/yeelight-3-2-34-release/yeelight-3-2-34-android-apk-download/

iOS… Apple doesn’t allow to choose what version to download

Next rainy day I think I am going to open it up => next project

Bad News… the switch is disabled. May be the lamp firmware was updated too?qb qa

they disable lan mode in all xiaomi/mi branded yeelight products. xiaomi decision due to security policy.

confirmed. cannot activate lan control for desk lamp 1S latest firmware

If anybody is facing this problem: you should enable LAN control in the Yeelight app before adding your lamp to Home Assistant. If you don’t have that switch in the app, try installing an older version of the app. I was able to do it in yeelight v 3.2.14 with my MJTD01YL desk lamp

it is not necessary to have lan control enabled to control the lamp. It is possible to pair it through the home assistant homekit controller, everything works without problems.
If the lamp is not present in the list of homekit additions, it probably thinks it is already paired; in this case it is necessary to carry out a reset with the button under the base and re-insert the lamp in the yeelight application. The pairing code is present in a sticker under the base of the lamp (it is important to enter it in the format requested by the home assistant, with the numbers separated by “-”)
mi_desk_lamp_homekit

Hi there, I bought a Xiaomi Mi Desk Lamp 1s and I’m facing some issues while trying to pair it using Home Assistant installed on my Raspberry Pi 4 4GB.

More specifically, I tried adding a Homekit Controller integration but it keeps telling me that no device is present, so I can’t proceed pairing the lamp.

Do I have to follow some special steps? I tried resetting the lamp, as well as adding it onto Yeelight and them add the Homekit integration but nothing, it still complains about no device found.

I’m running on firmware version 2.1.7_0016 in case you need it

Please note that the code of the lamp is in the format XXXXYYYY. Should I add a dash after the first 4 numbers?

Many thanks

I am also using version 2.1.7_0016, after the lamp reset and the pairing with the Yeelight app, appeared among the discovered devices. Attention, the integration to use is not “HomeKit”, but “HomeKit Controller”. The code format to use is 123-45-678.

Yeah. I finally managed to get it working. Basically I had to change the network from “bridge” to “host” in my docker installation and everything started working again

Back on mi desk lamp issue… I tried this but I get…

Pair with a device via HomeKit Accessory Protocol

HomeKit Controller communicates with MiDeskLamp1S-BB1D over the local area network using a secure encrypted connection without a separate HomeKit controller or iCloud. Enter your HomeKit pairing code (in the format XXX-XX-XXX) to use this accessory. This code is usually found on the device itself or in the packaging.

An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently.

Homekit integration has some wrong colors when setting them through google home. Daylight for example is greenish and dim as the lamp doesn’t switch to “Temperature mode” which it should.

Here the same. Next step… in the bin.

The following way worked for me:

  1. Via Yeelight app on my [Android] phone, I added the lamp. [probably, you can skip this step and connect your lamp directly in the Mi Home app, but this didn’t work for me. And I have no clue why]
  2. The lamp has appeared in the Mi Home app.
  3. In the settings of the app (three dots on the upper-right corner) → Additional settings → Network info, I found the IP (I knew it) and token (that is what I was looking for).
  4. In the HA app → Settings → Devices & Services → Add integration → Miio for Yeelink → Enter a lamp IP and Token.
  5. Profit.

All in all, all this fun with Xiaomi-ish stuff, slowly but surely, is redirecting me towards more expensive but predictable smart home systems…

1 Like

The following worked for me (slight variation of previous post):

  1. Link lamp with Xiaomi Home app
  2. Get token + IP address via GitHub - PiotrMachowski/Xiaomi-cloud-tokens-extractor: This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices.
  3. Install yeelink custom component (e.g. via HACS) GitHub - al-one/hass-miio-yeelink: Xiaomi Miio Yeelink/Yeelight devices for Home Assistant
  4. Settings > Integrations > Add Yeelink
8 Likes

Thx for your comment. Worked as expected! :slight_smile:

1 Like

This integration yeelink custom component (e.g. via HACS) GitHub - al-one/hass-miio-yeelink: Xiaomi Miio Yeelink/Yeelight devices for Home Assistant is archived and no longer supported.

I changed the fan part in init.py starting line 29

from homeassistant.components.fan import (
FanEntity,
FanEntityFeature,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
)

and the self._supported_features in the class BathHeaterEntity
around line 590

self._supported_features = (
        FanEntityFeature.SET_SPEED |
        FanEntityFeature.DIRECTION |
        FanEntityFeature.OSCILLATE
    )

to get the integration loading