Error on running script

Hi All,

I’m not sure if my scream for help is in the correct category, if not, please move it of let me know :slight_smile:

I have currently no issues in the functionality.
However, I see a looooot of errors regarding a plugin and I am not sure where to look for it… is it the integration or a issue with HA…

From my knowledge so far it seems that a entry has to be written to the entity, but the value is not correct.

From the entries it looks like the solaredge modbus is providing values, HA cannot write into the entity.

Who can push me in the right way to find out what is really happening?



Logger: homeassistant
Source: core.py:1266
First occurred: 12 augustus 2023 om 13:57:37 (2309 occurrences)
Last logged: 09:12:10
Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/config/custom_components/solaredge_modbus/__init__.py", line 223, in async_refresh_modbus_data
    update_callback()
  File "/config/custom_components/solaredge_modbus/sensor.py", line 160, in _modbus_data_updated
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 865, in _async_write_ha_state
    hass.states.async_set(entity_id, state, attr, self.force_update, self._context)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1650, in async_set
    state = State(
            ^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1266, in __init__
    raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.zonnepanelen_tcp_m1_import_varh_q3. State max length is 255 characters.


You are attempting to set the value of this sensor: sensor.zonnepanelen_tcp_m1_import_varh_q3 to something that exceeds 255 characters in length.

Sensor state values have a maximum length of 255 characters.

Sensor attribute values have a much larger limit (~60k chars I think).

Well, I’m not trying to set anything :wink:

This is related to the solaredge system. So basically the integration is providing wrong values for this entity and have to create a issue at github for this.

Yes that would be appropriate.

This seems to be a misconfiguration.

Probably I’ve selected a extra meter, which does not apply to me.
re-configured the integrateion without the additional meter and problem is gone :slight_smile: