#being able to list items on a todo list?
1 messages · Page 1 of 1 (latest)
I personally don't think outputting a whole list is a good idea as these can be rather large. But it's always good to propose those things so it can be debated.
Please raise an issue over at: https://github.com/home-assistant/intents
Show your code for custom intent, if you use one.
i do not use any custom intents right now
Well, getting list contents isn't built-in intent, so either you wait for it to be implemented by devs (if it is), or create custom one.
speech:
text: >
{% set entity_id = states.todo | selectattr('name', 'in', [name]) | map(attribute='entity_id') | list | first | default(None) %}
{% set tasks = state_attr(entity_id, 'unchecked_items') %}
{% if not tasks %}
There are no items in {{ name }}.
{% else %}
on the {{ name }} there is:
{% for task in tasks %}{{task}}{% if not loop.last %}
{% endif %}{% endfor %}.
{% endif %}```
intents:
listtodo:
data:
- sentences:
- "is there anything on [the] {name} [list]"
- "whats on [the] {name} [list]"
- "list [the] {name} [list]"
- "tell me whats on [the] {name} [list]"
slots:
name: "all"
domain: "todo"
put this together works alright
Is this still valid? I tried but always get same answer "There are no items in <name of the list>" even if I have items in my list.
still works for me
try copying the code into the template viewer and see if anything gets listed
Is your list exposed to assist?
Yeah check that too
I haven't checked but no items on list might be the default action if it can't find the list at all
I made some blueprints for that.
https://github.com/TheFes/ha-blueprints
AttributeError:'NoneType' object has no attribute 'lower'
which version of HA are you using? None of my todo entities have an attribute unchecked_items. The only way to access the list items is to use the todo.get_items action
That won't work as it relies on the name value from the intent
i made this to work with the anylist custom integration as thats the only todo list i use, im guessing that it may have values that dont work with the standard todo list intergration looking at the issues