Xiaomi Gateway Integration

I have a Single Switch and it works like a charm

In the plugin I just dont get what decoupled mode is?

It says this is working

Aqara Wireless Switch (Double)

and this isnt

Decoupled mode of the Aqara Wall Switche (Single & Double)

Just wait a bit. A measurement will be shown after some time.

It’s supported and called “Aqara Wireless Switch”: https://github.com/danielhiversen/homeassistant

The device can report three events: click (left), click (right), click (both).

This is the Aqara Wall Switch: http://www.gearbest.com/access-control/pp_626699.html

There are two relays inside. If you push a button the relay is triggered and the new state is reported as event. At the Mi Home app you can enable a mode called “decoupled mode”. You can decouple the button from the relay. Unfortunately in decoupled mode the button doesn’t report any informationen anymore. A button click event would be nice. That’s why the decoupled mode is not supported. At the mi home app both devices (button & switch) can be used independently in decoupled mode.

Your screenshots does not show any Wi-Fi connection, right? May be you should try again to “confirm” if you are connected to the same wireless network like your gateway. It’s just a try.

Yes! You can find a list of supported devices here: https://github.com/danielhiversen/homeassistant

If you have paired (button of the gateway pressed 3 times → pairing button of the devices pressed once) the wireless buttons with your gateway they will show up at home assistant on next restart.

1 Like

Only Version 2 gateway will work.

You can still use it with MiHome app but if you plan on using it with HA then you definitely need the right gateway as it is communicating through the gateway with HA.

How is the new motion sensor doing, is the light sensor working well?

Hi,

I’ve been having some random issues with my motion sensors, everything is working fine for months apart from the motion sensors that from time to time all of them just detect movement at the same time and stay like that until someone gets in front of them and they go back to normal.
I’ve created an automation that when it detects that all of them are on it notifies me, but there’s no specific logic of why it happens, sometimes it’s once per week, others every 2/3 days, random.
Anyone have the same issue?

Thanks

What is the distance between the sensor and the gateway, also how many devices do you have?

28 devices connected as per gateway, 6 of them are motion sensors.
I think the maximum distance is around 7 meters if that much.

Check in the Mi Home app is it experiencing the same issue of them all reporting motion at the same time? It doesnt sound right at all, is there more wifi interference from other devices (phones, tablets etc) perhaps when it happens?

Does anyone use the Aqara wireless single switch( model WXKG03LM)? I’m on the latest firmware released yesterday. It’s showing up in home assistant but doesn’t register any clicks. How would I go about fixing / debugging it.?

Thanks in advance

Wayne

No, you always need the gateway, sensors communicate with the gateway and the gateway communicates with Home Assistant via network.

Please enable debugging output in your configuration.yaml and post the lines of your home-assistant.log which appears if you press the button.

logger:
  default: warn
  logs:
    custom_components.xiaomi: debug
    custom_components.sensor.xiaomi: debug
    custom_components.binary_sensor.xiaomi: debug
    custom_components.light.xiaomi: debug
    custom_components.switch.xiaomi: debug

Anyone have any issues seeing their gateway in home assistant after firmware update? Mine was working fine, did the firmware update and now home assistant doesn’t find it on discovery?
Working fine in the Mi App
This is in logs:

2017-07-18 12:07:01 INFO (Thread-10) [custom_components.xiaomi] Expecting 1 gateways
2017-07-18 12:07:01 INFO (Thread-10) [custom_components.xiaomi] Discovering Xiaomi Gateways (Try 1)
2017-07-18 12:07:06 INFO (Thread-10) [custom_components.xiaomi] Gateway finding finished in 5 seconds
2017-07-18 12:07:06 INFO (Thread-10) [custom_components.xiaomi] Discovering Xiaomi Gateways (Try 2)
2017-07-18 12:07:11 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi is taking over 10 seconds.
2017-07-18 12:07:11 INFO (Thread-10) [custom_components.xiaomi] Gateway finding finished in 5 seconds
2017-07-18 12:07:11 INFO (Thread-10) [custom_components.xiaomi] Discovering Xiaomi Gateways (Try 3)
2017-07-18 12:07:16 INFO (Thread-10) [custom_components.xiaomi] Gateway finding finished in 5 seconds
2017-07-18 12:07:16 ERROR (Thread-10) [custom_components.xiaomi] No gateway discovered
2017-07-18 12:07:16 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize.

Thanks for the reply. Here is what I am getting. Showing as a click but nothing showing in Home Assistant. Any ideas?

2017-07-18 11:16:36 DEBUG (Thread-21) [custom_components.xiaomi] MCAST (report) << {‘cmd’: ‘report’, ‘sid’: ‘158d00015ef35c’, ‘data’: ‘{“channel_0”:“click”}’, ‘short_id’: 52408, ‘model’: ‘86sw1’}

2017-07-18 11:16:36 DEBUG (Thread-10) [custom_components.xiaomi] PUSH >> : {‘channel_0’: ‘click’}

Please open home assistant and go to the Developer Tools → State. If you can find a binary_sensor with the suffix 158d00015ef35c everything is fine. Just use the binary_sensor in your automations.