Conversation not working with Voice Assistant

I have a folder named custom_sentences/en with 3 yaml files in it. I have another folder named conversations with matching files in it. The most recent specifically is a file name test.yaml. And I have a Home Assistant Voice Preview Edition, configured to use a Assist Pipeline named MyAssistant.

The file custom_sentences/en/test,yaml:

language: "en"
intents:
  test_command:
    data:
      - sentences:
          - "test command"
          - "do a test"

The file conversations/test.yaml:

intent_script:
  test_command:
    speech:
      text: "Test command received!"
    action:
      - service: notify.persistent_notification
        data:
          message: "The test command was triggered."

In my configuration.yaml file I have this:

conversation:

intent_script: !include_dir_merge_named conservations

If I try to open assist and type in test command, I get:

How can I assist?

test command

Unknown intent test_command

If I try to use “Hey Jarvis . . . . test command” the blue LED spins a moment and then nothing else.

I am stumped. I cannot figure out why this part of my HA is not working. All help appreciated.

Mike

Show the voice debug log for the call. You get there under settings> Voice Assistants.

Select the vertical three dot menu next to your conversation agent to debug that pipe

Then you can look through your conversation attempts to see what’s going on.

That said did you have a split config before you started.

If this is your first attempt at voice I strongly urge you to not split the intent and sentence trigger config off until you know it works.

Honestly right now I do t know if. You’re fighting a voice config issue, a split config issue or your script

Nathan, thanks for the suggestion. Right after I posted, I supected there might be an issue with the conversation portion. So I uninstalled integration Open AI Conversation, restarted, reinstalled it, and reinstarted it again. The error changed to “Error talking to OpenAI”. I tried both voice run and text run in the debug, same error. Here is th eouput code for the text command attempt:

init_options:
  start_stage: intent
  end_stage: intent
  input:
    text: test command
  pipeline: 01jbpkrhtkyshb9han0283nzde
  conversation_id: null
stage: done
run:
  pipeline: 01jbpkrhtkyshb9han0283nzde
  language: en
  conversation_id: 01JR3AK3QBMQJ24MS4ZQN8TEXN
  runner_data:
    stt_binary_handler_id: null
    timeout: 300
events:
  - type: run-start
    data:
      pipeline: 01jbpkrhtkyshb9han0283nzde
      language: en
      conversation_id: 01JR3AK3QBMQJ24MS4ZQN8TEXN
      runner_data:
        stt_binary_handler_id: null
        timeout: 300
    timestamp: "2025-04-05T15:54:57.643229+00:00"
  - type: intent-start
    data:
      engine: conversation.chatgpt
      language: en
      intent_input: test command
      conversation_id: 01JR3AK3QBMQJ24MS4ZQN8TEXN
      device_id: null
      prefer_local_intents: false
    timestamp: "2025-04-05T15:54:57.643261+00:00"
  - type: intent-end
    data:
      processed_locally: false
      intent_output:
        response:
          speech:
            plain:
              speech: Error talking to OpenAI
              extra_data: null
          card: {}
          language: en
          response_type: error
          data:
            code: unknown
        conversation_id: 01JR3AK3QBMQJ24MS4ZQN8TEXN
        continue_conversation: false
    timestamp: "2025-04-05T15:54:58.047510+00:00"
  - type: run-end
    data: null
    timestamp: "2025-04-05T15:54:58.047563+00:00"
intent:
  engine: conversation.chatgpt
  language: en
  intent_input: test command
  conversation_id: 01JR3AK3QBMQJ24MS4ZQN8TEXN
  device_id: null
  prefer_local_intents: false
  done: true
  processed_locally: false
  intent_output:
    response:
      speech:
        plain:
          speech: Error talking to OpenAI
          extra_data: null
      card: {}
      language: en
      response_type: error
      data:
        code: unknown
    conversation_id: 01JR3AK3QBMQJ24MS4ZQN8TEXN
    continue_conversation: false

Error talking to openai is the generic openai error. Means it isn’t even making it that far.

This happens if the oai integration can’t understand your prompt or intent scripts.

(busted prompt - look for non JSON safe characters… busted intent script, I just kill em all and add them back one at a time untyi find the broken one then debug that. )

Read: the error isn’t your script. It’s either your intent or prompt with that error.

Honestly to get back from where you are… Collapse or eliminate the sentences and the intent scripts (I’d be going back to basic eliminate them entirely start over. It’s hard to debug this one trust me, it’s actually one of the hardest, you’re almost flying blind. ) and go back to something like having it set a text field.

When you eliminate them and can successfully get a basic prompt to fire through open AI again then you can move on to next.

When you get there I recommend using a script rather than an intent script for your first. They’re WAY less complicated to setup and easier to debug through traces.

Nathan, thanks for your help. I did what you suggested and put everything in configuration.yaml, And I had to edit out some of my code lines to get it to work. It went from this:

conversation:
  language: "en"
  intents:
    test_intent_config:
      data:
        - sentences:
            - "test config intent"

intent_script:
  test_intent_config:
    speech:
      text: "Intent script configured!"
    action:
      - service: notify.persistent_notification
        data:
          message: "Test intent script was triggered."

to this:

conversation:
  intents:
    test_command:
      - "test command"
      - "do a test"

intent_script:
  test_command:
    speech:
      text: "Test command received!"
    action:
      - service: notify.persistent_notification
        data:
          message: "The test command was triggered."

just to get the file to pass the configuration checker. And then I had to switch the conversation agent from ChatGPT to Home Assistant. And once I did that it now works as it is supposed to.

Why doesn’t it work with ChatGPT?

So now I need some help. I want to split it out like I had it - reason being I would like to have multiple conversation files and matching intent files. I want a pair for device control commands, another for general conversation (briefings on status of things, like at bedtime I want to know status of doors, outdoor lights,alrm setting, etc,), another for prayers and blessings, etc.

So what is the process for doing that? What is in the configuration.yaml file? What is the “header” line(s) for the conversation files and do the files go in custom_sentences/en? And what about intent_script files? Header?

Thanks again for your assistance,
Mike

1 Like

No worries Mike.

Now that it works its easy. You were close.

I also split my intent scripts out.

The biggest thing to remember when splitting up earlier… Where you had Intent_script: then the include?

That Intent_script: IS the key header.

Meaning only the contents that would be under that key go i the files the include refers to… So you leave the Intent_script entry. Scoop out all of its contents dump it ina file then replace what you yoinked out with that include.

I usually do one file at this point to make everything easy.

The once thats working you can change the include statement to grab all files in that folder then start duping that file and chopping it into pieces.

Remember what I said about Intent_script being a b** to troubleshoot? This is EXACTLY why.

When you suspect one is the issue you can just move it out now.

Any idea why the ChatGPT conversation agent is not working before I start moving things?

Never mind _ I figured it out. I needed to turn on “Prefer handling commands locally”

Not quite sure what you mean here.

Whats not working. (and yes we fix this before splitting anything, like I said intent scripts are tied up with the conversation agent and one absolutely can break the other. So if it’s not working you’re jot fixed yet)

Never mind _ I figured it out. I needed to turn on “Prefer handling commands locally”in order to get the ChatGPT conversation agent to work.

1 Like

Make a preflight checklist. It gets weird.

Just wait until you get into multi agents and MCP and…:sunglasses:

Split slowly. One step at a time. You’ll be fine.

Then go read Friday’s Party. It’ll help you understand how. I decide is this an Intent Script or something else. (in most cases something else and an early warning on tool sprawl - you understand after reading Friday)

Wow, my first thought was “What is he talking about and what is Friday’s Party?” But a quick google search found it. I just started and noticed one thing that I wanted to give back a quick comment. I have already set up and have running locally my own AI. It is in its infancy, but it works. And it is VERY resource intensive.

2 Likes

I’m going to have two servers; one with smaller models, most likely Qwen 2.5 7b, the other with more resource intensive models around 70b or so.

1 Like

Heh exactly.

You need a dual 4070 to get the same perf you get from an OAI foundation model…

Stout gear.

Matthew is doing basically the same thing I am

Good enough for the local workhorse loads then a hero model in front

And yeah I try not to spam others threads to. My posts but feel free.

Just this week I fact I think we learned we don’t need the custom slot file anymore. It was absolutely necessary in January but now? Eh.

Share what you learn. I’m trying to document the walls so we know what this thing looks like from the inside.

I am a very senior guy with a lot of life behind me and a fixed budget ahead. So my hardware is much more modest - I just want to play and learn. I found this used on ebay: Dell OptiPlex 7050 MT Intel i7-7700 16GB. I added two used Dell Nvidia Quadro M2000 4GB GDDR5 Display Port x4 Graphics Cards, and upgrade the RAM to 64GB. It works reasonably well.

I am about half way through scannng your article and OMG, I am nowhere close to your skill level. If I live long enough maybe i can get part way there! For right now, I just want to be able to ask my AI a question and get an answer. BTW, mine is Jarvis - probably a reason why he is mine and yours is Friday!!

1 Like

Yeah im pushing to the absolute extreme of what’s possible for a reason. I know most won’t do what I’m doing. But you can absolutely use the principles in your build. Just keep remembering

Whats my Context
What state data do I have
What possible actions could I do.

If you’ve explained that well enough to the llm you’re gold. Everything else is infrastructure issues.

Good luck! Welcome. To the party.

OK, before you go to your busy life. I am unclear what your next step means. I tried to split it out, and here is what I have - which doesn’t work.

configuration.yamL:

conversation:

intent_script: !include_dir_merge_named conservations

next, in conversations/test.yaml:

test_command:
  speech:
    text: "Test command received!"
  action:
    - service: notify.persistent_notification
      data:
        message: "The test command was triggered."

and in custom_sentences/en/test.yaml:

test_command:
  data:
    - sentences:
        - "test command"
        - "do a test"

I thing I misunderstood what you were teling me to do? I thought if I left intent_script: !include . . . . in the configuration.yaml file, then it shouldn’t also be in the test.yaml file? Anway, I have something wrong.

Here:

intent_script: !include_dir_merge_named intent_script/

Says… Load all those files under this header.

This is the very first entry of intent_script.yaml:
(Notice what’s NOT in this file)

input_text_set_value:
  description: >
    "Set an 'entity_id' from the input_text domain to a specific 'VALUE'.
        example: >
      ```json
        {
        'name': 'input_text.ai_system_shared_temp_register',
        'value': "{'coop':{'chickens':3}}"
        }
      ```"
  parameters:
    name: # name, required: the name of the input_text entity to set
    value: # value (text), required: the text to set (string, up to 255 characters, will truncate overflow)
  action:
    service: "input_text.set_value"
    data:
      entity_id: >
        {%- set dot = name.find('.') -%}
        {%- if dot == -1 -%}
          {%- set entity_id = 'input_text.'+ slugify( name | replace(':','') ) -%}
        {%- else -%}
            {%- if name[0:11] == 'input_text.' -%}
              {%- set entity_id = name -%}
            {%- else -%}
              {%- set entity_id = '' -%}
            {%- endif -%}
        {%- endif -%}
        {{- entity_id -}}
      value: >
        {%- set value = value[0:255] | trim() -%}
        {{- value -}}
  speech:
    text: "{{ name }} set to {{ value[0:255] | trim() }}"

Lets start there - can you get that to work.

Very frustrating.

configuration.yaml:

conversation:

intent_script: !include_dir_merge_named intent_script/

intent_script/test.yaml:

test_command:
  speech:
    text: "Test command received!"
  action:
    - service: notify.persistent_notification
      data:
        message: "The test command was triggered."

/custom_sentences/en/test.yaml:

test_command:
  data:
    - sentences:
        - "test command"
        - "do a test"

Result from audio command run:

stage: done
run:
  pipeline: 01jbpkrhtkyshb9han0283nzde
  language: en
  conversation_id: 01JR3K6HJMT4XKPT3FM13KCS3K
  tts_output:
    token: prbSMB4020PWAwVbyIj1Ug.flac
    url: /api/tts_proxy/prbSMB4020PWAwVbyIj1Ug.flac
    mime_type: audio/flac
events:
  - type: run-start
    data:
      pipeline: 01jbpkrhtkyshb9han0283nzde
      language: en
      conversation_id: 01JR3K6HJMT4XKPT3FM13KCS3K
      tts_output:
        token: prbSMB4020PWAwVbyIj1Ug.flac
        url: /api/tts_proxy/prbSMB4020PWAwVbyIj1Ug.flac
        mime_type: audio/flac
    timestamp: "2025-04-05T18:25:23.029070+00:00"
  - type: stt-start
    data:
      engine: stt.faster_whisper
      metadata:
        language: en
        format: wav
        codec: pcm
        bit_rate: 16
        sample_rate: 16000
        channel: 1
    timestamp: "2025-04-05T18:25:23.029444+00:00"
  - type: stt-vad-start
    data:
      timestamp: 1290
    timestamp: "2025-04-05T18:25:24.283274+00:00"
  - type: stt-vad-end
    data:
      timestamp: 2700
    timestamp: "2025-04-05T18:25:25.696091+00:00"
  - type: stt-end
    data:
      stt_output:
        text: " Test command"
    timestamp: "2025-04-05T18:25:43.363976+00:00"
  - type: intent-start
    data:
      engine: conversation.home_assistant
      language: en
      intent_input: " Test command"
      conversation_id: 01JR3K6HJMT4XKPT3FM13KCS3K
      device_id: 2b12a0b0e336c3580af41e814034bcc9
      prefer_local_intents: true
    timestamp: "2025-04-05T18:25:43.364231+00:00"
  - type: intent-end
    data:
      processed_locally: true
      intent_output:
        response:
          speech:
            plain:
              speech: Sorry, I couldn't understand that
              extra_data: null
          card: {}
          language: en
          response_type: error
          data:
            code: no_intent_match
        conversation_id: 01JR3K6HJMT4XKPT3FM13KCS3K
        continue_conversation: false
    timestamp: "2025-04-05T18:25:43.531143+00:00"
  - type: tts-start
    data:
      engine: amazon_polly
      language: en-GB
      voice: null
      tts_input: Sorry, I couldn't understand that
    timestamp: "2025-04-05T18:25:43.531331+00:00"
  - type: tts-end
    data:
      tts_output:
        media_id: >-
          media-source://tts/amazon_polly?message=Sorry,+I+couldn't+understand+that&language=en-GB&tts_options=%7B%22voice%22:%22Brian%22,%22engine%22:%22neural%22,%22preferred_format%22:%22flac%22,%22preferred_sample_rate%22:48000,%22preferred_sample_channels%22:1,%22preferred_sample_bytes%22:2%7D
        token: prbSMB4020PWAwVbyIj1Ug.flac
        url: /api/tts_proxy/prbSMB4020PWAwVbyIj1Ug.flac
        mime_type: audio/flac
    timestamp: "2025-04-05T18:25:43.532403+00:00"
  - type: run-end
    data: null
    timestamp: "2025-04-05T18:25:43.539213+00:00"
stt:
  engine: stt.faster_whisper
  metadata:
    language: en
    format: wav
    codec: pcm
    bit_rate: 16
    sample_rate: 16000
    channel: 1
  done: true
  stt_output:
    text: " Test command"
intent:
  engine: conversation.home_assistant
  language: en
  intent_input: " Test command"
  conversation_id: 01JR3K6HJMT4XKPT3FM13KCS3K
  device_id: 2b12a0b0e336c3580af41e814034bcc9
  prefer_local_intents: true
  done: true
  processed_locally: true
  intent_output:
    response:
      speech:
        plain:
          speech: Sorry, I couldn't understand that
          extra_data: null
      card: {}
      language: en
      response_type: error
      data:
        code: no_intent_match
    conversation_id: 01JR3K6HJMT4XKPT3FM13KCS3K
    continue_conversation: false
tts:
  engine: amazon_polly
  language: en-GB
  voice: null
  tts_input: Sorry, I couldn't understand that
  done: true
  tts_output:
    media_id: >-
      media-source://tts/amazon_polly?message=Sorry,+I+couldn't+understand+that&language=en-GB&tts_options=%7B%22voice%22:%22Brian%22,%22engine%22:%22neural%22,%22preferred_format%22:%22flac%22,%22preferred_sample_rate%22:48000,%22preferred_sample_channels%22:1,%22preferred_sample_bytes%22:2%7D
    token: prbSMB4020PWAwVbyIj1Ug.flac
    url: /api/tts_proxy/prbSMB4020PWAwVbyIj1Ug.flac
    mime_type: audio/flac

test from text command run:

init_options:
  start_stage: intent
  end_stage: intent
  input:
    text: test command
  pipeline: 01jbpkrhtkyshb9han0283nzde
  conversation_id: null
stage: done
run:
  pipeline: 01jbpkrhtkyshb9han0283nzde
  language: en
  conversation_id: 01JR3KHFH7NJYJ7HADTX6BQFXW
  runner_data:
    stt_binary_handler_id: null
    timeout: 300
events:
  - type: run-start
    data:
      pipeline: 01jbpkrhtkyshb9han0283nzde
      language: en
      conversation_id: 01JR3KHFH7NJYJ7HADTX6BQFXW
      runner_data:
        stt_binary_handler_id: null
        timeout: 300
    timestamp: "2025-04-05T18:31:21.383950+00:00"
  - type: intent-start
    data:
      engine: conversation.home_assistant
      language: en
      intent_input: test command
      conversation_id: 01JR3KHFH7NJYJ7HADTX6BQFXW
      device_id: null
      prefer_local_intents: true
    timestamp: "2025-04-05T18:31:21.384038+00:00"
  - type: intent-end
    data:
      processed_locally: true
      intent_output:
        response:
          speech:
            plain:
              speech: Sorry, I couldn't understand that
              extra_data: null
          card: {}
          language: en
          response_type: error
          data:
            code: no_intent_match
        conversation_id: 01JR3KHFH7NJYJ7HADTX6BQFXW
        continue_conversation: false
    timestamp: "2025-04-05T18:31:21.386560+00:00"
  - type: run-end
    data: null
    timestamp: "2025-04-05T18:31:21.386613+00:00"
intent:
  engine: conversation.home_assistant
  language: en
  intent_input: test command
  conversation_id: 01JR3KHFH7NJYJ7HADTX6BQFXW
  device_id: null
  prefer_local_intents: true
  done: true
  processed_locally: true
  intent_output:
    response:
      speech:
        plain:
          speech: Sorry, I couldn't understand that
          extra_data: null
      card: {}
      language: en
      response_type: error
      data:
        code: no_intent_match
    conversation_id: 01JR3KHFH7NJYJ7HADTX6BQFXW
    continue_conversation: false
1 Like

Reading. But it didn’t explode?

Right. There was no notification that resulted.

It worked fine (i.e., I got notifications both texting “test commnd” and voice "test command’) - when all of the code was in configuration.yaml. But as soon as I split it out, I got no notification either way.

1 Like