That’s an interesting observation.
I haven’t seen anything in the latest Release Notes announcing an entity’s state
can now store more than 255 characters. Maybe it did but I missed it. However, it would be a significant change so I would expect it to be prominently reported.
My concern is that you may have found a bug that, although it allows storing more than 255 characters and appears to work, may cause unexpected problems in the future. (EDIT perform the test in my NOTE below).
For example, sometimes the database’s structure is modified when upgrading Home Assistant. During the conversion process, it may experience difficulties with a value that is supposed to be limited to 255 but is actually longer (or it will simply truncate it).
I think the safer method is to store the long text in a Trigger-based Template Sensor’s attributes (can store up to 16Kb). Here’s an example of how to do that:
If you implement the example, your Markdown Card can reference the stored generative_ai text like this:
- type: markdown
content: "{{ state_attr('sensor.ai_response', 'payload') }}"
NOTE
Out of curiosity, after you restart Home Assistant, does input_text.generative_ai_doorbel
still report the long text value?
I’m wondering if the long text value is simply in the state machine but not actually written to the database (or only the first 255 characters are stored). Restarting Home Assistant will reveal more clues. I’m betting the entire value isn’t actually being stored (partial or none).