solaredge-modbus-multi: Select function not working, storage command mode
Describe the bug
When using a StorEdge inverter, when selecting an option from the select function it gives an error: Failed to perform the action select/selection_option. object of type “int” has no len()
Have tries restarting HA a couple of times. Disabling and rearranging Removing the integration and adding it back again. Have tried version 3.0.6, 3.0.5, and 3.0.4 all having the same issue for me.
I use these control in a couple of automation to control the charing and discharging function of the inverter and connected batteries. Have used this integration for a long time already, and don’t known why this is giving trouble now. When selecting a value for this select using a automation also does not work
Expected behavior
Have the control select the correct function for the inverter.
Screenshots
No response
Diagnostic File
Logger: homeassistant.components.automation.storedge_battery_control_control_charge_and_dischage_based_on_setpoint_v2 Source: helpers/script.py:526 integration: Automation (documentation, issues) First occurred: 12:50:48 (17493 occurrences) Last logged: 16:05:54
Storedge - Battery control - Control charge and dischage based on setpoint (input number): If at step 1: If at step 1: Error executing script. Unexpected error for device at pos 1: object of type ‘int’ has no len() Storedge - Battery control - Control charge and dischage based on setpoint (input number): If at step 1: Error executing script. Unexpected error for if at pos 1: object of type ‘int’ has no len() Storedge - Battery control - Control charge and dischage based on setpoint (input number): Error executing script. Unexpected error for if at pos 1: object of type ‘int’ has no len() Traceback (most recent call last): 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 779, in _async_device_step await device_action.async_call_action_from_config( self._hass, self._action, self._variables, self._context ) File “/usr/src/homeassistant/homeassistant/components/device_automation/action.py”, line 72, in async_call_action_from_config await platform.async_call_action_from_config(hass, config, variables, context) File “/usr/src/homeassistant/homeassistant/components/select/device_action.py”, line 121, in async_call_action_from_config await hass.services.async_call( …<5 lines>… ) File “/usr/src/homeassistant/homeassistant/core.py”, line 2794, in async_call response_data = await coro ^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/core.py”, line 2837, 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( ^^^^^^^^^^^^^^^^^^^^^^^^^^ hass, entity, func, data, call.context ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ 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/solaredge_modbus_multi/select.py”, line 291, in async_select_option await self._platform.write_registers(address=57357, payload=new_mode) File “/config/custom_components/solaredge_modbus_multi/hub.py”, line 1431, in write_registers await self.hub.write_registers(self.inverter_unit_id, address, payload) File “/config/custom_components/solaredge_modbus_multi/hub.py”, line 560, in write_registers result = await self._client.write_registers( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ self._wr_address, slave=self._wr_unit, values=self._wr_payload ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File “/usr/local/lib/python3.13/site-packages/pymodbus/client/mixin.py”, line 514, in write_registers return self.execute(no_response_expected, pdu_reg.WriteMultipleRegistersRequest(address=address, registers=values,dev_id=slave)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.13/site-packages/pymodbus/pdu/pdu.py”, line 36, in init self.count: int = count or len(self.registers) ~~~^^^^^^^^^^^^^^^^ TypeError: object of type ‘int’ has no len()
Logger: homeassistant.components.automation.storedge_battery_control_control_charge_and_dischage_based_on_setpoint_v2 Source: components/automation/init.py:717 integration: Automation (documentation, issues) First occurred: 12:50:48 (5831 occurrences) Last logged: 16:05:54
While executing automation automation.storedge_battery_control_control_charge_and_dischage_based_on_setpoint_v2 Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/automation/init.py”, line 717, in async_trigger return await self.action_script.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variables, trigger_context, started_action ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1808, 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( ~~~~~~~~~~~~~~~~~~~~~~^ ex, continue_on_error, self._log_exceptions or log_exceptions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ 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 1073, in _async_if_step await self._async_run_script(if_data[“if_then”]) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1272, in _async_run_script result = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ …❤️ lines>… ) ^ File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 727, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1808, 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( ~~~~~~~~~~~~~~~~~~~~~~^ ex, continue_on_error, self._log_exceptions or log_exceptions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ 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 1079, in _async_if_step await self._async_run_script(if_data[“if_else”]) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1272, in _async_run_script result = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ …❤️ lines>… ) ^ File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 727, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1808, 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( ~~~~~~~~~~~~~~~~~~~~~~^ ex, continue_on_error, self._log_exceptions or log_exceptions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ 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 779, in _async_device_step await device_action.async_call_action_from_config( self._hass, self._action, self._variables, self._context ) File “/usr/src/homeassistant/homeassistant/components/device_automation/action.py”, line 72, in async_call_action_from_config await platform.async_call_action_from_config(hass, config, variables, context) File “/usr/src/homeassistant/homeassistant/components/select/device_action.py”, line 121, in async_call_action_from_config await hass.services.async_call( …<5 lines>… ) File “/usr/src/homeassistant/homeassistant/core.py”, line 2794, in async_call response_data = await coro ^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/core.py”, line 2837, 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( ^^^^^^^^^^^^^^^^^^^^^^^^^^ hass, entity, func, data, call.context ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ 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/solaredge_modbus_multi/select.py”, line 291, in async_select_option await self._platform.write_registers(address=57357, payload=new_mode) File “/config/custom_components/solaredge_modbus_multi/hub.py”, line 1431, in write_registers await self.hub.write_registers(self.inverter_unit_id, address, payload) File “/config/custom_components/solaredge_modbus_multi/hub.py”, line 560, in write_registers result = await self._client.write_registers( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ self._wr_address, slave=self._wr_unit, values=self._wr_payload ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File “/usr/local/lib/python3.13/site-packages/pymodbus/client/mixin.py”, line 514, in write_registers return self.execute(no_response_expected, pdu_reg.WriteMultipleRegistersRequest(address=address, registers=values,dev_id=slave)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.13/site-packages/pymodbus/pdu/pdu.py”, line 36, in init self.count: int = count or len(self.registers) ~~~^^^^^^^^^^^^^^^^ TypeError: object of type ‘int’ has no len()
Debug logs
Home Assistant Version
2025.02 and 2025.1
solaredge-modbus-multi Version
3.0.6 and 3.0.5 and 3.0.4
Installation Type
HAOS
Read the Instructions
- My configuration follows https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki/Configuration
- I have read the Known Issues https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki/Known-Issues
- This issue is not about a template error (do not report template errors, read https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki/Template-Design-Notes)
Additional Context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (10 by maintainers)
@glenmclarke
Fixed in Release v3.1.0-pre.2
Search for the Integration in HACS and choose “Download again” (I only have the German wording) via the three dots and them you can choose a different version.
Because of the conflicting version requirements for
pymodbus. The solax or huawei custom integrations set a fixed pymodbus version of 3.8.3 which conflicted with my supported version range of 3.6.6-3.7.4, and only one version of pymodbus could load at a time.