zxdavb / ramses_cc

HA integration for CH/DHW and HVAC systems that use the RAMSES II RF protocol
GNU General Public License v3.0
71 stars 16 forks source link

RFC2217: write_timeout is currently not supported #143

Open noud-github opened 7 months ago

noud-github commented 7 months ago

I found Issue after updating to 0.31.2.

on 0.21.40 this works like a charm:

serial_port:
  port_name: rfc2217://somewhere.lan:2217
  baudrate: 57600  # or 115200, YMMV

after the upgrade to 0.31.2 this end with write_timeout is currently not supported

Logger: homeassistant.setup
Source: setup.py:332
First occurred: 09:58:56 (1 occurrences)
Last logged: 09:58:56

Error during setup of component ramses_cc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 332, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/ramses_cc/__init__.py", line 74, in async_setup
    await broker.start()
  File "/config/custom_components/ramses_cc/broker.py", line 120, in start
    await self.client.start(cached_packets=cached_packets())
  File "/usr/local/lib/python3.11/site-packages/ramses_rf/gateway.py", line 179, in start
    await super().start()  # TODO: do this *after* restore cache
    ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ramses_tx/gateway.py", line 189, in start
    self._transport = await transport_factory(
                      ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ramses_tx/transport.py", line 913, in transport_factory
    transport = PortTransport(
                ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ramses_tx/transport.py", line 759, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/ramses_tx/transport.py", line 454, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/ramses_tx/transport.py", line 282, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/ramses_tx/transport.py", line 624, in __init__
    super().__init__(loop or asyncio.get_running_loop(), protocol, pkt_source)
  File "/usr/local/lib/python3.11/site-packages/serial_asyncio/__init__.py", line 66, in __init__
    self._serial.write_timeout = 0
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/serial/serialutil.py", line 392, in write_timeout
    self._reconfigure_port()
  File "/usr/local/lib/python3.11/site-packages/serial/rfc2217.py", line 508, in _reconfigure_port
    raise NotImplementedError('write_timeout is currently not supported')
NotImplementedError: write_timeout is currently not supported
noud-github commented 7 months ago

I worked around this issue (for now) by using socat to create a virtual tty connected to the rcf2217 port, and mount that in the HA container,

zxdavb commented 7 months ago

Unfortunately, RFC2217 is not supported from version 0.30.0 (and 0.31.x).

This may change in the future, but current focus is on the new MQTT feature.

noud-github commented 7 months ago

Thanx for sharing, switching to mqtt makes a lot of sence.