New Xiaomi gateway firmware (xiaomi_aqara component)

Hi
The devices that lists work great, but I have more devices (4 pcs of “square” type buttons) that are paried and working in the android app. They work in automations in the android app (tried ringbell, light control etc), but they just won’t list in HA.

So, I can’t see or use them in HA even though they seem to work well in the app.

Best
/PH

Could you post the content of the printed device label? This behavior for unsupported devices (device doesn’t show up in the device list) is new.

Thanks syssi really. see my log below. i have 2 wireless mini buttons (circular ones).

2018-03-24 12:29:59 DEBUG (SyncWorker_3) [homeassistant.components.xiaomi_aqara] Expecting 1 gateways
2018-03-24 12:29:59 INFO (SyncWorker_3) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 1)
2018-03-24 12:29:59 INFO (SyncWorker_3) [xiaomi_gateway] Xiaomi Gateway 7811dcb8da45 configured at IP 192.168.1.29:9898
2018-03-24 12:29:59 INFO (SyncWorker_3) [xiaomi_gateway] Discovering Xiaomi Devices
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd" : "get_id_list"}'
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': '7811dcb8da45', 'token': '3Fc7LgN1UNTWIzPn', 'data': '["158d0001bf2048","158d0001bd1ab7"]'}
2018-03-24 12:29:59 INFO (SyncWorker_3) [xiaomi_gateway] Found 3 devices
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0001bf2048"}'
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': '7811dcb8da45', 'token': '3Fc7LgN1UNTWIzPn', 'data': '["158d0001bf2048","158d0001bd1ab7"]'}
2018-03-24 12:29:59 ERROR (SyncWorker_3) [xiaomi_gateway] Non matching response. Expecting read_ack, but got get_id_list_ack
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0001bd1ab7"}'
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': '7811dcb8da45', 'token': 'ndFWqPldAuHbwjFm', 'data': '["158d0001bf2048","158d0001bd1ab7"]'}
2018-03-24 12:29:59 ERROR (SyncWorker_3) [xiaomi_gateway] Non matching response. Expecting read_ack, but got get_id_list_ack
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"7811dcb8da45"}'
2018-03-24 12:29:59 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': '7811dcb8da45', 'token': 'ndFWqPldAuHbwjFm', 'data': '["158d0001bf2048","158d0001bd1ab7"]'}
2018-03-24 12:29:59 ERROR (SyncWorker_3) [xiaomi_gateway] Non matching response. Expecting read_ack, but got get_id_list_ack
2018-03-24 12:30:05 INFO (SyncWorker_3) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2018-03-24 12:30:05 INFO (SyncWorker_3) [xiaomi_gateway] Creating Multicast Socket
2018-03-24 12:30:05 DEBUG (SyncWorker_3) [homeassistant.components.xiaomi_aqara] Gateways discovered. Listening for broadcasts
2018-03-24 12:30:56 DEBUG (Thread-3) [xiaomi_gateway] MCAST (heartbeat) << {'cmd': 'heartbeat', 'model': 'switch', 'sid': '158d0001bf2048', 'short_id': 64819, 'data': '{"voltage":3082}'}

i have already bought 4 switch wireless buttons and was planning to buy more xiaomi kit e.g. PIR, Gas and Door sensors but this has put me off. Will be brilliant if it can work. I have only registered two wireless switches in the gateway and they are working fine otherwise but not appearing in Hass as binary sensors. What is strange is that yesterday i did see them being detected as binary sensors and i thought the new update fixed the issue. But i had to switch my sd card (in raspberry pi). and after a fresh hassio install the problem reappeared. in fact, even putting back the old sd card dint help.

i do get heartbeats from these buttons everyonce in a while seeing the log but no corresponding entity ids are available. i have tried everything.

Could you describe/name your network components (switches, accesspoints,…) between Xiaomi Gateway and your Home Assistant instance? Please try to setup a very basic network for testing (xiaomi gateway ↔ accesspoint ↔ hassio). Try to use another accesspoint as the current one.

i have a router from Vodafone. Hassio on Raspberry pi is connected to a repeater in my kitchen and the gateway is connected to a different repeater upstairs. could this complicated setup be the reason?

raspberry pi (Hassio) <–> xiaomi mini repeater <–> Vodafone router <–> xiaomi router (as repeater) 3 <–> xiaomi gateway.

let me try removing the hops

Yes. If there is no repeater between hassio and xiaomi gateway it will went smooth. :stuck_out_tongue:

you were right :slight_smile: connected them (RPI_Hassio and xiaomi gateway) on the main router and though first time it was same but a second reboot fixed it. cant thank you enough. now doing the automation to link stuff with these buttons.

Update: i still sometimes get the same error when Hassio is reastarted but restarting my router (vodafone broadband) and then the rpi (hosting hassio) fixes it.

Hi there!
Starting from yesterday i have a strange problem with my gateway. Every time i try to turn on/off the gateway light or change the color via Home Assistant, the homeassistant service gets killed and it gives me the error "Failed to call service homeasistant/turn_on ". The same thing happens when I try to turn on/off (via HASS) the Xiaomi smart plug attached to the gateway.
The gateway seems to be configured ok, because the xiaomi smart button is working fine with my hass automation and the status/color of the gateway and smart plug is reported correctly.
Here is my config:

logger:
default: warning
logs:
xiaomi_gateway: debug
homeassistant.components.xiaomi_aqara: debug

xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - key: 5q9jn*********

and here is my debug log:

There are no errors in the log when the hass service crashes…
these are the last log lines before crash:

2018-03-27 16:43:27 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=turn_on, domain=homeassistant, service_data=entity_id=light.gateway_light_7811dcb795d8, service_call_id=1978674128-11>
2018-03-27 16:43:27 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=turn_on, domain=light, service_data=entity_id=['light.gateway_light_7811dcb795d8'], service_call_id=1978674128-12>

I also reset the gateway several times with no success…
I noticed that if i start manually the hass app (not as a service) before it crashes it is reporting Illegal instruction.
Do you have any idea what else should i try in order to identify the problem?

[Update] Problem solved after a fresh install of HomeAssistant.

There are hass.io containers for deconz

Hi all,

I don’t know if it is the right place but…do you like default icon for the window/door sensor? It’s just a square!

How can I suggest to change it to a different one (for example mdi: door-open or mdi: door-closed) ?

Will it be default for the door or the window? :wink:

The sensor defaul name is door sensor…so I think the default icon should be a door.

You can change the the sensor type to “door” or “garage door” in customization, and this will change the icon too.

2 Likes

Yes I think this would be the best and the most flexible solution!

was forced to reset the gateway … a pain
now need a new Key , but i keep getting a timeout from the chinese mainland server when i try and confirm the key via the app

anyone else had this problem ?
i had 5 motion sensors , 3 switches and 3 door sensor all working fine,
now i can not get the app to issue a new key !!!

TA
Lee

I do get a key, not working though…
Got error element in data {“error”:“Invalid key”}
11:52 AM components/light/xiaomi_aqara.py (ERROR)

Latest firmware and Hass. Sensors show up, stops updating after one hour. Hass restart works. The gateway light does switch, it does not send any status to Hass.

Hi, everybody. I have a xiaomi gateway (sw 1.4.1_156.0143), I have a token from it (32 characters). How to make it a key (no more than 16 characters) to add to HA.

hi guys,

i’ve managed to create a custom component to add the network radio of the gateway as a media player.
check it out

6 Likes

Itself asked, itself answered. In any version of the MiHome application, the old procedure for activating the wireless connection Protocol and obtaining an access key works.