[SOLVED] Custom sentences produce unknown error in Assist Sentences Parser tool

I’m playing around with a few custom sentences and intents, a couple are working fine where the sentence is simple and requires no slots. But as soon as I add a variable into the sentence, the parser seems unable to deal with it. My voice satellite flashes red (unknown error) and the sentence parser tool in the “Assist” tab of the Developer tools console produces no response. Curiously, an “Unknown Error” is logged in the Javascript console when this happens.

Here’s a simple example to highlight the problem…

from config/custom_sentences/en/test.yaml

language: "en"

intents:
  TestIntent:
    data:
      - sentences:
        - "test log"

and in config/intents.yaml

TestIntent:
  action:
    service: "logbook.log"
    data:
      name: "TestIntent"
      message: "test log"
  speech:
    text: "Test logged"

As shown above, the code works fine in both the sentences parser and the voice assistant. Parser tool returns;

intent:
  name: TestIntent
slots: {}
details: {}
targets: {}
match: true
sentence_template: test log
unmatched_slots: {}
source: custom
file: en/tests.yaml

and the test log is visible in the logbook when called for real via the voice assistant.

However, if I now change the custom sentence like so;

      - sentences:
        - "test {log}"

with no other changes, the parser tool fails to produce any output at all other than the javascript error in the dev tools, and the voice assistant returns “Unexpected error during intent recognition”. I’ve tried declaring the slot in the intent with required set to either true or false and get the same result.

It feels like I’m missing something really basic here, but I’m struggling to find docs/posts that show what that is.

Thanks in advance for any help.

Further information; this is the output from the debug pipeline on the voice assistant using “Run text pipeline”. Though it doesn’t seem to offer too much insight…

init_options:
  start_stage: intent
  end_stage: intent
  input:
    text: test logging
  pipeline: 01jhmvdec9qbthds4ckxz7qs8p
  conversation_id: null
stage: done
run:
  pipeline: 01jhmvdec9qbthds4ckxz7qs8p
  language: en
  runner_data:
    stt_binary_handler_id: null
    timeout: 300
events:
  - type: run-start
    data:
      pipeline: 01jhmvdec9qbthds4ckxz7qs8p
      language: en
      runner_data:
        stt_binary_handler_id: null
        timeout: 300
    timestamp: "2025-01-28T11:02:16.468266+00:00"
  - type: intent-start
    data:
      engine: conversation.home_assistant
      language: en
      intent_input: test logging
      conversation_id: null
      device_id: null
      prefer_local_intents: true
    timestamp: "2025-01-28T11:02:16.468408+00:00"
  - type: error
    data:
      code: intent-failed
      message: Unexpected error during intent recognition
    timestamp: "2025-01-28T11:02:17.906587+00:00"
  - type: run-end
    data: null
    timestamp: "2025-01-28T11:02:17.906699+00:00"
intent:
  engine: conversation.home_assistant
  language: en
  intent_input: test logging
  conversation_id: null
  device_id: null
  prefer_local_intents: true
  done: false
error:
  code: intent-failed
  message: Unexpected error during intent recognition

Forgot to mention in the original post in case of relevance:

  • HA version 2025.1.4
  • OS version 14.2
  • Front end version 20250109.2
  • Conversation agent: Home Assistant (not improved by using ChatGPT :slight_smile: )

ok, eventually figured out the basic thing I was missing. Per Template sentence syntax | Home Assistant Developer Docs I still need to define a list for the slot even though it’s a free-form (wildcard) value…

intents:
  TestIntent:
    data:
      - sentences:
        - "test {message}"
lists:
  message:
    wildcard: true

I think the error handling here could be better :neutral_face: