ha-jokes icon indicating copy to clipboard operation
ha-jokes copied to clipboard

HA doesn't accept more than 255 chars

Open michaelsidenius opened this issue 2 years ago • 4 comments

homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.random_joke. State max length is 255 characters.

michaelsidenius avatar Mar 12 '23 20:03 michaelsidenius

State attributes are able to store more than 255 characters

CarlBird avatar Dec 24 '23 18:12 CarlBird

The issue is not resolved. i downloaded the latest version but i still get the issues

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1227
First occurred: 28 March 2025 at 18:41:24 (22 occurrences)
Last logged: 14:16:05

Failed to set state for sensor.random_joke, fall back to unknown
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1227, in _async_write_ha_state
    hass.states.async_set_internal(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        entity_id,
        ^^^^^^^^^^
    ...<5 lines>...
        time_now,
        ^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2363, in async_set_internal
    state = State(
        entity_id,
    ...<8 lines>...
        timestamp,
    )
  File "/usr/src/homeassistant/homeassistant/core.py", line 1807, in __init__
    validate_state(state)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 237, in validate_state
    raise InvalidStateError(
    ...<2 lines>...
    )
homeassistant.exceptions.InvalidStateError: Invalid state with length 258. State max length is 255 characters.

dgcpiet avatar Apr 01 '25 12:04 dgcpiet