core: Vallox integration broken with 2021.12 (even with fix after 2021.12.3)

The problem

After updating to 2021.12.x (tried both 2021.12.0 and 2021.12.1) the vallox integration isn’t working anymore.

What version of Home Assistant Core has the issue?

core-2021.12.1

What was the last working version of Home Assistant Core?

core-2021.11

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Vallox

Link to integration documentation on our website

https://www.home-assistant.io/integrations/vallox/

Example YAML snippet

vallox:
  host: 192.168.12.15

Anything in the logs that might be useful for us?

Logger: homeassistant.components.fan
Source: components/vallox/fan.py:102
Integration: Ventilator (documentation, issues)
First occurred: 12:22:10 (1 occurrences)
Last logged: 12:22:10

Error while setting up vallox platform for fan
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/vallox/fan.py", line 77, in async_setup_platform
    device = ValloxFan(
  File "/usr/src/homeassistant/homeassistant/components/vallox/fan.py", line 102, in __init__
    self._attr_unique_id = str(self.coordinator.data.get_uuid())
AttributeError: 'NoneType' object has no attribute 'get_uuid'


Logger: homeassistant.components.sensor
Source: components/vallox/sensor.py:55
Integration: Sensor (documentation, issues)
First occurred: 12:22:09 (1 occurrences)
Last logged: 12:22:09

Error while setting up vallox platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/vallox/sensor.py", line 238, in async_setup_platform
    [
  File "/usr/src/homeassistant/homeassistant/components/vallox/sensor.py", line 239, in <listcomp>
    description.sensor_type(name, coordinator, description)
  File "/usr/src/homeassistant/homeassistant/components/vallox/sensor.py", line 55, in __init__
    uuid = self.coordinator.data.get_uuid()
AttributeError: 'NoneType' object has no attribute 'get_uuid'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 31 (22 by maintainers)

Commits related to this issue

Most upvoted comments

In practice, this would mean that configuration should be migrated from configuration.yaml to UI-based configuration, right?

Yes, correct.

The developer docs are a good start I’d say. I highly recommend to use Visual Studio Code as outlined there, because the docker-based dev container feature gets you started quite easily. Once this is running, it basically is as easy as selecting Tasks: Run Task -> Run Home Assistant Core.

The Configuration chapter talks about ConfigEntry and friends. Besides these docs, I would recommend to search for a light-weight integration that uses the feature already to compare to. It always helps to have working code to compare to.

Applied the latest state of the PR. As expected, I got this in the log, but after that it works:

2021-12-22 08:18:45 ERROR (MainThread) [homeassistant.components.vallox] Error fetching Vallox 110 MV DataUpdateCoordinator data: Error during state cache update
2021-12-22 08:18:45 WARNING (MainThread) [homeassistant.components.vallox] Vallox integration not ready yet; Retrying in background

Thanks @htuomola! That’s the initial issue that causes this.

There’s this third error that also happens at same time, just realized it wasn’t mentioned in this issue.

I’m running this in Raspberry Pi 4 and Vallox 145 MV unit. Everything worked fine before 2021.12.x for me too.

Logger: homeassistant.components.vallox
Source: components/vallox/__init__.py:146
Integration: Vallox (documentation, issues)
First occurred: December 17, 2021, 5:53:51 PM (1 occurrences)
Last logged: December 17, 2021, 5:53:51 PM

Unexpected error fetching Ilmanvaihtokone DataUpdateCoordinator data: code = 1005 (no status code [internal]), no reason
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/vallox/__init__.py", line 146, in async_update_data
    metric_cache = await client.fetch_metrics()
  File "/usr/local/lib/python3.9/site-packages/vallox_websocket_api/client.py", line 219, in fetch_metrics
    result = await self._websocket_request(payload)
  File "/usr/local/lib/python3.9/site-packages/vallox_websocket_api/client.py", line 201, in _websocket_request
    r = await ws.recv()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 421, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 726, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1005 (no status code [internal]), no reason