Xiaomi Gateway Integration

Definitely worth waiting, but I’ve recently heard from Gearbest that for instance for the new Xiaomi Aqara temperature/humidity/air pressure sensor, they are struggling to get supply from the manufacturer, which is big enough to cover customer demand and also lower the prices…

yup, I got 4 of them around the house, they work perfectly!

1 Like

Today I wanted to test something but so far I can’t make it work

I have a few Aqara Wall Switch working perfectly. I few days ago I noticed you can change individual buttons into wireless ones, see image below:

I wanted to use the right switch to turn on and off my z-wave light. On HA my switch entity is

switch.wall_switch_right_XXX

Thing is that when the right switch is on wireless mode the entity on HA doesn’t change to on/off as it should when I physically press it on the wall, so I have no way to bind that event with an automation and effectively turn on my z-wave light

Is this a bug? am I doing it wrong? maybe is not supported @Danielhiversen?. I also checked if when turning the right switch to wireless I was getting a new binary_sensor as I do with the Wireless Switch button (rounded one by Xiaomi)

Thanks for any info!

Can you enable the “logger:” of HA and post the messages of the device if you push the button? The lines should start with MCAST and PUSH.

2017-06-15 09:21:10 DEBUG (Thread-7) [custom_components.xiaomi] PUSH >> <Entity Plug_158d00012a9aa5: off>: {'inuse': '0', 'voltage': 3600, 'power_consumed': '63', 'status': 'off', 'load_power': '0'}
2017-06-15 09:28:05 DEBUG (Thread-13) [custom_components.xiaomi] MCAST (heartbeat) << {'short_id': 25311, 'model': 'plug', 'cmd': 'heartbeat', 'sid': '158d00012a9aa5', 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"63","load_power":"0"}'}
2017-06-15 09:28:05 DEBUG (Thread-3) [custom_components.xiaomi] PUSH >> <Entity Plug_158d00012a9aa5: off>: {'inuse': '0', 'voltage': 3600, 'power_consumed': '63', 'status': 'off', 'load_power': '0'}
2017-06-15 09:35:33 DEBUG (Thread-13) [custom_components.xiaomi] MCAST (heartbeat) << {'short_id': 25311, 'model': 'plug', 'cmd': 'heartbeat', 'sid': '158d00012a9aa5', 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"63","load_power":"0"}'}
2017-06-15 09:35:33 DEBUG (Thread-10) [custom_components.xiaomi] PUSH >> <Entity Plug_158d00012a9aa5: off>: {'inuse': '0', 'voltage': 3600, 'power_consumed': '63', 'status': 'off', 'load_power': '0'}
2017-06-15 09:41:32 DEBUG (Thread-13) [custom_components.xiaomi] MCAST (heartbeat) << {'short_id': 25311, 'model': 'plug', 'cmd': 'heartbeat', 'sid': '158d00012a9aa5', 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"63","load_power":"0"}'}
2017-06-15 09:41:32 DEBUG (Thread-5) [custom_components.xiaomi] PUSH >> <Entity Plug_158d00012a9aa5: off>: {'inuse': '0', 'voltage': 3600, 'power_consumed': '63', 'status': 'off', 'load_power': '0'}

Love the xiaomi line, is the least expensive and the one with less problems of all the pack

Thanks for your reply!

I just did and the right one is not sending anything :confused:

For some reason the gateway light is not appearing as one of my entities. All the devices I’ve paired so far have appeared (with the exception of the Aqera switch which works in the app but does not appear in HASS). i.e. door/window sensor working… wireless switch working… motion sensor working… No gateway light.

Try with this repo it’s more up to date https://github.com/Danielhiversen/homeassistant. I have Aqara wall switches and they show up in HASS!

What a pity. I received a wall switch a few days ago. I will give it a try, too.

thanks man! It’s weird that the wireless mode doesn’t work as supposedly the Aqara Wall Switch wireless is supported as well!

I could imagine the android app is the time ahead and the gateway firmware needs to be released/updated first.

Do you have the Aqara switch built in? Are you located in Europe? Any pics?

Yep! I have the Wall Switch and yes I’m in Spain! I don’t have pics myself but is this one http://www.gearbest.com/alarm-systems/pp_610096.html

Wireless switch mode is not supported yet even in @Danielhiversen’s branch.

I’ve investigated it a little and have some code that seems to work… at least it doesn’t screw up any of my current set up and does generate a click. Will send a pull request to @Danielhiversen when I’ve done a bit more testing.

Regards,
Tommy

P.S. You don’t get an additional binary_sensor because the switch does identify itself to the HA as a button, it identifies itself as a switch always. So in my test implementation, you get a weird switch that change state and generate clicks.

the Aqara Wall Switch wireless identify itself as “button” and the Aqara Wall Switch identifies as a “switch” to HA, totally different class of device to HA.

Oh nice, can’t wait to try it!

It is working for me … but could you help me how to switch to Daniel fork?
Do I delete what I cloned and clone Daniel fork or do I use different git command to pull this fork ?

Easiest way, just clone Daniel’s fork

Thanks,
I did that but in effect lost all window/door sensors and Gas … and maybe some more
I am back on lazcad

Is anyone else seeing these errors?

2017-06-24 17:54:20 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'last_updated'
2017-06-24 17:55:07 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.motion_sensor_158d00013fb2d7 is taking over 10 seconds
2017-06-24 17:55:07 ERROR (Thread-5) [homeassistant.components.xiaomi] Cannot connect to Gateway
2017-06-24 17:55:07 ERROR (Thread-5) [homeassistant.components.xiaomi] No data in response from hub None
2017-06-24 17:57:42 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.motion_sensor_158d00014dc10f is taking over 10 seconds
2017-06-24 17:57:42 ERROR (Thread-5) [homeassistant.components.xiaomi] Cannot connect to Gateway
2017-06-24 17:57:42 ERROR (Thread-5) [homeassistant.components.xiaomi] No data in response from hub None
2017-06-24 18:04:25 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.motion_sensor_158d00014dc10f is taking over 10 seconds
2017-06-24 18:04:25 ERROR (Thread-4) [homeassistant.components.xiaomi] Cannot connect to Gateway
2017-06-24 18:04:25 ERROR (Thread-4) [homeassistant.components.xiaomi] No data in response from hub None
2017-06-24 18:30:55 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'last_updated'

I am using @Danielhiversen fork