I am wondering if anyone has some Ideas or expertise to create an automation to export a to-do list?
My thoughts are
Get the list items with the todo.get_items service
Use the result of this service to export the items with a notify service.
I have successfully created a notify service that creates a File using the file notify function. File - Home Assistant
I am just unaware on how to get the items to populate the file.
I assume I should be able to do this with a response variable but I am not sure how this works.
Any help would be greatly appreciated.
I had used something similar in the past, so not sure if it’s fully up to latest format, but it may help you…
Here is the notify service defined in yaml:
You would need to adjust with your variables of course.
The file will end up in your config folder.
I think the above appends data, so doesn’t erase previous data, but please check as it has been a long while since I’ve used it.
edit: forgot to mention … the variables part - yes, use response variables…
This is definitely on the same path as I am investigating. I have the notify portion working, do you have more of an example of getting the response variable the_list to “seed” the notify service?
action:
service: notify.list_file_notify
data_template:
message: |-
{%- for item in the_list['todo.hass_ideas']['items'] %}
{{ item.summary }}
{%- endfor %}
Edit: this last part came from another post, so edit your todo. … part as needed.
Here is a link to that post - may be more helpful Help, how to use: todo.get_items