Issue with lists

I’m using the assistant with the integration of OpenAI as the conversation agent.
Here’s a strange phenomenon (I’ve given access to all the entities in a full control mode).

If I ask - “What entity in home assistant do you look at when accessing the shopping list?” – the response is To access the shopping list in Home Assistant, you can look at the entity named “Anylist Shopping List.”
This is correct.

If I say - “Can you add cucumbers to the shopping list?”, the response is “I’ve added cucumbers to the shopping list. :cucumber:” with an added cucumber emoji which is amazing. And cucumbers are added to the shopping list. This is fine.

Then I say - “Can you remove the cucumbers from the shopping list?”, I get the response - “I have removed the cucumbers from the shopping list.” However this is not actually happening. The cucumbers are still on the list.

If I also say - “What’s in my shopping list?” , I get an error “I encountered an error while trying to retrieve the items on your shopping list. You may want to check the logs for more details.”

So it appears I can add items to a list (I tried different lists as well, it’s not specific to this one), but I can’t remove items, can’t ask how many items are in that list and can’t have a list of the items in that list.

I’m encountering the exact same issue…

I’ve wasted soooo much time on this. I finally got it working using custom intents.

This setup should support reading the task list and marking items as completed. Its def possible to add even more functionality if desired. Also for your specific assistant, you might need to edit the description. I had to play around with a few different prompts for this as the ai would hallucinate and leave the slots(variables) empty.

Inside the CONFIG folder create a new file called intents.yaml and paste the following

GetItemsFromTodoList:
  description: "Returns items that the user has not yet completed on their todo/tasks list. Before running make sure the user has specified the list they would like to retrieve. You must fill the name slot {'name': 'name of a todo entity'}. If you do not fill this slot the intent will fail to run."
  action:
    - action: todo.get_items
      metadata: {}
      data:
        status: needs_action
      target:
        entity_id: "{{ states.todo | selectattr('name', 'in', name) | map(attribute='entity_id') | list | first | default }}"
      response_variable: result # get action response
    - stop: ""
      response_variable: result # and return it
  speech:
    text: "Remaining Tasks: {{ action_response[states.todo | selectattr('name', 'in', name) | map(attribute='entity_id') | list | first | default]['items'] | map(attribute='summary') | list | join(', ') }}"

CompleteItemOnTodoList:
  description: "Marks and item on todo/tasks list as completed. A list of all tasks must be fetched before your allowed to mark any off, do this by runing the GetItemsFromTodoList itent. You must fill the following slots {'name': 'name of todo entity', 'item': 'name of item on list'}. If you do not fill this slot the intent will fail to run."
  action:
    - action: todo.update_item
      metadata: {}
      data:
        item: "{{item}}"
        status: completed
      target:
        entity_id: "{{ states.todo | selectattr('name', 'in', name) | map(attribute='entity_id') | list | first | default }}"
  speech:
    text: "marked as completed"

Then inside configuration.yaml paste the following…

intent:
intent_script: !include intents.yaml
2 Likes