home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.4k stars 30.65k forks source link

No USB-to-serial connection (since 2022.7 ??) #74820

Closed jjvandenberg closed 2 years ago

jjvandenberg commented 2 years ago

The problem

after upgrading to 2022.7, the serial-over-USB link with the Opentherm Gateway is broken. it has run over a year on /dev/ttyUSB0

now, it's broken, when trying to re-add the integration, it errors on connecting the USB serial

Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:96 First occurred: 18:57:15 (3148 occurrences) Last logged: 19:13:08

Error doing job: Exception in callback SerialTransport._read_ready() Traceback (most recent call last): File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.10/site-packages/serial_asyncio/init.py", line 120, in _read_ready self._protocol.data_received(data) File "/usr/local/lib/python3.10/site-packages/pyotgw/protocol.py", line 95, in data_received self._readbuf += data AttributeError: 'protocol' object has no attribute '_readbuf'

What version of Home Assistant Core has the issue?

2022.7

What was the last working version of Home Assistant Core?

pre 2022.7

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

might be the OTG integration

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:96
First occurred: 18:57:15 (3148 occurrences)
Last logged: 19:13:08

Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.10/site-packages/serial_asyncio/__init__.py", line 120, in _read_ready
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.10/site-packages/pyotgw/protocol.py", line 95, in data_received
    self._readbuf += data
AttributeError: 'protocol' object has no attribute '_readbuf'

####################

Logger: aiohttp.server
Source: components/opentherm_gw/config_flow.py:63
First occurred: 18:57:15 (5 occurrences)
Last logged: 19:12:59

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 277, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 359, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/opentherm_gw/config_flow.py", line 68, in async_step_init
    res = await asyncio.wait_for(test_connection(), timeout=10)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/opentherm_gw/config_flow.py", line 63, in test_connection
    status = await otgw.connect(self.hass.loop, device)
  File "/usr/local/lib/python3.10/site-packages/pyotgw/pyotgw.py", line 138, in connect
    await self.get_reports()
  File "/usr/local/lib/python3.10/site-packages/pyotgw/pyotgw.py", line 310, in get_reports
    ret = await self._wait_for_cmd(cmd, v.OTGW_REPORT_ABOUT)
  File "/usr/local/lib/python3.10/site-packages/pyotgw/pyotgw.py", line 1042, in _wait_for_cmd
    return await asyncio.wait_for(
TypeError: wait_for() got an unexpected keyword argument 'loop'

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

opentherm_gw documentation opentherm_gw source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @mvn23, mind taking a look at this issue as it has been labeled with an integration (opentherm_gw) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

frenck commented 2 years ago

duplicate of #74529