Text helper limit to 255 characters ? I was able to bug it

I failed to reproduce the glitch.

It is possible to set a wrong length:

But when trying to paste a long text like
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
into a field, the entity becomes “unknown”.
Same with calling a service.
Although we can see a nice green “success” button:


the value is not set & there is an error in Log:

2025-03-07 18:44:03.717 ERROR (MainThread) [homeassistant.helpers.entity] Failed to set state for input_text.xxxxxx, 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 445. State max length is 255 characters.

Anyway, a possibility to define a wrong length seems to be a bug - so here is the issue:

2 Likes