Can't complete a todo item that ends with a space, when using a template

Seems like a catch 22. You need quotes to preserve the trailing whitespace, but quotes apparently aren’t stripped from template output.

Here is a thread about a similar problem, preserving leading whitespace. Seems like the consensus is that this is not possible.

As far as I can tell from the documentation, there is no other way to refer to to-do items than by their name/label, no id or index or anything. So I don’t see how the above would be possible either?

At least not through normal HASS automation actions. Maybe you can do it by executing the action some different way, like say through the REST API, command line or Python.

Edit: Seems the todo.get_items action does return a UID for each todo item. Even though the documentation makes zero mention of it, the UID can be fed into todo.update_item as its item parameter. Seems like this is the only possible workaround.