nathanmarlor / foxess_modbus

FoxESS inverter integration. Connect directly to your FoxESS inverter (no cloud!) for real-time status and control.
MIT License
105 stars 14 forks source link

Foxess H3 8.0 - When Selecting Force charge/discharge, Error: IllegalAddress #557

Closed Vato9394 closed 2 months ago

Vato9394 commented 4 months ago

Version

1.10.1

Configuration

Foxess AIO H3 8.0 Using modbus over USB

Describe the bug

Cannot start force charge or discharge.

Debug log

Error logs are from selecting force charge:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:240
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:53:14 (5 occurrences)
Last logged: 22:35:09

[139912128258112] Error writing registers. Start: 44001; values: [20]; slave: 247 from /dev/ttyUSB0: Exception Response(134, 6, IllegalAddress)
[139912128258112] Error writing registers. Start: 44003; values: [8000, 0]; slave: 247 from /dev/ttyUSB0: Exception Response(144, 16, IllegalAddress)
[139912128258112] Error writing registers. Start: 44000; values: [0]; slave: 247 from /dev/ttyUSB0: Exception Response(134, 6, IllegalAddress)
[139911933609792] Error writing registers. Start: 44001; values: [20]; slave: 247 from /dev/ttyUSB0: Exception Response(134, 6, IllegalAddress)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 195, in async_handle_select_option
    await self.async_select_option(option)
  File "/config/custom_components/foxess_modbus/entities/modbus_work_mode_select.py", line 68, in async_select_option
    await self._controller.remote_control_manager.set_mode(mode)
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 60, in set_mode
    await self._update()
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 94, in _update
    await self._update_charge()
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 211, in _update_charge
    await self._enable_remote_control(WorkMode.BACK_UP)
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 311, in _enable_remote_control
    await self._controller.write_register(self._addresses.timeout_set, timeout)
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 174, in write_register
    await self.write_registers(address, [value])
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 211, in write_registers
    raise ex
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 195, in write_registers
    await self._client.write_registers(start_address, values, self._slave)
  File "/config/custom_components/foxess_modbus/client/modbus_client.py", line 180, in write_registers
    raise ModbusClientFailedError(message, self, response)
custom_components.foxess_modbus.client.modbus_client.ModbusClientFailedError: Error writing registers. Start: 44001; values: [20]; slave: 247 from /dev/ttyUSB0: Exception Response(134, 6, IllegalAddress)
This error originated from a custom integration.

Logger: custom_components.foxess_modbus.modbus_controller
Source: custom_components/foxess_modbus/modbus_controller.py:195
Integration: FoxESS - Modbus (documentation, issues)
First occurred: 10:53:14 (10 occurrences)
Last logged: 22:35:10

Failed to write registers
Traceback (most recent call last):
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 195, in write_registers
    await self._client.write_registers(start_address, values, self._slave)
  File "/config/custom_components/foxess_modbus/client/modbus_client.py", line 180, in write_registers
    raise ModbusClientFailedError(message, self, response)
custom_components.foxess_modbus.client.modbus_client.ModbusClientFailedError: Error writing registers. Start: 44001; values: [20]; slave: 247 from /dev/ttyUSB0: Exception Response(134, 6, IllegalAddress)
This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/foxess_modbus/client/modbus_client.py:180
Integration: FoxESS - Modbus (documentation, issues)
First occurred: 10:53:17 (5 occurrences)
Last logged: 22:35:10

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 328, in _refresh
    await self._remote_control_manager.poll_complete_callback()
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 335, in poll_complete_callback
    await self._update()
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 94, in _update
    await self._update_charge()
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 212, in _update_charge
    await self._write_active_power(-max_import_power)
  File "/config/custom_components/foxess_modbus/remote_control_manager.py", line 133, in _write_active_power
    await self._controller.write_registers(self._addresses.active_power[0], values)
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 211, in write_registers
    raise ex
  File "/config/custom_components/foxess_modbus/modbus_controller.py", line 195, in write_registers
    await self._client.write_registers(start_address, values, self._slave)
  File "/config/custom_components/foxess_modbus/client/modbus_client.py", line 180, in write_registers
    raise ModbusClientFailedError(message, self, response)
custom_components.foxess_modbus.client.modbus_client.ModbusClientFailedError: Error writing registers. Start: 44003; values: [57536, 65535]; slave: 247 from /dev/ttyUSB0: Exception Response(144, 16, IllegalAddress)
Vato9394 commented 2 months ago

V1.11.0 removed this option, but changing from work mode self use to Feed-in first worked. The min and max socket was also working. This didn't need to be removed for the H3. Only force charge and discharge was not working.