Does someone no if it’s possible to integrate the Eve Aqua into Home Assistant?
I already paired it to Apple Home and it works, but it would be much better if I could control it with HA.
I read this:
But looks like valves are not supported yet. It also says that devices have to be unpaired from Apple Home to pair them with HA. This makes sense but I’m asking my self how it connects to HA.
Does HA use a Bluetooth connection for this? I’m a little concerned about the range.
For anyone finding this thread, head over here to track progress on support of Bluetooth based HomeKit accessories.
TL;DR - homekit_controller doesn’t support BLE accessories as of December 16th 2019. It is planned, but the blocking bluetooth client doesn’t integrate well with home assistant. So the current priority is switching the IP client to asyncio then building an asyncio bluetooth client. But this is a long term effort. In the meantime, an Eve Extend bridge can allow home assistant to see Eve bluetooth accessories via WiFi.
This only helps for the device types listed in the docs, so at the moment Eve Aqua connected to Eve Extend would probably be detected but e.g. might only report on its battery status. It might be easy to add support the Eve Aqua properly via this method, but I can’t offer any solid promises. It looks like on Home Assistant’s side we would just model the Tap as a kind of switch.
Hey there - just wanted to confirm that the Eve Aqua does report battery life when connected via the Eve Extend, but doesn’t have the ability to control the valve. I’d be happy to try and look at this and help if you point me in the right direction?
Unfortunately not. I added valve support for an unrelated WiFi device, it’s just a bonus that it probably now works with Eve Extend too.
It does mean that when the BLE transport exists it will work as well, but such a transport is a significant amount of work.
I helped to write the BLE support in the blocking homekit client we used to use and had a working prototype for Eve Energy in Home Assistant, but as i’ve said before there were some severe limitations because of the interactions between asynchronous code running in HA, asynchronous code running in the Linux bluetooth stack and then trying to put a synchronous blocking code path in the middle of that with threads. With the HA homekit_controller code as it was when I started contributing it took 2 threads to get this working, per entity. I know there are users with 40+ homekit entities. Not only wasn’t it reliable, it wouldn’t have scaled.
Now we use a different homekit client that is entirely async. Unfortunately it’s IP only at the moment. That code landed in 0.107.0 and i’m spending this cycle mostly on support. But the hope is that now this foundational piece in place we can use aioble and avoid the threading layer that was causing problems. But this is a massive piece of work so is still a good long while away.
@billclerico obviously you’ll be the first Eve Aqua user to try it so please do take it for a spin before the release if you can - then if anything crops up there is still time for me to fix it in the beta.
I will try and give this a shot but can’t make any promises at this point! I’ve never run the dev install of HA so I could be opening up a can of worms. Will let you know if I’m successful.
I’m also interested in using the eve aqua in home assistant. Can you tell me if it works for you? 0.108 is out, so no need to test it in dev anymore. I haven’t bought the eve yet, hoping you can confirm if it works.
@Jc2k Quick update - the Eve Aqua valve is detected, but so far I have not been able to get the switch to work. I can confirm that I can control the device from HomeKit, but HomeAssistant isn’t able to. Other HomeKit devices (Rachio) are working OK from HomeAssistant.
Logger: homeassistant.core
Source: components/homekit_controller/connection.py:342
First occurred: 9:48:43 AM (2 occurrences)
Last logged: 9:51:03 AM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohomekit/controller/ip/pairing.py", line 90, in _ensure_connected
await asyncio.wait_for(self.connection.ensure_connection(), 10)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1255, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 412, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 443, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/switch.py", line 66, in async_turn_on
await self.async_put_characteristics({CharacteristicsTypes.ACTIVE: True})
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/__init__.py", line 98, in async_put_characteristics
return await self._accessory.put_characteristics(payload)
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 342, in put_characteristics
results = await self.pairing.put_characteristics(characteristics)
File "/usr/local/lib/python3.7/site-packages/aiohomekit/controller/ip/pairing.py", line 246, in put_characteristics
await self._ensure_connected()
File "/usr/local/lib/python3.7/site-packages/aiohomekit/controller/ip/pairing.py", line 93, in _ensure_connected
"Timeout while waiting for connection to device"
aiohomekit.exceptions.AccessoryDisconnectedError: Timeout while waiting for connection to device
So to be clear, you paired your Eve Aqua to the Eve Extend, then unpaired Eve Extend from iOS and paired it with HA. This worked enough for pairing to complete and a valve to show up in your HA environment.
And the pairing itself worked - because it’s only able to know to create a Valve entity if its retrieved the entity map over a secure paired connection.
All of that is very positivie in its own right.
But after that point nothing works?
It did for me - for months. I’ve had a lot of pain with my Eve Extend lately, and i’ve not had time to investigate why. It seemed to start intermittently refusing to join the wifi, or at least not be visible in Bonjour after starting up.
And all connections to it (even with e.g. curl) fail. It’s like its crashed.
The only issue I see is that you won’t be able to track the state of the Eve Aqua in Home Assistant if you turn it on/off manually or with HomeKit.
Do you have an idea how to track the state in HA?
One idea could be to add more automations in HomeKit to turn on/off the input boolean if the Eve Aqua turns on/off.
Example:
automation: if switch eve-ha turns on call scene sc-eve-on
automation: if switch eve aqua turns on switch eve-ha
However I don’t think this will work, because both automations would probably end up triggering themselves in a loop.