#Home Assistant Assist Seems to Ignore my custom intents

1 messages · Page 1 of 1 (latest)

astral hazel
#

I created a tv.yaml responses.yaml and an intent_scripts.yaml, but the assistant seems to ignore it, doesnt run the action/service and never responds with "TEST RESPONSE" instead it just always says "sorry I cant do that"

# config/custom_sentences/en/responses.yaml
language: "en"
responses:
  intents:
    SetSource:
      default: "TEST RESPONSE"
# config/custom_sentences/en/tv.yaml
language: "en"
intents:
  SetSource:
    data:
      - sentences:
          - "(set|change) {media_player} {source|input|app} to {source}"
          - "open {source} on {media_player}"
          - "switch {media_player} to {source}"
          - "put {source} on {media_player}"
          - "launch {source} on {media_player}"
lists:
  media_player:
    values:
      - in: "big tv"
        out: "media_player.man_cave_tv"
      - in: "man cave tv"
        out: "media_player.man_cave_tv"
      - in: "basement tv"
        out: "media_player.man_cave_tv"
  source:
    values:
      # Streaming Services
      - in: "netflix"
        out: "Netflix"
      - in: "(disney plus|disney+)"
        out: "Disney+"
      - in: "(prime|amazon|prime video|amazon prime)"
        out: "Amazon Prime Video"
      - in: "youtube"
        out: "YouTube"
      - in: "(hulu|hulu plus)"
        out: "Hulu"
      - in: "(hbo|hbo max)"
        out: "HBO Max"
      - in: "peacock"
        out: "Peacock"
      - in: "(apple tv|apple tv plus|apple tv+)"
        out: "Apple TV+"
# configuration.yaml
# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
intent_script: !include intent_scripts.yaml
#

using wyoming satellite, but it also doesnt work when typed out

astral hazel
#

forgot to include the intents_scripts.yaml

SetSource:
    action:
      service: "media_player.select_source"
      data:
        entity_id: "{{ media_player }}" #the tv
        source: "{{ source }}" # the source it should be set to
    speech:
      text: "Changed {{ media_player.split('.')[1] | replace('_', ' ') }} to {{ source }}"
deep tendon
#

In your sentence you have {source|input|app}
First of all change that to parentheses from curly braces.
Then debug.

vast crystal
#

Also, just to make sure: have you reloaded the conversation integration?

lucid mantle
#

Also for media_player, you could just set that slot to <name> and set the domain of your intent to media_player, then make use of aliases on that media player device. Think that is the more proper way to do what you are trying to achieve 🙂

#

Also correct me if I am wrong @vast crystal or @deep tendon , but list values can't utilize sentence templating I assume? They have to be static values right?
So for instance he has this listed:

- in: "(disney plus|disney+)"
        out: "Disney+"

I assume this won't work, he'd need to make two entries for those in values, one for "disney plus" and one for "disney+" right?

deep tendon
lucid mantle
#

I have some scripts to make more efficient now 😄

astral hazel
#

Sory for the late response and thank you all for your input! I figured it out.

I am using the file editor add on in home assistant, my root dir is /homeasistant.
everything I saw online said I should place stuff in
config/custom_sentences/[language-code]/[name].yaml

but that wasn't being read in for me.
So I tried moving it to

custom_sentences/[language-code]/*.yaml

and that seemed to do it.

It now works as posted, but I will definitely make modifications based on your suggestions, thank you!

astral hazel
lucid mantle
#

Something like this:

language: "en"
intents:
  MediaPlayerControl_ClearPlaylist:
    data:
      - sentences:
          - "Clear playlist on <name>"
        requires_context:
          domain: "media_player"
      - sentences:
          - "Clear playlist"
        requires_context:
          area:
            slot: true
#

name can be whatever name you like to use, and it will automatically convert that to the desired media_player entity behind the scenes for you when it passes this along to the actual intent script