Custom intents not being matched by Assist

I’ve been trying to get my first custom intent working, but my HA does not seem to be picking it up from my configuration.

I have the following intent defined in /config/custom_sentences/en/media.yml
Note that I had to create the custom_sentences folder manually

language: "en"
intents:
  PlayPlaylist:
    data:
      - sentences:
          - "play {playlist_name} (on|in) {media_player}"
lists:
  playlist_name:
    values:
      - in: "Rock"
        out: "Recent Rock"
  media_player:
    values:
      - in: "Kitchen"
        out: "media_player.sonos_kitchen"

and the following intent script in my configuration.yml

intent_script:
  PlayPlaylist:
    action:
      service: media_player.play_media
      data:
        media_content_type: playlist
        media_content_id: "plex://{ \"playlist_name\": \"Recent Rock\" }"
      target:
        entity_id: media_player.sonos_kitchen

For troubleshooting purposes, I’ve removed the tokens/variables from the action (I was getting an error when attempting to load the config because {{ media_player }} was resolving to ‘None’)

It appears that assist is not even picking up this intent, even if I simplify the sentence to a static string like “Play it on sonos”, Assist always returns with “Sorry, I couldn’t understand that”

I am using text-based input at the moment, no voice commands are involved.

Troubleshooting steps I’ve tried:

  • Assist is able to complete basic built-in tasks like “Turn on Office”
  • I was able to add an Automation using the UI with a Sentence Trigger which could be successfully invoked by Assist.
  • As previously mentioned, I attempted to remove as much complexity as possible from the intent sentences, but that did not seem to help.

I’ve been digging through the docs to try and figure out what I’m doing wrong, but can’t seem to figure this out.

Came back after a break and realized my file was named media.yml instead of .yAml :expressionless:

Intent is being recognized now

1 Like