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
69.73k stars 28.88k forks source link

Nibe Integration causes exception when changing mode for climate_system_s1 on S1155 #120368

Open jhausladen opened 1 week ago

jhausladen commented 1 week ago

The problem

The Home Assistant Nibe integration throws an exception, when the Mode for the climate system is changed.

nibe_exception

`2024-06-24 21:24:34.839 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140063853239104] Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/nibe/connection/encoders.py", line 68, in encode coil_data.validate() File "/usr/local/lib/python3.12/site-packages/nibe/coil.py", line 246, in validate raise ValidationError( nibe.exceptions.ValidationError: cooling-with-room-sensors-40171 coil value (OFF) is invalid type (expected int, float or datetime.date)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 977, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1049, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/climate.py", line 252, in async_set_hvac_mode await coordinator.async_write_coil( File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/coordinator.py", line 137, in async_write_coil await self.connection.write_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/modbus.py", line 136, in write_coil values = self.coil_encoder.encode(coil_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/nibe/connection/encoders.py", line 71, in encode raise EncodeException( nibe.exceptions.EncodeException: Failed to encode cooling-with-room-sensors-40171 coil for value: OFF, exception: cooling-with-room-sensors-40171 coil value (OFF) is invalid type (expected int, float or datetime.date)`

It also doesn't show the actual state, such as cooling or heating properly.

What version of Home Assistant Core has the issue?

core-2024.6.4

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 Heat Pump

Link to integration documentation on our website

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

Diagnostics information

home-assistant_nibe_heatpump_2024-06-24T19-24-53.273Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-06-24 21:24:16.420 DEBUG (MainThread) [homeassistant.components.nibe_heatpump] Skipping climate: s2 due to Coil with address 30026 not found
2024-06-24 21:24:16.420 DEBUG (MainThread) [homeassistant.components.nibe_heatpump] Skipping climate: s3 due to Coil with address 30025 not found
2024-06-24 21:24:16.420 DEBUG (MainThread) [homeassistant.components.nibe_heatpump] Skipping climate: s4 due to Coil with address 30024 not found
...
2024-06-24 21:24:34.839 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140063853239104] Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/nibe/connection/encoders.py", line 68, in encode
    coil_data.validate()
  File "/usr/local/lib/python3.12/site-packages/nibe/coil.py", line 246, in validate
    raise ValidationError(
nibe.exceptions.ValidationError: cooling-with-room-sensors-40171 coil value (OFF) is invalid type (expected int, float or datetime.date)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 977, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1049, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/climate.py", line 252, in async_set_hvac_mode
    await coordinator.async_write_coil(
  File "/usr/src/homeassistant/homeassistant/components/nibe_heatpump/coordinator.py", line 137, in async_write_coil
    await self.connection.write_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 <lambda>
    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/modbus.py", line 136, in write_coil
    values = self.coil_encoder.encode(coil_data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/nibe/connection/encoders.py", line 71, in encode
    raise EncodeException(
nibe.exceptions.EncodeException: Failed to encode cooling-with-room-sensors-40171 coil for value: OFF, exception: cooling-with-room-sensors-40171 coil value (OFF) is invalid type (expected int, float or datetime.date)

Additional information

No response

home-assistant[bot] commented 1 week ago

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)