core icon indicating copy to clipboard operation
core copied to clipboard

Error connecting to DSMR

Open PRobert-spektral opened this issue 1 year ago • 12 comments

The problem

The DSMR reader isn't working anymore since the update to core 2024.2 ands HA OS 11.5 I have done today (08/02/24). In 2024.1 it was working great for the power & gas meters

What version of Home Assistant Core has the issue?

core-2024.2.0

What was the last working version of Home Assistant Core?

core-2024.1.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

DSMR

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.dsmr
Source: components/dsmr/sensor.py:625
Integration: DSMR Slimme Meter (documentation, issues)
First occurred: 16:29:40 (137 occurrences)
Last logged: 17:36:52

Error connecting to DSMR
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AQ56MLQM-if00-port0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/dsmr/sensor.py", line 625, in connect_and_reconnect
    transport, protocol = await hass.loop.create_task(reader_factory())
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/serial_asyncio/__init__.py", line 448, in create_serial_connection
    serial_instance = serial.serial_for_url(*args, **kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/serial/__init__.py", line 90, in serial_for_url
    instance.open()
  File "/usr/local/lib/python3.12/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AQ56MLQM-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AQ56MLQM-if00-port0'

Additional information

Running on Home Assistant Yellow

PRobert-spektral avatar Feb 08 '24 16:02 PRobert-spektral

Hey there @robbie1221, @frenck, mind taking a look at this issue as it has been labeled with an integration (dsmr) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of dsmr can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign dsmr Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


dsmr documentation dsmr source (message by IssueLinks)

home-assistant[bot] avatar Feb 08 '24 16:02 home-assistant[bot]

"I had the same issue after upgrading to 2024.2.0; however, after performing a full shutdown of the Raspberry Pi, DSRM started working again upon reboot."

wpgheurkens avatar Feb 08 '24 22:02 wpgheurkens

I’m having a similar issue. Energy is not monitoring after the update. Also my solar panel integration is not updating (Enphase Envoy). Energy history is available and working, but no new registration of energy. Even after reboot of everything, however the DSMR does report data for me.

maarten80 avatar Feb 09 '24 17:02 maarten80

Same problem here. DSMR integration stopped working after install of 2024.2. The existing metering entities were suddenly all invalid. A drop/reinstall of the DSMR integration (dsmr type 4) resulted in ‘could not connect’. A full restart of the Rpi 4B + HA did not help either.

JongsmaSimon avatar Feb 09 '24 23:02 JongsmaSimon

Also the same problem. Starts with version 2024.2 and HA OS 11.5. Still same problem with version 2024.2.2

JohanCl avatar Feb 20 '24 14:02 JohanCl

Same over here, when reinstalled the DSMR integration, it does only connect to the wrong configuration, 5S for Swedish, for me it should be 5 Dutch. It does not receive data. However over wifi i can connect directly through the gateway and see that it is receiving data from the electricity meter.

Geert111 avatar Mar 09 '24 16:03 Geert111

After a numerous trys to reinstall the DSMR integration it works again. No clue why.

Geert111 avatar Mar 09 '24 18:03 Geert111

Same issue here.

2024-03-23 16:44:51.094 ERROR (MainThread) [homeassistant.components.dsmr] Error connecting to DSMR
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/dsmr/sensor.py", line 621, in connect_and_reconnect
    transport, protocol = await hass.loop.create_task(reader_factory())
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1120, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1102, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^

fantpmas avatar Mar 25 '24 13:03 fantpmas

Discovered the IP of my SMART METER GATEWAY had changed, after updating it via https://community.home-assistant.io/t/modify-configuration-made-through-gui-dsmr-in-this-case/522427/3 it started working again.

fantpmas avatar Mar 25 '24 14:03 fantpmas

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

This issue was in fact solved by a later update approx. in february.

JongsmaSimon avatar Jun 23 '24 16:06 JongsmaSimon