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

Validation Error: Timeout on Writing to Nibe Heat Pump During Configuration #120023

Open
Puma7 opened this issue Jun 20, 2024 · 8 comments
Open

Comments

@Puma7
Copy link

Puma7 commented Jun 20, 2024

The problem

Bug Description for Nibe F1255
When attempting to configure the Nibe heat pump, a validation error occurs. The error happens during the connectivity check and results in a FieldError.

Steps to Reproduce

  1. Navigate to the configuration page of the Nibe heat pump in Home Assistant.
  2. Enter the necessary connection details.
  3. Start the connectivity check.
  4. The error occurs when attempting to perform a write operation to the heat pump.

Expected Behavior
The configuration should be validated and saved successfully without triggering a WriteException.

Actual Behavior
The validation fails, and a WriteException with the message "Heatpump denied writing alarm-reset-45171" is triggered, followed by a FieldError.

Additional Information
Home Assistant Version: 2024.6.3
Nibe Integration Version: newest

I checked that general UDP packets arrive at Home Assistant via nc -tpl 19999 (I can see the name of the heat pump, so the communication from the ESP and the heat pump should be working?) and also checked that the port was bound when the setup started. It has already been tested that the UDP packets are received back on port 19999, and packets are indeed reported back at that port.

What version of Home Assistant Core has the issue?

2024.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

nibe_heatpump

Link to integration documentation on our website

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

Diagnostics information

Issue1

Example YAML snippet

esphome:
  name: nibegw
  comment: Nibegw
  platform: ESP32
  board: esp32dev

# General ESPHome setup
api:
  reboot_timeout: 0s

ota:
  platform: esphome
  password: ******

logger:

wifi:
  ssid: 24GhzHistoricHub
  password: *********
  fast_connect: true # Fast connect to connect to my hidden network
  # It is recommended to disable powersave mode on wifi, to make sure the device does not miss UDP requests sent.
  power_save_mode: none
  # The device needs a static IP. Either do that here with the manual_ip node, or do it via another way (router)

# Load nibe component
external_components:
  - source: github://elupus/esphome-nibe

# Set pins required for LilyGo T-CAN485 board
output:
  - platform: gpio
    id: ENABLE_PIN # Enable the chip
    pin:
      number: GPIO19
      inverted: true
  - platform: gpio
    id: SE_PIN # Enable autodirection
    pin:
      number: GPIO17
      inverted: true
  - platform: gpio
    id: ENABLE_5V_PIN # Enable 5V pin for RS485 chip
    pin:
      number: GPIO16
      inverted: true

# Configure uart that will be used
uart:
  rx_pin: GPIO21
  tx_pin: GPIO22
  baud_rate: 9600

# Configure NibeGW
nibegw:
  udp:
    # The target address(s) to send data to. May be a multicast address.
    # When using Home Assistant: this is your Home Assistant IP.
    target:
      - ip: 192.168.1.182
        port: 19999 #The Nibe Home Assistant integration listens to 9999 by default 

    # List of source address to accept data from, may be empty for no filter
    #source:
    #  - 192.168.1.182
      
    # Optional port this device will listen to to receive read requests. Defaults to 9999
    #read_port: 9999

    # Optional port this device will listen to to receive write request. Defaults to 10000
    #write_port: 10000

  acknowledge:
    - MODBUS40

  # Constant replies to certain requests cabe made
  constants:
    - address: MODBUS40
      token: ACCESSORY
      data: [
            0x0A, # MODBUS version low
            0x00, # MODBUS version high
            0x01, # MODBUS address?
      ]

# Some helper functions to restart ESPHome from HA
button:
- platform: restart
  name: Nibegw Restart
- platform: safe_mode
  name: Nibegw Safe Mode Boot

Anything in the logs that might be useful for us?

2024-06-20 14:38:58.623 ERROR (MainThread) [homeassistant.components.nibe_heatpump] Validation error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 111, in validate_nibegw_input
    await connection.verify_connectivity()
  File "/usr/local/lib/python3.12/site-packages/nibe/connection/nibegw.py", line 468, in verify_connectivity
    await verify_connectivity_read_write_alarm(self, self._heatpump)
  File "/usr/local/lib/python3.12/site-packages/nibe/connection/__init__.py", line 96, in verify_connectivity_read_write_alarm
    await connection.write_coil(coil_data)
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 142, in async_wrapped
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 58, in __call__
    do = await self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 110, in iter
    result = await action(retry_state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 78, in inner
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 390, in 
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 61, in __call__
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/nibe/connection/nibegw.py", line 369, in write_coil
    raise WriteException(f"Heatpump denied writing {coil.name}")
nibe.exceptions.WriteException: Heatpump denied writing alarm-reset-45171
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 218, in async_step_nibegw
    title, data = await validate_nibegw_input(self.hass, user_input)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/config_flow.py", line 119, in validate_nibegw_input
    raise FieldError("Timeout on writing to pump", "base", "write") from exception
homeassistant.components.nibe_heatpump.config_flow.FieldError: Timeout on writing to pump

Additional information

Issue2 This is what i get back on port 19999 from Nibe F1255-6. Should it look like this?
@home-assistant
Copy link

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 Jun 20, 2024

Are you using the lilygo t-can485 board?
Which revision of it?
Do you have any firewalls or routers between the devices?
The data might looks corrct, more used to it in hex.

@elupus
Copy link
Contributor

elupus commented Jun 20, 2024

Actually. The pump looks to actually be responding to the request. It rejecting it. That might actually be a valid response. Either that or we have the wrong parameter number for that pump.

@elupus
Copy link
Contributor

elupus commented Jun 20, 2024

Which exact model heat pump is it?

@Puma7
Copy link
Author

Puma7 commented Jun 20, 2024

Are you using the LilyGO T-CAN485 board? Which revision of it?
Yes, but I would need to disassemble it again to find out the revision. Where can I find the revision information?

Do you have any firewalls or routers between the devices?
Yes, it's a Unifi network, but the UDP packets from the last screenshot were from the terminal inside Home Assistant. So, I guess at least on the way back from the heat pump, everything seems to be normal.

Which exact model heat pump is it?
It's a Nibe F1255-6 E EM with an FLM ventilation system. Could the FLM be causing the issue?

Or is it because i updated on the 04.06.2024 to the new software Version: 9699R4 from the Heatpump?

@elupus
Copy link
Contributor

elupus commented Jun 20, 2024

Ok. Lets try something weird.. :). Go into the extra settings on the pump and enable the RMU40 accessory. This should cause your pump to go into alarm. Dont clear it, but try to add the system in HA while the pump is showing an alarm on screen.

This might work, if the pump is rejecting the write request to clear alarms when there are none. Worth a shot.

The you can disable the RMU40 accessory again and clear any alarms.

@Puma7
Copy link
Author

Puma7 commented Jun 21, 2024

As I was writing this, I reset the Nibe back to software version 9443R7. Guess what, that fixed it! However, Nibe wanted me to upgrade because of the change from Nibe Uplink to MyUplink. I thought they wouldn't touch the Modbus, but reverting the software made it pass on the first try. I've now been working on it for 2 days 😄

Do you know if Nibe changed something with the modbus with the shift to MyUplink? I didn't read anything in the changelog.

---old text---
Sadly, that didn't help. I activated the first RMU in the menu and tried multiple times to activate it via HA. Unfortunately, the error message in the log remained the same.

@elupus
Copy link
Contributor

elupus commented Jun 21, 2024

Oh! So they changed some behavior there. I was afraid they might.

Crap i need to take the time and update my pump and see what others stuff they might have broken.

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