Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nibe #134974

Open
Sintyr opened this issue Jan 7, 2025 · 13 comments
Open

Nibe #134974

Sintyr opened this issue Jan 7, 2025 · 13 comments

Comments

@Sintyr
Copy link

Sintyr commented Jan 7, 2025

The problem

Hi everyone,

I’ve been trying to set up the Nibe heat pump integration in Home Assistant but keep encountering an unexpected error. The logs suggest issues like the device not existing or the port failing to open.

My Setup:
I’ve followed the integration’s documentation closely:

  • Installed the MODBUS 40 accessory and connected it using a CAT6 cable to a Waveshare RS485 to USB dongle, which is plugged into my Raspberry Pi running Home Assistant OS.
  • The integration documentation specifies that for systems equipped with a MODBUS 40 accessory, the pump can be controlled via a serial RCU connection using an RS485 USB dongle. This is the setup I have implemented.
  • Created the LOG.SET file as per the MODBUS 40 manual and configured the integration using the following
  • Verified the connection through Modbus tools and successfully received temperature data, so the hardware setup seems to be working fine.

In the specific integration i have used
Model: F1145

  • Connection Type: Serial://dev/ttyACM0
  • Other settings kept at default (0).

The Problem:
Despite the setup the integration results in an unexpected error when trying to use it.

Logs indicate issues like:
2. Device does not exist
3. Could not open port

While I can receive temperature data via Modbus, I am setup the integration.
My Goal:
I’d like to get the integration working so I can fully control the heat pump without making major changes to the integration itself, as it’s actively maintained.

I’m relatively new to this, so I would greatly appreciate any guidance on resolving this issue. Logs are available if needed.

Thanks in advance for your help!

What version of Home Assistant Core has the issue?

core-2024.12.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

nibe_heatpump

Link to integration documentation on our website

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

Diagnostics information

I cant install the integration so i cannot get to dianostic data only LOG

Example YAML snippet

- name: Tepelne_seriova_presmicka
  type: serial
  port: /dev/ttyACM0
  baudrate: 9600
  bytesize: 8
  method: rtu
  parity: N
  stopbits: 1
  delay: 0
  message_wait_milliseconds: 30
  timeout: 5
  
  sensors:
    - name: "BT1 Outdoor temp"
      unique_id: "Nibe_BT1_Outdoor_temp_2"
      slave: 1
      address: 40004
      input_type: holding
      device_class: temperature
      precision: 1
      scale: 0.1
      unit_of_measurement: "°C"
      data_type: int16
      scan_interval: 5

Anything in the logs that might be useful for us?

Logger: homeassistant.components.nibe_heatpump
Source: components/nibe_heatpump/config_flow.py:192
integration: Nibe Heat Pump (documentation, issues)
First occurred: 12:03:22 PM (1 occurrences)
Last logged: 12:03:22 PM

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/serialio/aio/posix.py", line 61, in open
    self.fd = os.open(self.port, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
              ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 192, in async_step_modbus
    title, data = await validate_modbus_input(self.hass, user_input)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 150, in validate_modbus_input
    await connection.verify_connectivity()
  File "/usr/local/lib/python3.13/site-packages/nibe/connection/modbus.py", line 174, in verify_connectivity
    await verify_connectivity_read_write_alarm(self, self._heatpump)
  File "/usr/local/lib/python3.13/site-packages/nibe/connection/__init__.py", line 96, in verify_connectivity_read_write_alarm
    coil_data = await connection.read_coil(coil)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
    return await copy(fn, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
    do = await self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
    result = await action(retry_state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/tenacity/_utils.py", line 99, in inner
    return call(*args, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/nibe/connection/modbus.py", line 92, in read_coil
    result = await self._client.read_holding_registers(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 181, in read_holding_registers
    return await self._send_message(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 142, in _send_message
    return await self.protocol._async_send_message(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        request, self.stream, self.stream
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 64, in send_message_rtu
    await writer.drain()
  File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 113, in drain
    await self._write_coro
  File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 59, in wrapper
    await self.open()
  File "/usr/local/lib/python3.13/site-packages/serialio/aio/posix.py", line 64, in open
    raise SerialException(
        msg.errno, "could not open port {}: {}".format(self._port, msg)
    )
serial.serialutil.SerialException: [Errno 2] could not open port /ttyACM0: [Errno 2] No such file or directory: '/ttyACM0'

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 7, 2025

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

Code owner commands

Code owners of nibe_heatpump 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 nibe_heatpump 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)


nibe_heatpump documentation
nibe_heatpump source
(message by IssueLinks)

@elupus
Copy link
Contributor

elupus commented Jan 7, 2025

I think you are missing a slash (there should be three)

serial:///dev/ttyACM0

@Sintyr
Copy link
Author

Sintyr commented Jan 7, 2025

Hi @elupus , Thank you for the support fast response - absolutely I have tried different variations of the serial command however here is the log file. I just want to verify the version of the heatpump version 9699R7 - Serial number 16555020164003

Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 82, in wrapper
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 449, in read
return await self._read(size=size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/posix.py", line 286, in _read
raise serial.SerialException(
...<2 lines>...
)
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 192, in async_step_modbus
title, data = await validate_modbus_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 150, in validate_modbus_input
await connection.verify_connectivity()
File "/usr/local/lib/python3.13/site-packages/nibe/connection/modbus.py", line 174, in verify_connectivity
await verify_connectivity_read_write_alarm(self, self._heatpump)
File "/usr/local/lib/python3.13/site-packages/nibe/connection/init.py", line 96, in verify_connectivity_read_write_alarm
coil_data = await connection.read_coil(coil)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/init.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/init.py", line 111, in call
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/init.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/tenacity/init.py", line 398, in
self._add_action_func(lambda rs: rs.outcome.result())
~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/init.py", line 114, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/nibe/connection/modbus.py", line 92, in read_coil
result = await self._client.read_holding_registers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 181, in read_holding_registers
return await self._send_message(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 142, in _send_message
return await self.protocol._async_send_message(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
request, self.stream, self.stream
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/async_modbus/core.py", line 68, in send_message_rtu
response_error_adu = await reader.readexactly(exception_adu_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 67, in wrapper
return await coro
^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 103, in wrapper
reply = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 88, in wrapper
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/base.py", line 449, in read
return await self._read(size=size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/serialio/aio/posix.py", line 286, in _read
raise serial.SerialException(
...<2 lines>...
)
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

@elupus
Copy link
Contributor

elupus commented Jan 7, 2025

Almost looks like you have something else using that serial port. Like the built in modbus integration? Or multiple Nibe?

Ps. I think you are one of very few that use an actual modbus40. Most run with an nibegw thpe device.

But it it is intended to work with the modbus40.

@Sintyr
Copy link
Author

Sintyr commented Jan 7, 2025

Hi, I know I've read trough the forums ESPs very popular, but I just wanted something robust and it was offered to me when we were installing the heatpump. However I deleted the whole mondbus from configuration.yaml. The sole purpose of the raspberry pi was to control Huawei inverter in conjunction with the heatpump that is connected via Huawei Solar integration trough modbus TCP. I dont have any other Serial connection other than this. I must say I really appreciate your time on this, unfortunaly I have this error and nothing in the Logs . The remote write port and remote port relate to TCP connection trough NibeGW right ? But I have defined that this should be a serial connection
image

@elupus
Copy link
Contributor

elupus commented Jan 7, 2025

If this is a raspberry pi without home assistant os (direct core install) this might be related https://stackoverflow.com/questions/28343941/python-serialexception-device-reports-readiness-to-read-but-returned-no-data-d

@Sintyr
Copy link
Author

Sintyr commented Jan 7, 2025

I have installed HomeAssistant directly from Rasberry Pi imager on a fresh SD card nothing else runs on the RPi.

@elupus
Copy link
Contributor

elupus commented Jan 7, 2025

Yes but its the OS version of home assistant or just a python based install on a standard raspbarry os?

@Sintyr
Copy link
Author

Sintyr commented Jan 7, 2025

Its the OS Version of Home Assistant on a standard Raspberry Pi 4

@elupus
Copy link
Contributor

elupus commented Jan 7, 2025

I think its the wrong serial device. Im not sure how to detect the right device.

@Sintyr
Copy link
Author

Sintyr commented Jan 8, 2025

Then I am open for suggestions, would it help to have the python based installation on the raspberry so the integration can pin point the correct serial connection ? It is odd that when I use the built in modbus it reads just fine. With serial connection being set as /dev/ttyACM0.
image

  • name: Nibe_HeatPump
    type: serial
    port: /dev/ttyACM0
    baudrate: 9600
    bytesize: 8
    method: rtu
    parity: N
    stopbits: 1
    delay: 0
    message_wait_milliseconds: 30
    timeout: 5

    sensors:

    • name: "BT1 Outdoor temp"
      unique_id: "Nibe_BT1_Outdoor_temp_2"
      slave: 1
      address: 40004
      input_type: holding
      device_class: temperature
      precision: 1
      scale: 0.1
      unit_of_measurement: "°C"
      data_type: int16
      scan_interval: 5
    • name: "EB100-EP14-BT3 Return temp"
      unique_id: "Nibe_EB100_EP14_BT3_Return_temp_2"
      slave: 1
      address: 40012
      input_type: holding
      device_class: temperature
      precision: 1
      scale: 0.1
      unit_of_measurement: "°C"
      data_type: int16
      scan_interval: 5

@elupus
Copy link
Contributor

elupus commented Jan 8, 2025

Have you restarted after you removed the manual modbus connection?

@Sintyr
Copy link
Author

Sintyr commented Jan 8, 2025

Yes, of course every time I make a change in the configuration.yaml or modbus.yaml I make sure to restart. Once you suggested that other port may be in use by different modbus device I have deleted the whole code and the modbus integration restarted and tried again with the Nibe HeatPump integration with serial:///dev/ttyACM0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants