HELP! Can't get yeelight nor xiaomi miio to work

Newbie here!

So far HA seems super powerful, despite the yamls weird notation and behaviour.
Got Xiaomi-agara, Orvibo plugs, Philips Zigbees, and others to work super fine.

But Yeelight doesn’t work, I have this on configuration.yaml

yeelight:
  devices:
    192.168.1.159:
    name: Office Ceiling

but it doesn’t appear on devices (isn’t it where it should show up?) nor entities.
The logs doesn’t show any info on yeelight discovery, service, or whatsoever that could give me a clue.
The device is working via the Yeelight App.

Same thing for Xiaomi miio (wifi, do not confuse with the gateway, that’s working fine)

switch:
  - platform: xiaomi_miio
    token: xxxxxxxxxxx
    host: 192.168.1.109
    name: Plug Office

In this one, the logs shows the a delay on service start, but aparently it comes up as it doesn’t keeps compaining.
The token is correct, from the about on app.
The devices are configured and working via Xiaomi app.

The configuration is valid, restarts and all.

How can one debug this? Can somebody help please,
Vitor

Have you activated LAN Control?

How can one debug this?

you could try setting up the logger e.g.

logger:
  default: warn
  logs:
    homeassistant.components.switch.xiaomi_miio: debug
    miio: debug

No!!
Thanks and thanks.
It worked!

Got it, when setting up the lamp on the Yeelight app, they don’t provide control by default (on the lamp itself via settings). The old problem of setting up devices from multiple manufacturers, we always need a bucket of apps on our phones to set up the devices.

I wonder if anybody is working on that area, some implementation do discover and setup devices? If so which brand?

Hi Komadori,

after setting the logger, got these messages:


Platform xiaomi_miio not ready yet. Retrying in 60 seconds.
2:40 AM helpers/entity_platform.py (WARNING) - message first occurred at 2:40 AM and shows up 3 times

Platform xiaomi_miio not ready yet. Retrying in 30 seconds.
2:40 AM helpers/entity_platform.py (WARNING) - message first occurred at 2:39 AM and shows up 4 times

Got error when receiving: timed out
2:40 AM /usr/local/lib/python3.7/site-packages/miio/device.py (ERROR)

Setup of switch platform xiaomi_miio is taking over 10 seconds.
2:40 AM __main__.py (WARNING)
Wanted UPnP/IGD device with UDN "uuid:3de14062-1e00-481d-aaad-6f5f0b7cb708" not found, aborting
2:40 AM components/upnp/__init__.py (WARNING)

Unsupported device found! Please create an issue at https://github.com/rytilahti/python-miio/issues and provide the following data: lumi.gateway.v3
2:39 AM components/xiaomi_miio/switch.py (ERROR)

Already reported the last one as requested.
Maybe the platform wont start with this exception.

Thanks again for your help.

I’m really confused here as I do not use the xiaomi switch, but:

  • you said the switch is wifi connected
  • you said the gateway is working fine
  • yet the gateway and the switch should be independent from each other?
  • why does the error log tell you to provide the gateway information?

I am just guessing here, but is this maybe a zigbee switch that you are trying to configure, and this is why you get the error related with the gateway?

Can you recheck if the IP address is the one of the switch and not of the gateway by accident? Also same for the token?

Yeap, I confirm, Wifi connected, Ip correct, I have IP addresses and MACs mapped with a IP Scanner, and the plug works via the app and shows the ip.

Gateway is independent from the device in a way, its a bit obscure the relationship between the gateway and the Wifi control by other means then Xiami app, in my mind, the only thing that will be needed is any kind of token that xiaomi app programmed in the device.

The token I am using is the one for the gateway, I couldn’t find any for the device.

Xiaomi mi, has two different implementations, one is ZigBee (xiaomi-agara) working smooth, the other is wifi (xiami-miio), which we have to use to setup the device. That rules out any confusion with ZigBee devices, I would say.

…error log request the gw info, probably because of the version, maybe different setipas and protocols, dunno…

At the end of the day, the service seems not to be starting, probably because not being able to speak with the switch (reporting component), but this switch is a Wifi Basic, the root of this implementation.

The token I am using is the one for the gateway, I couldn’t find any for the device.

It pretty much says to use the token from the switch in the configuration, why would you need the gateway token if they are unrelated? I guess this might also be why you get the gateway error.

I’d try googling around on how to get the token from the plug, I assume it is quite similar to how you get it for the gateway

It pretty much says to use the token from the switch in the configuration, why would you need the gateway token if they are unrelated? I guess this might also be why you get the gateway error.

Dunno… Maybe when setting up the device - via app-gateway - they use the token as a means to lock the device under their control and close it for others (?!)

I couldn’t find any way to get a token for the device.

If you can find something, super !

When you enter the switch in the app, can you see the 3 dots and the “about” category?

It’s all in the docs

When you enter the switch in the app, can you see the 3 dots and the “about” category?

Yap, and this is all the screens pertinent,
No “token” mention.
The only thing that may play some role here is this “password”, seems a 4 digit pin (?!?!) but it is assumedly off.

Token is not the same as a password. Just follow the instructions from the docs… or not and keep wondering why it doesn’t work :roll_eyes:

When you enter the switch in the app, can you see the 3 dots and the “about” category?

Yap

Can you send a screenshot from the about tab? There should be a version number at the bottom. Keep hitting it a few times (like on android phones) to get a new tab. This is where you find the token - same way you did it for the gateway

This is that about tab… after the 3dots

I tried to do the trick of the several clicks all around, nothing come up.

I don’t believe there is a device token, only gateway.
This is derived form my experience, but the config of hassio suggests the opposite.

Do you have any info on one side or the other?..

but on the top it says settings? when I click on about it says about on top too… since I don’t have the plug I can’t check myself…

All I can say is to try this “hacked” russian mii home app and see if there is any difference - or maybe someone with the plug reads the topic and knows how to get the token

Hi @sjee

what is currently on the docs you mention do not work. I have the same scenario as @vmarques and it does not work.
Even trying to follow what’s mentioned on https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token as alternative methods or methods for Android not rooted, when installing v5.4.49 the app is unable to detect the mi smart plug.
I only manage to detect the smart plug when using the latest Mi Home app version :frowning:

1 Like

Same issues here with the Xiaomi Universal Remote (chuangmi.remote.v2). I have added the IP & token (retrieved with a token extractor) to the configuration.yaml but keep getting:

Logger: homeassistant.components.remote
Source: helpers/entity_platform.py:215 ...
Platform xiaomi_miio not ready yet. Retrying in 60 seconds.

The infos on the https://www.home-assistant.io/integrations/xiaomi_miio/ are either outdated or missing something.
I’m using HA 2020.12.1 / Home Assistant OS 5.9 / Python Version 3.8.6 on Raspberry Pi