solaredge-modbus-multi: Unable to set Site Limit with 2.4.7-pre - Type Error

Describe the bug

https://community.home-assistant.io/t/solaredge-modbus-configuration-for-single-inverter-and-battery/464084/509?u=markpurcell

With version 2.4.7-pre, I am unable to set the Site Limit entity.

image

Expected behavior

With version 2.4.6 and earlier I can set the Site Limit entity.

Screenshots

image

image

Diagnostic File

config_entry-solaredge_modbus_multi-0e4f1fd185e47f73b9a07d4577da5b46.json (1).txt

Debug logs

2023-10-30 10:31:55.112 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 233, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 389, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 172, in async_update_listeners
    update_callback()
  File "/config/custom_components/solaredge_modbus_multi/number.py", line 101, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 783, in _async_generate_attributes
    available = self.available  # only call self.available once per update cycle
                ^^^^^^^^^^^^^^
  File "/config/custom_components/solaredge_modbus_multi/number.py", line 534, in available
    or self._platform.decoded_model["I_Power_Limit"] > 100
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'str' and 'int'

Home Assistant Version

2023.11.0b2

solaredge-modbus-multi Version

2.4.7-pre

Installation Type

Supervised

Read the Instructions

Additional Context

I use site limit control daily to manage negative prices and it is a great feature:

When I have a negative feed in price, I set Export Control mode and site limit to 0W, which prevents my system from exporting power to the grid, but it varies solar production to cover my household load.

When I have a negative general price, I set Production Control mode and site limit to 0W, which switches off all solar production and my house load runs 100% from the grid.

image

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 23 (14 by maintainers)

Most upvoted comments

Oops I meant TypeError, adding in PR #468 and will make new pre release as soon as checks are done.

Looks like just a typing mismatch, I’ll review everything to make sure data types are consistent.