Xiaomi Gateway Integration

I will add support for the new door window sensor tonight.

Does anyone know for sure what do these volume settings actually control:

I’d like to have the possibility of having ringtones played from HASS, but make sure the chinese lady would be quiet…

Has anyone tried it before, before I try to do it myself?

The new gateway firmware reports always a pressure of 0. If the gateway reports other values some day the sensor will show the measurement.

Can somebody post the events of a new motion sensor? Thanks! :slight_smile:

Wow!!! You guys are fast. I was only away for few hours and so many things have happened. I will post the events from the new motion sensor once I am able to update the firmware. Currently seems stuck as I think having some China routing issue.

Yes…I read somewhere it is supposed to have 1-click, 2-clicks, 3-clicks & 4-clicks. Unfortunately, when I added it to MiHome app, I could see that it only supports 1-click and 2-clicks. Which I did call out earlier seems like a downgrade :disappointed:

Does anyone knows how to get the gateway out of the blinking yellow light? I was updating the firmware but the firmware download is always 0% and then says failed. But it did not get out of the blinking yellow light. :rage:

[Update] Ok…just off and then on it back do the trick.

So should the status of the switch change from on to off when a click/double_click is issued?
Or I need to do that myself?

It will not change. Based on the old switch…only when you long hold it will show as on. But the new switch does not have long hold.

1 Like

Thanks, @skull29. So this switch really looks to be a downgrade? Of course, maybe an upgrade to the gateway firmware will change/fix it but for now, it’s that it looks.

That’s a bit of a shame.
I hoped it would do 1 click, 2 click, hold, and hold release events like the old switch.
and also 3,4 click
Right now with current f/w the new switch is less capable :frowning: Although looks a bit nicer imo.
I use hold for automation to dim light.

I was hoping to write an automation that would execute different functions depending on how long you held the button. Preferably announcing the current state over a media_player.

FYI. Motion sensors that are still packaged in box have been stuck on since the last upgrade with Square switch support…

They have not been deployed yet. These are the original motion sensors.

Hi syssi, here you go:

2017-07-17 23:25:17 DEBUG (Thread-19) [custom_components.xiaomi] MCAST (report) << {'cmd': 'report', 'model': 'sensor_motion.aq2', 'short_id': 51745, 'sid': '158d00016c4b60', 'data': '{"lux":"2"}'}
2017-07-17 23:25:17 DEBUG (Thread-19) [custom_components.xiaomi] MCAST (report) << {'cmd': 'report', 'model': 'sensor_motion.aq2', 'short_id': 51745, 'sid': '158d00016c4b60', 'data': '{"status":"motion"}'}
1 Like

I have added the device support of the new motion sensors:

https://github.com/Danielhiversen/homeassistant/commit/940cd2a5c9c3af793bc9a50a6be61f4667aed27a

Feedback would be nice. I don’t own the device.

Same applies for me. I’m not at home and all sensors are showing motion. I think it’s the well known “false report on power failure of the gateway”. Real motion will fix the symptom hopefully.

I have updated to the latest master version but I can only see motion sensor and no light sensor. I have checked the logs and saw that there’s a different data:

2017-07-18 00:27:02 DEBUG (Thread-1) [custom_components.xiaomi] >> b'{ "cmd":"read","sid":"158d00016c4b60"}'
2017-07-18 00:27:02 DEBUG (Thread-1) [custom_components.xiaomi] << {'sid': '158d00016c4b60', 'data': '{"voltage":3055,"status":"motion","lux":"2"}', 'model': 'sensor_motion.aq2', 'cmd': 'read_ack', 'short_id': 51745}
2017-07-18 00:27:02 DEBUG (Thread-1) [custom_components.xiaomi] PUSH >> <Entity Motion Sensor_158d00016c4b60: on>: {'lux': '2', 'voltage': 3055, 'status': 'motion'}
2017-07-18 00:27:27 DEBUG (Thread-15) [custom_components.xiaomi] MCAST (report) << {'sid': '158d00016c4b60', 'data': '{"lux":"2"}', 'model': 'sensor_motion.aq2', 'cmd': 'report', 'short_id': 51745}
2017-07-18 00:27:27 DEBUG (Thread-4) [custom_components.xiaomi] PUSH >> <Entity Motion Sensor_158d00016c4b60: on>: {'lux': '2'}

Same here, this didn’t happen before this gateway firmware update. Damn…

edit: clicking on local area network communication protocol gives me a message : current device does not support this feature. Does that mean im having v1 w/o radio?

Hi, I’m having same error here, were you able to get the password from the gateway?
Nvm, I got it

Are the new Square Temp/Humidity/Air Pressure Sensors already supported?

I get still 2 unknown devices, would be awesome to have them integrated, as they are soooooo tiny!