Xiaomi Gateway Integration

How do you do that? Parental controls on the router? Firewall? What ports do you kill?

Thanks

1 Like

I have a device called a fingbox that can do this, but there a lots of ways to do - such as you mentioned

I have duplicated zigbee component detected, they switch randomly over time.
Is that a way, I can clean it up?

I.e.:
switch.plug_158d000156faa
switch.plug_158d000156fbaa_2

Hi there my gateway light stop turning on with home assistant in last version of firmare 1.41_150…043 and last version of HA 0.54.0 all the other things are working good

After upgrade to 0.54, I am seeing very inconsistent results with my switches, gateway and cube - sometime actions work - sometimes not (mostly not) - here’s what I am seeing in the log:

2017-09-24 21:16:07 ERROR (Thread-3) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:11 ERROR (Thread-2) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:53 ERROR (Thread-12) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:54 ERROR (Thread-5) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:55 ERROR (Thread-3) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:55 ERROR (Thread-4) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:55 ERROR (Thread-6) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:56 ERROR (Thread-2) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:56 ERROR (Thread-9) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:56 ERROR (Thread-7) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:56 ERROR (Thread-11) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:57 ERROR (Thread-5) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:57 ERROR (Thread-3) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:16:57 ERROR (Thread-4) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:23:59 ERROR (Thread-11) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:25:05 ERROR (Thread-4) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:25:08 ERROR (Thread-5) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:25:11 ERROR (Thread-7) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:27:40 ERROR (Thread-8) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:27:49 ERROR (Thread-4) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:27:51 ERROR (Thread-2) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:27:59 ERROR (Thread-7) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:28:01 ERROR (Thread-6) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:28:02 ERROR (Thread-11) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:28:03 ERROR (Thread-9) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
2017-09-24 21:29:30 ERROR (Thread-3) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}

The key I have configured is valid and has not changed. As mentioned above, it must be valid because sometimes my automations do trigger.

Here’s my config:

xiaomi_aqara:
# xiaomi:
 gateways:
   - mac: 286c0xxxxxd8
     key: 63B2DF8xxxxx40C9
   - mac: 34cxxxxx5720
     key: 6E98BxxxxxB94F18

Any ideas?

Hi @zajnic

I have reported this here and got some explanation.

https://community.home-assistant.io/t/xiaomi-gateway-switch-plug--random-rename/

unfortuantely I have been busy lately and did not get around to open an issue.
Hopefully I can do it today. Sorry

Did you update your configuration from “xiaomi:” to “xiaomi_aqara:”?

For some reason I can never get the aqara double switch to actually work with the both press, in the mi home app it registers I press both at the same time, and in the HA interface I see a device for both being pressed at the same time.

Wall Switch (Both)_XXXXXXXX
yet when I use it in automations it never triggers?

- id: 'XXXXXXXXXXX'
  alias: XX
  trigger:
  - event_data:
      click_type: single
      entity_id: binary_sensor.wall_switch_both_XXXXXXXX
    event_type: click
    platform: event

This is very strange. I will setup a second gateway and try to reproduce the issue. Could you disable one of your gateways (by configuration) temporary? Does it “fix” the issue?

Hi,

same issue here:

2017-09-25 09:25:09 ERROR (Thread-3) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
2017-09-25 09:29:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.motion_sensor_158XXXXXXXXX is taking over 10 seconds
2017-09-25 09:29:47 ERROR (Thread-2) [PyXiaomiGateway] Cannot connect to Gateway
2017-09-25 09:29:47 ERROR (Thread-2) [PyXiaomiGateway] No data in response from hub None
2017-09-25 09:31:00 ERROR (Thread-8) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
2017-09-25 09:31:03 ERROR (Thread-4) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
2017-09-25 09:31:06 ERROR (Thread-8) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}

there is some inconsistance as a minute after and before triggering a xiaomi switch with the xiaomi button worked well. Here is my configuration for the xiaomi on configuration.yaml:

# Xiaomi Mi Home Gateway
xiaomi_aqara:
 gateways:
   - mac: XXXXXXXXXXX6
     key: xxxxxxxxxxxxxxw
   - mac: XXXXXXXXXXXE
     key: xxxxxxxxxxxxxx8

Thanks! Will follow on your thread.
I’ve enabled the debug but can’t find anything related to the duplicated component.

no is supposed to change that?

Please study the release notes before upgrading. There was a breaking change. The component is called “xiaomi_aqara” now.

Oh sorry I didn´t read before the update :frowning: my bad. But i do the change and still not working the gateway light the other things are working good.

trigger:
  - platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.wall_switch_both_158d0001xxxxxx
      click_type: both

That works for me.

1 Like

Thanks I’ve been wondering why my automations were not working.

It looks like the motion detector should support light level, but I don’t see that mentioned in this thread. I poked around the home-assistant source and didn’t see it there either.

Is that simply still to be discovered?

The illumination sensor of the new motion sensor is supported. It should be registered as an additional sensor:

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/sensor/xiaomi_aqara.py#L28-L30

Another thing you could test: With 0.54 a auto-discovery (netdisco) of the gateway via mDNS was introduced. This mechanism is able to load the xiaomi_aqara component without any line of configuration. However the component won’t be able to control devices because the key is missing. Could you disable “discovery:” or blacklist the xiaomi_aqara component for testing?

I have same issue of eBoon and discovery disabled in configuration.yaml:

# Discover some devices automatically
#discovery: