tomasmcguinness / homeassistant-mixergy

Add support for Mixergy's smart water tank into Home Assistant
MIT License
38 stars 8 forks source link

Error while setting up mixergy platform for sensor #6

Closed Blue-beef closed 1 year ago

Blue-beef commented 1 year ago

I first installed the integration for my new Mixergy Tank about a week ago and for a couple of days it was working fine. Now the entities are unavailable.

I'm running HA OS. There has been a Core update since the install; 2023.1.5.

Here is the log file:

Log Details (ERROR) Logger: homeassistant.components.sensor Source: helpers/update_coordinator.py:197 Integration: Sensor (documentation, issues) First occurred: 1:36:14 pm (2 occurrences) Last logged: 1:45:43 pm

Error while setting up mixergy platform for sensor Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection hosts = await asyncio.shield(host_resolved) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 880, in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) File "/usr/local/lib/python3.10/site-packages/aiohttp/resolver.py", line 33, in resolve infos = await self._loop.getaddrinfo( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 860, in getaddrinfo return await self.run_in_executor( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data return await self.update_method() File "/config/custom_components/mixergy/sensor.py", line 24, in async_update_data await tank.fetch_data() File "/config/custom_components/mixergy/tank.py", line 258, in fetch_data await self.authenticate() File "/config/custom_components/mixergy/tank.py", line 85, in authenticate async with session.get(ROOT_ENDPOINT) as resp: File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection raise ClientConnectorError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host www.mixergy.io:443 ssl:default [Try again]

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/mixergy/sensor.py", line 29, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 197, in async_config_entry_first_refresh raise ex homeassistant.exceptions.ConfigEntryNotReady: Cannot connect to host www.mixergy.io:443 ssl:default [Try again]

Blue-beef commented 1 year ago

I have just added "integration_type": "device", to manifest.json file and the integration is now working again!

tomasmcguinness commented 1 year ago

Thanks. I've got to update the component with other changes - just haven't gotten around to it yet! How are you finding the tank?

Blue-beef commented 1 year ago

The tank is awesome. However, some of the smart features are not available when heating from a heat pump, namely the ability to heat it from the top down!

Blue-beef commented 1 year ago

Unfortunately I'm still getting the entities unavailable and the error 'Error while setting up mixergy platform for sensor'. I can't work out what triggers it and why it starts working again.

tomasmcguinness commented 1 year ago

I've upgraded the component to use the newer API. Worth upgrading and seeing if that helps

tomasmcguinness commented 1 year ago

I'm closing this as I assume the issue is resolved!