OStrama / weishaupt_modbus

This integration allows you to monitor and controll your weishaupt heatpump via modbus.
MIT License
21 stars 7 forks source link

Warmwasser push does not work #50

Open StijnVdd opened 5 hours ago

StijnVdd commented 5 hours ago

Describe the bug I've been playing around with the translations, when I observed an error when selecting the warmwasser push options. As that version is unstable, I installed version 1.0.3 again and I have the same error

Logger: homeassistant.components.automation.warm_water_push
Source: components/automation/__init__.py:743
integration: Automation (documentation, issues)
First occurred: 13:58:29 (2 occurrences)
Last logged: 14:00:00

While executing automation automation.warm_water_push
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 743, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 188, in async_handle_select_option
    await self.async_select_option(option)
  File "/config/custom_components/weishaupt_modbus/entities.py", line 475, in async_select_option
    await self.set_translate_val(option)
  File "/config/custom_components/weishaupt_modbus/entities.py", line 283, in set_translate_val
    await mbo.setvalue(val)
  File "/config/custom_components/weishaupt_modbus/modbusobject.py", line 267, in setvalue
    await self._modbus_client.write_register(
  File "/usr/local/lib/python3.12/site-packages/pymodbus/client/base.py", line 162, in async_execute
    packet = self.framer.buildPacket(request)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pymodbus/framer/socket_framer.py", line 105, in buildPacket
    data = message.function_code.to_bytes(1, 'big') + message.encode()
                                                      ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pymodbus/register_write_message.py", line 50, in encode
    packet += struct.pack(">H", self.value)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: 'H' format requires 0 <= number <= 65535

To Reproduce Select any option in the select.warmwasser_push entity

Expected behavior The selection amount of minutes to be 'pushed' to the heat pump

OStrama commented 2 hours ago

Please try 1.0.4pre. At least on my production system Ww Push works