I donât get it work and I tried in so many ways⌠I have homekit supported gateway and I want to get xiaomi temperature sensor data available to home assistant. Now I get it only available to mi home app and homekit, but not home assistant.
This is what I tried to do.
Removed all entries mi home app
Removed all entries apple home app
Reseted gateway pressing 10 second --> yellow light started to blink.
After this I tried to set up this in so many ways and here is few examples:
4 a. Home assistant got new notifications and there is homekit setup code. That code can be used in apple home app and then I get home bridge to home app (i get all home assistant data to apple home app, but I dont get xiaomi temperature sensor data to home assistant).
4 b. I set up xiaomi me home app again (added gateway there and added temperature sensor).
Then open home assistant and go to confituration --> Integrations --> press + (set up a new integration) --> selected homekit accessory --> selected device list âhome assistant bridge._hap._tcp.local.â --> try to add pairing code format xxx-xx-xxx and added there my own code what I found on my xiaomi gateway sticker --> and I get error âincorrect homekit codeâ
Then I tried to add that code what appears on home assistant notifications âhomekit setupâ secreen and then i get error âAn unhandled error occured while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently.â And after that I lost notification where that code was and also if i try to add that homekit accessory integration again I get error âNo unpaired devices cloud be foundâ. And after that I donât see anymore homekit bridge on apple home app.
2019-07-27 19:17:41 ERROR (SyncWorker_9) [homeassistant.components.xiaomi_aqara] No gateway discovered
2019-07-27 19:17:41 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Integration failed to initialize.
2019-07-27 19:30:23 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.pyâ, line 259, in async_step_pair
pairing)
File â/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.pyâ, line 336, in _entry_from_accessory
pairing.list_accessories_and_characteristics
File â/usr/local/lib/python3.7/concurrent/futures/thread.pyâ, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File â/usr/local/lib/python3.7/site-packages/homekit/controller/ip_implementation.pyâ, line 73, in list_accessories_and_characteristics
self.session = IpSession(self.pairing_data)
File â/usr/local/lib/python3.7/site-packages/homekit/controller/ip_implementation.pyâ, line 416, in init
c2a_key, a2c_key = get_session_keys(conn, pairing_data, write_fun)
File â/usr/local/lib/python3.7/site-packages/homekit/protocol/init.pyâ, line 392, in get_session_keys
response_tlv = write_fun(request_tlv, step3_expectations)
File â/usr/local/lib/python3.7/site-packages/homekit/protocol/init.pyâ, line 80, in write_http
resp = connection.getresponse()
File â/usr/local/lib/python3.7/http/client.pyâ, line 1336, in getresponse
response.begin()
File â/usr/local/lib/python3.7/http/client.pyâ, line 306, in begin
version, status, reason = self._read_status()
File â/usr/local/lib/python3.7/http/client.pyâ, line 275, in _read_status
raise RemoteDisconnected(âRemote end closed connection withoutâ
http.client.RemoteDisconnected: Remote end closed connection without response
2019-07-27 19:30:23 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.pyâ, line 288, in async_step_pair
start_pairing, self.hkid, self.hkid
File â/usr/local/lib/python3.7/concurrent/futures/thread.pyâ, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File â/usr/local/lib/python3.7/site-packages/homekit/controller/controller.pyâ, line 370, in start_pairing
raise AlreadyPairedError(âAlias â{a}â is already paired.â.format(a=alias))
homekit.exceptions.AlreadyPairedError: Alias âXX:XX:XX:XX:XX:â is already paired.
Added the hub today, all sensors including doors, temp & humidity as well as vibration are working fine.
I also mapped them back to the apple homekit. Be sure to allocate the correct device_class to each sensor before doing this, otherwise everything will turn up in homekit as an occupancy sensor
Itâs also a good idea to create a friendly name that notes the room itâs in, helps for an easier setup.
With me the door sensors are very slow⌠Use them for automations to turn on lights as an example, and it takes about 30-40 sec before HA gets the new status and trigger the automation
The alarm status is similar, HA will get the new state after 30+ seconds.
I never managed to get it connected to EU server (tried Germany) in the Mi Home app, I guess the route to China takes 30-60 secs at the minimum.
Thinking I should ditch the Aqara hub and get the Xiaomi/Mijia Hub as it appears it works (almost) flawlessly.
@Olivier974
Hello,
I have Aqara Hub set up directly in the home app now, it occasionally disconnect to wifi, so Iâm considering connect it to HA first then connect it to homekit via HA, since Iâll have to re-config every automation and setting after this, I have a few questions before I commit.
I have two Xiaomi wireless switch currently connected to Aqara Hub, will they work with newest HA version?
Same as above, I have an Xiaomi temperature and humidity sensor and human sensors connected to Aqara Hub, will them work?
1-i dont think soâŚpersonnaly i have bought a V2 and later a V3 version (not Aqara Hub but called Mi Hub now) and it works with V2 and V3, not V1 (Aqara Hub).
I actually have 2 Aqara Hub and 2 Mi Hub (V2 and V3), total 4 gatewaysâŚ1Aqara+Mi Hub on the first floor and same on the 2nd oneâŚlolâŚit works like a charm.
2-Yes it will work for theses sensors
The best way is actually to install a Zigbee gateway (26⏠for a cc2530 and texas Instrument flasher) and you can manage thousand of Zigbee sensors brand, not only Xiaomi ones âŚ
I have a Zigbee gateway and all the sensors yu describe above, and it works perfect!
and i have about 30 sensors on the 4 gateway, it works but slower than the Zigbee gateway (cloud in china lol) and when the server are down or have to be maintainâŚit bugs a lotâŚ
Wow, I didnât know there is a thing like cc2530 that let you pair any Zigbee device, this is super cool, but Iâm not sure I have enough knowledge to make it workâŚ
Maybe Iâll stay with Aqara Hub for now, it still occasionally disconnect to wifi, but itâs easy enough for me.
There is new Aqara Hub M2 just out a few months ago, Iâm hoping someday it can be bought out of China then I can buy one, and hope it can be more stable than the old Aqara Hub.
Thanks for the information.
There is already the european version for the Aqara Hub and the Mio Gateway but if you buy the european version, you cant use your sensors anymore because the sensor are chinese versionâŚ
So if you wana buy this european version, you will have to buy all the sensors again
That why the Zigbee coordinator is great, it doesnt care about the version of sensor are made for, just the Zigbee protocol
Hi @Olivier974! Itâs great news to know I can connect the Aquara gateway to HA using the HomeKit workaround. Could you please help me solve a couple of questions so that I can decide whether to go down the Z2Mq path?:
Can I control the Xiaomi/Aqara devices connected to the Aquara gateway from HA? Can I configure new logics directly in HA?
Does the HomeKit app in the iPad/iPhone need to be running and reachable by the Aquara gateway for the latter to be active in HA?
Iâm using a second WiFi router for the Aqara gateway, the iPad/iPhone, and the Raspberry. What happens if I disconnect the router from the Internet? Would the gateway still talk to HA in the Raspberry? When I set the gateway using only the Xiaomi app, the gateway stops working when I unplug the router from the Internet. I would prefer my home data to stay homeâŚ
1-Yes / Yes
2-I dont use Ipad/Iphone, i a m running the app on Android, but the app dont need to be reachable for the latter to be active in HA.
3-Yes no problem if you dont use internet service for HA like duckdns.org
I managed to connect to HA via homelink integration. Aqara Hub works instantly (turning light on and off and changing colour). I didnât find the option to play sounds in HA. Door sensors work but with 30-40 sec delay⌠Is there any workaround?
EDIT:
Is it possible to use sensors via zigbee2mqtt and keep Aqara to play sounds and as alarm via homekit integration? I use it as doorbell at the moment and it works quite good. The problem is lack of custom sounds.
I personally ditched the Aqara Hub and got the Xiaomi Gateway instead. It works much better with HA and the Aquara sensors are fully compatible. No delays, all working instantly. This is very important to me as I use the motion sensors to turn on/off the lights. 30+ sec delay is not acceptable.
Downside is that HA do not detect it as alarm natively and have to use custom component to manage the alarm bit of the gateway.
For custom sound paly, I use the google home mini instead. Itâs much louder, can play custom sounds and even TTSâŚ
Sure I can⌠HA will detect it as a media player via auto discovery. Next you can use the media_player.volume_set, tts.google_translate_say and media_player.play_media services to set the volume, have to say any text you want or play custom sound via mp3. I have mostly done this via scripts that are executed via automations. I can share some of them if you need more details⌠Cheers