Xiaomi Gateway Integration

Ok. Ill have to try that next. What server are you using for your gateway?

Mainland China

I think that’s the most advisable to get most sensors working.

What sensor do you have: round or square? Which Xiaomi repo and HASS version do you have?

I have the square ones. I grepped the log for the temp sensor and its reporting. Im using the one at the top of the page. What’s the difference between the round and square? Hass 0.48.1

Basically square also reports pressure, is newer and named Aqara (the company producing it).

You also need to make sure you have the latest gateway firmware version installed, otherwise API doesn’t report this sensor properly.

Still then, if you’re not using @Danielhiversen repo, that explains why it doesn’t appear in HASS: @rave repo doesn’t support it.

Either change to @Danielhiversen repo (although I wouldn’t advise it, I tried it already and it didn’t went well) or wait for HASS 0.50 in which this will be included, no need for custom_component anymore.

Awesome. Thanks for the info

1 Like

Would you happen to know the difference between the two different door sensors?

In that specific case, I think that only the shape and the branding (square are Aqara), nothing too different.

Please enable debugging for the xiaomi component and post some MCAST events of your missing sensor.

HA 0.50 will be released this weekend. It will include a official component. To get the same code of Daniel’s repository running you must install the required PyXiaomiGateway manually:

pip install 'https://github.com/Danielhiversen/PyXiaomiGateway/archive/aa9325fe6fdd62a8ef8c9ca1dce31d3292f484bb.zip#PyXiaomiGateway==0.2.0'
1 Like

If we are already using Daniel’s version on 0.49.1 and working…do we still need to install the PyXiaomiGateway? If yes, can we do so now or need to wait for 0.50 then do it?

If it’s working and you are using the latest version of daniels fork HA was able to fetch the dependency automatically.

Im just going to wait for the HA .5. If it still doesn’t work then I’ll do some more digging

Just give it a try. :wink: I will explain every step to enable debugging if needed. What’s the name of the directory where you put the component?

Ok. I’m currently out if town till later today. Ill let you know when I’m back

That was definitely my issue when I upgraded to last commit of @Danielhiversen repo… Understood now!

@nick_12: If you follow the instructions from @syssi, you will not get lost.

Anyone has some links for cheap tracks for xiaomi curtain on aliexpress? Heard i can order some Dooya 85 system instead?

@kos - Thanks so much for the details on utilizing the Xiaomi sensors without the gateway. I’ve been able to follow your guide to manually edit the sqlite database and have the attributes working for the Xiaomi contact sensor. What I haven’t been able to do is get the data displayed in the HA dashboard. Could you share what you had to do to go from getting attributes in the sqlite database updating to getting that data into the HA dashboard? Thanks!

Could someone confirm the different ‘Click_type’ of a xiaomi wall switch?
I can get single and both to work but double, ‘long_click_press’ and ‘long_click_release’ have me stumped.
When I run the example below my code for a single click is triggered before the long click does.

- alias: 'Fletchs Switch - Right Click long'
trigger:
  platform: event
  event_type: click
  event_data:
    entity_id: binary_sensor.wall_switch_right_158d00011c1158
    click_type: long_click_release
action:
  service: light.turn_on
  entity_id: light.fletch_bedside_lamp
  data:
    brightness: 25
    rgb_color: [255, 0, 0]

Have I understood correctly that you are communicating correctly with the sensors without the xiaomi hub?

If so what hardware have you added to your HA for Zigbee?

I think it would be great to be able to use the sensors without any of the restrictions of the gateway :slight_smile:

The wall switch just supports single and both.

cp. Xiaomi - Home Assistant

1 Like