#custom sentence to add items to a predefined list

1 messages · Page 1 of 1 (latest)

lost scarab
#

Can I create a custom sentence to add items to a specific list without having to say the name of that list? I'm using OurGroceries and would like to override the default "add to shopping list" sentence.

This is what I have now but I get the error:

File "/usr/local/lib/python3.12/site-packages/hassil/recognize.py", line 1107, in match_expression
raise MissingListError(f"Missing slot list {{{list_ref.list_name}}}")
hassil.recognize.MissingListError: Missing slot list {item}

EDIT: did it with an automation:

alias: Lisää ostoslistalle
description: Automation to add items to a predetermined todo-list.
triggers:
  - command:
      - lisää {item} ostoslistalle
      - lisää {item} kauppalistalle
      - kaupasta {item}
    trigger: conversation
conditions: []
actions:
  - action: todo.add_item
    metadata: {}
    data:
      item: "{{ trigger.slots.item }}"
    target:
      entity_id: todo.shopping_list
  - set_conversation_response: "{{ trigger.slots.item }} lisätty."
mode: single
sinful herald
lost scarab
sinful herald
#

Yeah I'm saying the above is the general sentence template, you could use that as a starting point 🙂

#

But in your first sentence you mention using a grocery list, that's why i put that intent

lost scarab
#

Yeah, OurGroceries is shown as a ToDo-list in Hass, not as a shopping list, that's why I try to use HassTodoListAddItem instead of HassShoppingListAddItem, but it also requires a list to be named in the sentence - I'm trying to hardcode it somehow. It already works if I say like "add x to my list shopping list" but it's cumbersome and I'd like to replace it to "add x to my shopping list" or even simpler just "add x"

sinful herald
#

Item is an expansion not a slot in their example

#

Cloud also be a feature request for ha to have a default shopping list for these voice commands 🙂

lost scarab
#

I'll see if i can get it somehow. I just forgot the whole intents.yaml and was focusing only on the sentences part...