Can't pair more than one xiaomi light to HA

Hey there! after some struggling i’ve now home assistant working on my house :slight_smile:started to pair devices, philips hue without problems, but when it comes to pair xiaomi zhirui downlight it’s a little tricky.

I’ve got the token, and the correct config to pair a downlight, here’s the config:

#Xiaomi Downlight MID
light:

  • platform: xiaomi_miio
    name: Xiaomi Pasillo MID
    host: 192.168.1.165
    token: !!!secrettoken!!!
    model: philips.light.downlight

ok, light appears in lovelace as it:

but if i add a second or third downlight, it only appears the last one:

#Xiaomi Downlight IN:
light:

  • platform: xiaomi_miio
    name: Xiaomi Pasillo IN
    host: 192.168.1.164
    token: !!!secrettoken!!!
    model: philips.light.downlight

#Xiaomi Downlight OUT
light:

  • platform: xiaomi_miio
    name: Xiaomi Pasillo OUT
    host: 192.168.1.167
    token: !!!secrettoken!!!
    model: philips.light.downlight

#Xiaomi Downlight MID
light:

  • platform: xiaomi_miio
    name: Xiaomi Pasillo MID
    host: 192.168.1.165
    token: !!!secrettoken!!!
    model: philips.light.downlight

how should i do to make all lights visible on home assistant? plus, i’ve more to add later, so the problem is going to get bigger.

Thank you in advice!

Remove the 2 last light:

So you have :

light:
  - platform: xiaomi_miio
    ...

  - platform: xiaomi_miio
    ...

  - platform: xiaomi_miio
    ...

i did it and now only appears the first one of the 3 lights, what am i missing? :frowning:

Ok, I’m not familiar with the xiaomi_miio platform, but I just checked my light.yaml, it might be :

light:
  - platform: xiaomi_miio
    - name: Xiaomi Pasillo IN
      xxx
   
    - name : ...


why do you say “light.yaml”? i’ve got it all this in “config/configuration.yaml” should i create a separate file to be adding new lights?

Yes / no.

Defining your lights in configuration.yaml is ok. However, my configuration.yaml became quite large, so I used this :

ok i understand this is something i’ll do, but not now, basically because it’s not going to solve my problem, i will keep looking for more info about xiaomi_miio platform, my solution it’s probably there.

any one can help?

i already uninstalled philips gateway, it’s working perfect with rpi now… i’m one step away of gettin rid of the xiaomi gateway too, only need to know how to add 2 or more devices, so i can pair the rest of devices in my house.

Did you try this :

light:
  - platform: xiaomi_miio
    - name: Xiaomi Pasillo IN
      xxx
   
    - name : ...


yes, it doesn’t work either. will try again anyway because i don’t remember witch was the problem with that config.

i think i have the solution, will try with config and update after.

by the way, i don’t want to see this in overview, how i delete this??

ok forget the last message, i’ve got it already. In overview > configure UI > create new view with elements i want > delete old view > done :slight_smile:

about the topic issue with xiaomi, it’s solved too, a user (thank you @elnaor) answered me in another thread, and this is the correct form for adding xiaomi lights, and all will be visible in “entities” section, so you can add it to lovelace and control them.

" - platform: xiaomi_miio
name: livingroom_tv_light1
host: 192.168.129.171
token: !secret philips_down1
model: philips.light.downlight

  • platform: xiaomi_miio
    name: livingroom_tv_light2
    host: 192.168.129.172
    token: !secret philips_down2
    model: philips.light.downlight
  • platform: xiaomi_miio
    name: livingroom_tv_light3
    host: 192.168.129.173
    token: !secret philips_down3
    model: philips.light.downlight
  • platform: group
    name: livingroom_mood_wall
    entities:
    • light.livingroom_tv_light1
    • light.livingroom_tv_light2
    • light.livingroom_tv_light3"
1 Like

I posted that 3 days ago. You said only the first light showed up :slight_smile: Happy you got it working.

1 Like

yes but theres one diference, the space after 3 dots, like i’ve got it nos there’s no space. It was close, thank you too for your help.

Now i’m having an issue with WXKG02LM, i’ve got 3 of them. Turn z2m join true and try to pair, but nothing happens, changed battery but still nothing in z2m log. What’s going on?

pair method:

If problem pairing with zigbee2mqtt : disconnect your CC253x a moment from power and try again.

i’ve tried this right now, eaven changed USB, but no luck, still can’t pair double switches, the strange thing is that single key switch paired in a second and i’ve got It working ok with automations.

ok now the switches doesn’t pair with xiaomi gateway/mihome app, so… i don’t know, 3 switches broken? imposible, something is happening here. :frowning:

Your not the only one

1 Like

i’ve got it!! i’ve got the 3 switches paired. Remove the battery, like 15 minutes (probably it work with 2 o 3 minutes but i did it that way). After that, install battery and reset device, paired at first attempt, the other 2 swtiches paired at first attempt too.

So finally, i’ve got rid of both gateways, xiaomi and philips hue, and could bring to life an osram plug that i had without his gateway.

I’m extremely proud of this: :slight_smile: :slight_smile:

TO DO:

  1. make home assistant usable when i’m not at home (now works only on wifi).

  2. make the corridor motion sensor won’t last 2 minuts on, just want like 10 seconds.

  3. move all installation to docker (now i’ve seen this working, want to move from rpi3b+ to rpi4 and use it as home assistant + kodi/plex player.

2 Likes