For anyone else reading this…
Ensure the length of the string value being set is smaller or equal to the max length of the input_text (if set). Longer strings throw an error in the log and thus don’t change the input_text value.
If you assume we have a variable ‘message’ with a value of “Hello”.
in scripts.yaml:
This calls the script tw_announce passing the variable ‘message’
- service: script.turn_on
entity_id: script.tw_announce
data_template:
variables:
message: 'Target temperature now set to {{ states.climate.living_room.attributes.temperature }},'
Working perfectly fine here. Are you sure the entity isn’t changing the value to nothing? Don’t look at the entity on your overview page as that can be affected by caching. Look at it in the developer tools → states page.
I’m seeing this too - I reported it on the release blog, but no-one seemed to pick up on it, or be seeing it.
As I said there, nothing in the logs, no change in the state in the Developer Tools → States page. Can still set the empty value via the frontend, just not via a service call.
As a workaround, to empty an input text, I now set the value to a single space " ", and return the value in scripts and automations with the jinja trim filter, which makes it at an empty string if it is only a single space.
Yep, and via a script too. Believe me, I spent quite some time testing it from all angles, but haven’t posted a GitHub issue, as it seemed I was the only one.