Hi everyone,
I’m trying to clarify the correct / supported way to store a dynamic text response coming from an automation, and I’d like to confirm whether my understanding is correct.
Context:
Home Assistant OS (latest stable)
An automation calls an external REST API (works, response received and visible in automation traces).
The automation then calls a python_script and passes the response text as a variable (reply).
The python script runs without errors and logs confirm it receives the full text correctly.
What I tried:
Updating a sensor defined via template: (state or attributes) from the python script (using hass.states.set()).
The script executes, but the sensor never updates and no error is logged.
My understanding so far:
python_script is not allowed to create or modify sensor entities, even if no explicit error is raised.
Template sensors are read-only and derived from templates, not meant to store arbitrary data.
Follow-up question:
Is the officially recommended approach to use a helper entity such as input_text to store this kind of dynamic text?
If so, how should longer texts be handled, since input_text has a character limit (255 by default, configurable but still limited)?
In my use case, the text can easily exceed 500–1000 characters (LLM-generated advice), so I want to make sure I’m using a supported pattern and not fighting the system.
Thanks a lot for your guidance!