Xiaomi Gateway Integration

Oh, I still have a bunch of automations (e.g. air purifier, sensors, flora sensor, Xiaoyi camera) not yet ported to HA. And the gateway itself still can’t be added to other servers besides China yet, right?

I got my gateway v2 yesterday and got my 3 motion sensors working within minutes in HA. The only thing that doesn’t work is the binary_sensor.wall_switch. I thought it had single, double and long clicks. But even in the Mi Home is says “single click”. So an automation works fine in Mi, single click light on gateway turns on.

In HA is shows up as binary_sensor.wall_switch_158d0001830ce8 when I click, nothing happens is HA, no status change, nothing. Am I doing something wrong please? This was the main reason I wanted Xiaomi :slight_smile:

It is a Aqara Wireless Switch

Cheers
Mark

Correct. Just use china for the initial setup and block the internet connection afterwards. I think you can add new devices by pressing the button of the gateway three times + the pairing button of the new device. Pairing should succeed without internet access of the gateway I think.

1 Like

Please write your first automation. The state change is as fast as hell. You cannot observe it in the UI. :wink:

1 Like

Mmhh sorry I didn’t get it.

There is the gateway app (mihome) on mainland China
There is the Yeelight app that is on China

I thought I need to set Singapore on the Yeelight app, in order to have Yeelight on the Google Home, but losing the lights on the Mihome app.
Hence after putting Yeelight app on Singapore it could stay like that

Is it so?

TIL about pressing the buttons 3 times!

thank you… is all I can say to you :slight_smile:

Yup.

To clarify, the server setting in both the Yeelight app and Mi Home app do the same thing. You can set them both to Singapore if you’d like even, it only matters which server you register the Yeelight device to. If you do not have any other Xiaomi ecosystem devices that aren’t supported outside of China, you can keep the server as Singapore.

ok so single click works perfectly to turn on a light, I wanted either a double or long press to turn it off… nothing happens. I thought these were more than just single click devices?

alias: livingroom lights off
trigger:
  - platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.wall_switch_158d0001830ce8
      click_type: long_click_press

action:
  - service: light.turn_off
    entity_id: light.living_room_white

Your mentioned device (wall_switch_158d0001830ce8) doesn’t support double and long press events.

cp. Xiaomi - Home Assistant

You could use “light.toggle” to toggle the state.

ahhhh bugger, so none of the wall switches support that???. The double would work, with “both” to turn off… thanks.

and light_toggle, I had no idea about that, thanks again… I think my most used word on here is “thanks” :slight_smile:

But I remember we had to put China in the gateway to have it worked in HASS.
did this change?

This is what I’m talking about:

alias: Toggle the livingroom lights
trigger:
  - platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.wall_switch_158d0001830ce8
      click_type: single

action:
  - service: light.toggle
    entity_id: light.living_room_white

If you press the button the first time the light turns on. If you press the button later again it will turn off. This is what “toggle the state” means.

and this works PERFECTLY. I have ordered 1 with a double as a test and a smart button switch. I love HA and the community. Cheers!

No.
China for mi home zigbee gateway
Singapore for yeelight

Yes, direct communication sort of works. I am having issues with the temp sensor leaving the zigbee network after under an hour or so. I can get data extracted from other devices, I just can’t get them into HA. I’m just using the Linear HUSBZB-1.

What you see is all I’ve done. I believe their is a mismatch in clusterID/profileIDs that prevents the other attributes from showing up. shrug

I’ve given up on trying to get the devices to work, and stay connected (they leave the network after under an hour or so.) I broke down and bought the gateway. :confused:

ringtone not working. any help?
sensor.illumination not accurate too.

Please post your automation. What did you try in detail?