HA + MA no voice integration working, throws error

“Yes, in about a month.”

I’m having the same issue and I could not get it to work with either the HACS or the HA integrations

Now it’s working using the HACS component

I’m also trying to play tracks on my new Voice Assistant Satellite using voice and MA.

First I’ve tried it directly - to no avail.

Then at some point I moved back to the HACS integration. The best I could get with that was that it said it would now start the song, but it never actually started.

Moved back to the new integration and tried playing around with setting up an intent (my first one actually, so I barely have an idea what I’m doing here):

config/custom_sentences/de/music_assistant_PlayMediaOnMediaPlayer.yaml

Summary
language: "de"
intents:
  MusicAssistantPlayMediaOnMediaPlayer:
    data:
      # EINEN BEREICH ZIELEN
      - sentences:
          - "<abspielen> {query};im [der ]<bereich> [((mit)|(unter Verwendung von)) {radio_modus}]"
        expansion_rules:
          abspielen: "((spiel(e)?)|(höre))"

      # EINEN NAMEN ZIELEN
      - sentences:
          - "<abspielen> {query};<auf> [dem ]{name} [<wiedergabegeräte>] [((mit)|(unter Verwendung von)) {radio_modus}]"
        expansion_rules:
          abspielen: "((spiel(e)?)|(höre))"
          wiedergabegeräte: "((Lautsprecher)|([Medien-]Player))"
          "auf": "(auf|über)"
        requires_context:
          domain: "media_player"

      # EINEN BEREICH UND EINEN NAMEN ZIELEN
      - sentences:
          - "<abspielen> {query};im [der ]<bereich> <auf> [dem ]{name} [<wiedergabegeräte>] [((mit)|(unter Verwendung von)) {radio_modus}]"
        expansion_rules:
          abspielen: "((spiele)|(höre))"
          wiedergabegeräte: "((Lautsprecher)|([Medien-]Player))"
          "auf": "(auf|über)"
        requires_context:
          domain: "media_player"

lists:
  query:
    wildcard: true
  radio_modus:
    values:
      - "Radiomodus"

config/intents.yaml

Summary
intents:
    - spec:
        name: play_track_on_media_player
        description: Plays any track (name or artist of song) on a given media player
        parameters:
          type: object
          properties:
            track:
              type: string
              description: The track to play
            entity_id:
              type: string
              description: The media_player entity_id retrieved from available devices. 
                It must start with the media_player domain, followed by dot character.
          required:
          - track
          - entity_id
      function:
        type: script
        sequence:
        - service: music_assistant.play_media
          data:
            media_id: '{{track}}'
            media_type: track
          target:
            entity_id: '{{entity_id}}'

But no matter what I do, when not using the HACS version, it always tells me that the player is not in pause and can’t play anything. I assume that it is only able to pause and resume with the pre-existing intents. No idea why it is not picking up my custom intents.

I might add than when debugging the intent with the dev tools → assist, it states that it is using the intent HassTurnOn - that obviously won’t work. I’m telling it like “Spiele XY von Z” - “Play XY by Z”, which should be covered by my custom intent?

I would have assumed that this somehow works out of the box, but it does not and I’m puzzled how I can make this work. And why it seemed to have worked in the HACS integration but not in the new one?
Any help is greatly appreciated! :slight_smile:

Okay, after a lot of try and error I made some progress. This is going to be verbose, but i figured it’s better to be as detailed as possible and not just throw around some random snippets without any context.

Documentation is lacking :-/

Unfortunately the documentation of the whole Intent part is very very lacking and it is near impossible to get something working by the sparse documentation alone - without reading lots of posts and trying to make any sense out of it without actually understanding what things really do, I wouldn’t have gotten anywhere. I really wish someone who really understands the Intent pipeline would make a better documentation.


Prerequisites

So this is my starting point:

  1. Working Assist pipeline in general for built-in commands
  2. Installed Music Assistant and configured it to use my Voice PE as speaker
  3. Installed HA Music Assistant Integration (not the HACS one)
  4. Installed addon “File Editor”, so you can edit/add configuration files
  5. Just for reference, I’m a german speaker, so you might need to change “de” to your country code in folder names and scripts and update the sentences used for matching the intent

Set up intent

  1. Open up the file editor
  2. Create folder custom_sentences if it does not exist
  3. Create subfolder de within custom_sentences
  4. Create a new file to hold my intent - I used the one from the MA sample, which is: music_assistant_PlayMediaOnMediaPlayer.yaml
    The structure should then be:
    custom_sentences/de/music_assistant_PlayMediaOnMediaPlayer.yaml
  5. Add a minimal intent configuration to that file (I will extend and post the complete intent once it is working):

./custom_sentences/de/music_assistant_PlayMediaOnMediaPlayer.yaml

language: "de"
intents:
MassPlayMediaAssist:
    data:
        - sentences:
            - "<play> <track> {track}"
          expansion_rules:
              play: "((spiel)|(spiele))"
              track: "[((der)|(die)|(das)) ](track|song|lied)"

lists:
    track:
        wildcard: true

This should pick up a voice command like this (and then moves on to the intent_script below):
"Spiele Song Fly me to the moon" - "Play song Fly me to the moon"

Note: This is a very minimalistic sentence. For this post I’ve removed all the fancies that the example provided by MA has. Funny thing is, with the fancies it didn’t work at all. It was only now that I’ve stripped it down, that it, while writing this, it actually worked for the first time at all. The regular sentence was like this: "<play> <track> {track} [von <artist> {artist}] [((mit)|(im)) {radio_mode}]"

Verify if intent is picked up

If this works, you can check in the HA GUI using the dev tools and there the tab “Assist”.
If you enter into the parser “Spiele Song Fly me to the moon” it should output this:

intent:
  name: MassPlayMediaAssist
slots:
  track: Fly Me To The Moon
details:
  track:
    name: track
    value: Fly Me To The Moon
    text: Fly Me To The Moon
targets: {}
match: true
sentence_template: <play> <track> {track}
unmatched_slots: {}
source: custom
file: de/music_assistant_PlayMediaOnMediaPlayer.yaml

It is super important that match: true, otherwise, while it has applied our new intent to parse the command, it was not successful in matching one of the sentences or its parameters (don’t know exactly what it didn’t match).


Response

We need to set up a response for our intent next, which will be used to confirm our command using voice output.

  1. Open file editor
  2. Go to custom_sentences/de/
  3. Create new file responses.yaml
  4. Add the following and save file

./custom_sentences/de/response.yaml

language: "de"
responses:
   intents:
     MassPlayMediaAssist:
       default: "Okay"

This will just confirm our command with “Okay”, which probably can be improved later, if that is desired.


Intent Script

So now that we have successfully picked up the voice command, we need to add an matching intent_script to pass on the data to a service. The intent_script should have the same name as the intent, which in our case is MassPlayMediaAssist, as in our intent above.

  1. Again open up the file editor
  2. Edit the configuration.yaml file and add the following

./configuration.yaml

intent_script:
  MassPlayMediaAssist:
    action:
      - service: music_assistant.play_media
        target:
          entity_id: media_player.home_assistant_voice_091d31_media_player_2
        data:
          enqueue: replace
          media_id: "{{ track }}"
          #media_id: Punk Rock Song
          media_type: track
          radio_mode: false

Two notes here:

  • You will need to edit the entity_id and provide it the one of the speaker you wish to use. That probably can be improved later, but we need a bare minimal setup that actually works, before we can move on to more complex things.

  • There is a commented-out media_id which I’ve used to check if the playback works in general, no matter what data the intent passes on to the script. With the more complex sentences I have the issue that the track isn’t provided for some unknown reason and the intent_script throws an error with the voice saying “An unknown error has occurred”. I then used a static media_id to check if it would work if the track would be set and containing valid data. If it doesn’t, that needs to be fixed first.


Reload configurations

Now we need to apply our changes to the yaml configuration files.
I’m not sure if you need to reboot when adding new files, but maybe do that once.
Then you can usually go to the dev tools, tab “YAML” and first check the configuration in the first block and then, if all is good, reload all YAML configs in the second block. (If you know exactly which ones to reload, you can selectively reload them, but I don’t know which, so I hit “All”).


Test it!

Now test it by saying the magic words and make sure you have a matching song. *fingers crossed*


Flow overview

The process in general is somewhat like this:

  1. Speak a command
  2. Some magic happens and if things go well our intent is picked to process the command (probably by the configured sentence patterns in the intent)
  3. Our Intent picks up voice command and tries to match one of the configured sentences and extracts parts of the sentence as our data (track).
  4. Data is handed over to the intent_script along with the matched data (track)
  5. intent_script maps our data to specific arguments and calls defined service with those arguments
  6. If things go well, the response is called, which outputs a voice confirmation and then the song is played

Across the intent, intent_script and responses, our configurations are linked by it’s common name, which here in this case is MassPlayMediaAssist - but it can be pretty much anything that is not in use already.


What’s next?

This is super minimalistic, but it works and should get you started.

  • Next are improvements to the intent so that more complex patterns/sentences can actually be matched without things go boom.
  • The entity_id of the media player should be made dynamic and not static
  • The response could contain what actually is going to be played next, but that’s up to you.
  • It would be nice to have better error handling and better debugging - if anybody knows more, I’m all ears.
  • In the same sense, it would be nice to have a dedicated output in case the track could not be found, but otherwise everything else was okay.
  • I really need a way to debug an intent_script as this is what is usually going wrong - namely the slots exceptions, where I just can’t find out what exactly went wrong with it, but it indicates invalid data being passed to the intent_script or that the mapping is incorrect (like incorrect type).
  • In the intent script, how do I handle the different sentences from the intent, which provides different datasets? Right now it can only play a track and that type is hardcoded, but how do I make it more flexible to e.g. play something from an artist? (solved, see my updated snippets in the next post)

Issues

  • When the sentence matching messes up and an invalid track is being passed to the intent_script, it will throw an exception stating that track could not be resolved. But it will not be cleared from the cache, so even if the next attempt will provide a valid track, it will still try the invalid one first and again throw an exception. The only way I found to resolve that is to reboot, which is super bad. Any ideas?
    This is what I get for example:
    Logger: homeassistant.helpers.script.intent_script_massplaytrack
    Quelle: helpers/script.py:2032
    Erstmals aufgetreten: 16:35:19 (2 Vorkommnisse)
    Zuletzt protokolliert: 16:38:59
    
        Intent Script MassPlayTrack: Error executing script. Error for call_service at pos 1: Could not resolve ['Fly Me to the Moon im Radiomodus'] to playable media item
        Intent Script MassPlayTrack: Error executing script. Error for call_service at pos 1: list index out of range
    
  • We really, like really, need something to stop the music. Saying stop does nothing for me, unfortunately.

That’s it. Hope that is useful to someone and please share if you have improved on this. :slight_smile:

1 Like

FWIW here is my current setup, I’ll update it whenever I make some progress.

What is working

  • Play by track (Spiele Song Fly me to the moon) - (Play song fly me to the moon)
  • Play by artist (Spiele etwas vom Künstler Frank Sinatra) - (Play something from the artist Frank Sinatra)
  • Play by radio station (Spiele Radio WDR1) - (Play radio WDR1)

What is not

  • handling the parameter radio_mode is giving me headaches and does not work
  • the combination track + artist somehow isn’t parsed correctly, it will include artist in the track name
  • still need better error handling and feedback
  • play by playlist not implemented yet
  • play by album not implemented yet
  • playing on different media devices not implemented yet

Other

  • There is an interesting thing that when I omit “Song” from “Play song XY”, it will still play a song, but it’s always UB40 - Kingston Town for me. Not sure what’s going on here.
  • I found out stopping playback can be issued with OK Nabu stop playback, only stop does not work.
  • Again, note that I’ve used german “de” for the folder structure and german commands. Replace them with “en” and english commands (probably use the ones from MA), if you’re an english speaker.

Intent code

/homeassistant/configuration.yaml

language: "de"
intents:
  MassPlayMediaAssist:
    data:
      # CONTEXT AWARNESS
        - sentences:
            - "<play> <track> {track}[ von {artist}]"
            - "<play> <artist> {artist} [(mit|im) {radio_mode}]"
            - "<play> <radio_station> {radio}"
          expansion_rules:
              play: "(spiel|spiele)"
              artist: "[[etwas ][(von|vom) ][(der|dem)] (artist|künstler|band|gruppe)]"
              track: "[(das|den) ](track|song|lied|titel)"
              album: "[(der|die|das) ](album|ep|platte|sammlung|single)"
              playlist: "[der ]playlist"
              radio_station: "[((den)|(das)|(die)) ]((radio sender)|(radio)|(sender))"
              radio_mode: "(radiomodus|radio modus)"
lists:
  artist:
    wildcard: true
  album:
    wildcard: true
  track:
    wildcard: true
  playlist:
    wildcard: true
  radio:
    wildcard: true
  query:
    wildcard: true
  radio_mode:
    values:
      - "Radiomodus"
      - "Radio modus"
       
skip_words:
  - "bitte"
  - "kannst du"

Intent script code

/homeassistant/custom_sentences/de/music_assistant_PlayMediaOnMediaPlayer.yaml

intent_script:
  MassPlayMediaAssist:
    action:
      - choose:
          # Case 1: Only track
          - conditions:
              - condition: template
                value_template: >
                  {{ track is defined and track != '' and 
                     (artist is not defined or artist == '') }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: media_player.home_assistant_voice_091d31_media_player_2
                data:
                  enqueue: replace
                  media_id: "{{ track }}"
                  media_type: track
                  radio_mode: false # "{{ radio_mode | default(false) }}"

          # Case 2: Only artist
          - conditions:
              - condition: template
                value_template: >
                  {{ artist is defined and artist != '' and 
                     (track is not defined or track == '') }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: media_player.home_assistant_voice_091d31_media_player_2
                data:
                  enqueue: replace
                  media_id: "{{ artist }}"
                  media_type: artist
                  radio_mode: false # "{{ radio_mode | default(false) }}"

          # Case 3: Track and artist
          - conditions:
              - condition: template
                value_template: >
                  {{ track is defined and track != '' and 
                     artist is defined and artist != '' }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: media_player.home_assistant_voice_091d31_media_player_2
                data:
                  enqueue: replace
                  media_id: "{{ track }} - {{ artist }}"
                  media_type: track
                  radio_mode: false # "{{ radio_mode | default(false) }}"
                  
          # Case 4: Radio
          - conditions:
              - condition: template
                value_template: >
                  {{ radio is defined and radio != '' }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: media_player.home_assistant_voice_091d31_media_player_2
                data:
                  enqueue: replace
                  media_id: "{{ radio }}"
                  media_type: radio
                  radio_mode: false # "{{ radio_mode | default(false) }}"

Response code

/homeassistant/custom_sentences/de/responses.yaml

language: "de"
responses:
   intents:
     MassPlayMediaAssist:
       default: "Okay"
1 Like

I have the exact same issue. Installed Music Assistant via the new HA integration and the voice intents were not firing. Your addition to configuration.yaml sorted that out and provided a foothold to play around a bit more, got the entity working. This is what I have for the ‘target a name’ flow (snippets, not full files)

configuration.yaml

intent_script:
  MassPlayMediaAssist:
    action:
      - service: music_assistant.play_media
        target:
          entity_id: "{{ entity }}"
        data:
          enqueue: replace
          media_id: "{{ track }}"
          media_type: track
          radio_mode: false

custom_sentences/en/music_assistant_PlayMediaAssist.yaml

...

      # TARGET A NAME
      - sentences:
          - "<play> <artist> {artist} <on> [the ]{entity} [<player_devices>] [((with)|(using)) {radio_mode}]"
          - "<play> <album> {album} [by <artist> {artist}] <on> [the ]{entity} [<player_devices>] [((with)|(using)) {radio_mode}]"
          - "<play> <track> {track} [by <artist> {artist}] <on> [the ]{entity} [<player_devices>] [((with)|(using)) {radio_mode}]"
          - "<play> <playlist> {playlist} <on> [the ]{entity} [<player_devices>] [((with)|(using)) {radio_mode}]"
          - "<play> <radio_station> {radio} <on> [the ]{entity} [<player_devices>]"
        expansion_rules:
          play: "((play)|(listen to))"
          player_devices: "((speaker)|([media] player))"
          "on": "(on|using)"
          artist: "[the ](artist|band|group)"
          track: "[the ](track|song)"
          album: "[the ](album|ep|record|compilation|single)"
          playlist: "[the ]playlist"
          radio_station: "[the ]((radio station)|(radio)|(station))"

...

lists:
  artist:
    wildcard: true
  album:
    wildcard: true
  track:
    wildcard: true
  playlist:
    wildcard: true
  radio:
    wildcard: true
  radio_mode:
    values:
      - "radio mode"
  entity:
    values:
      - in: "kitchen speaker"
        out: "media_player.kitchen_speaker_2"
      - in: "office speaker"
        out: "media_player.office_speaker_2"
      - in: "dungeon speaker"
        out: "media_player.dungeon_speaker_2"
      - in: "living room speaker"
        out: "media_player.living_room_speaker_2"

There are similar reports on GitHub, and the reason is “Voice is not currently supported in the core integration”. However, the good news is that it seems some developers are willing to write a blueprint for this.

I guess my biggest beef is that the Music Assistant page specifically states it works and gives instructions that take you no where apparently.

But that’s Open Source for ya! lol It’ll get worked out soon I’m sure. Soon is relative of course and depends on if anybody working on Music Assistant actually uses voice to control it.

As can be read above, it does work if you add the required snippets for the intent and the intent script on your own. Reading the bug report on github it probably is already sufficient to add the intent script only, but one would have to check that.

That said, I too would prefer a implementation by MA or HA, though.

What currently does not work, or let’s say I have not found out how to do it, is to use GPT for using more relaxed commands.

Just adding my two cents to this. I spent awhile trying @morkator’s approach of defining a `MassPlayMediaAssist script in an intent_script block, but couldn’t get it to work right. I have multiple media players in Mass, so I needed the Intent to pass in the player name, and that just wasn’t working reliably (as an aside, it seems the {name} placeholder in an Intent is “special”, so I’ve got some learning to do there). I finally decided to remove the Mass Integration and install the HACS Mass integration, and that resolved everything. The “play” commands now all work as expected. I didn’t notice until afterwards that the Voice Commands documentation in the Mass docs specifically says it’ll only work with HACS

One caveat with the HACS integration is that all of the players got different entity IDs, so if you swap back and forth, you’ll have to redo your automations and such

I decided to dig into the HACS Mass integration source code to see why it works, and I can see that the HACS integration registers an Intent handler for both the MassPlayMediaAssist and the MassPlayMediaOnMediaPlayer events. The latter one is the one used with OpenAI integration to get more natural requests to work. The handler even handles the call to OpenAI itself - you just configure your OpenAI details directly in the HACS integration config.

I’ll be sticking with the HACS integration until the core integration can handle the voice intents. Implementing it with intent_scripts doesn’t seem to offer the same funtionality.

I was going to temporarily switch back to the HACS integration but it no longer seems to appear in the HACS list :frowning: and the GitHub repo has been archived.

You’re right - looks like it was archived just a few hours ago. That sucks. I checked the HASS core code and the changes weren’t integrated into HASS (yet, anyway). Perhaps it would work to add the HACS Mass integration as a Custom Repository in HACS? The URL is GitHub - music-assistant/hass-music-assistant: (deprecated) custom integration for Music Assistant. I haven’t tried - I’m not going to touch my config now that they’ve removed the integration!

Already tried that and no joy. It looks like there is a reasonable amount of activity in the core repositories however so hopefully there’s an imminent update coming.

For reference, here’s my current intent_script with player support. Note that I’ve added my Voice PE as a default, so if I just want to output on the PE, I don’t need to state on which entity to play - you might want to update that or remove it, but then you always have to state an entity to play on when asking it to play something.

intent_script:
  MassPlayMediaAssist:
    action:
      - choose:
          # Case 1: Only track
          - conditions:
              - condition: template
                value_template: >
                  {{ track is defined and track != '' and 
                     (artist is not defined or artist == '') }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: "{{ entity | default('media_player.home_assistant_voice_091d31_media_player_2')  }}"
                data:
                  enqueue: replace
                  media_id: "{{ track }}"
                  media_type: track
                  radio_mode: false # "{{ radio_mode | default(false) }}"

          # Case 2: Only artist
          - conditions:
              - condition: template
                value_template: >
                  {{ artist is defined and artist != '' and 
                     (track is not defined or track == '') }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: "{{ entity | default('media_player.home_assistant_voice_091d31_media_player_2')  }}"
                data:
                  enqueue: replace
                  media_id: "{{ artist }}"
                  media_type: artist
                  radio_mode: false # "{{ radio_mode | default(false) }}"

          # Case 3: Track and artist
          - conditions:
              - condition: template
                value_template: >
                  {{ track is defined and track != '' and 
                     artist is defined and artist != '' }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: "{{ entity | default('media_player.home_assistant_voice_091d31_media_player_2')  }}"
                data:
                  enqueue: replace
                  media_id: "{{ track }} - {{ artist }}"
                  media_type: track
                  radio_mode: false # "{{ radio_mode | default(false) }}"
                  
          # Case 4: Radio
          - conditions:
              - condition: template
                value_template: >
                  {{ radio is defined and radio != '' }}
            sequence:
              - service: music_assistant.play_media
                target:
                  entity_id: "{{ entity | default('media_player.home_assistant_voice_091d31_media_player_2')  }}"
                data:
                  enqueue: replace
                  media_id: "{{ radio }}"
                  media_type: radio
                  radio_mode: false # "{{ radio_mode | default(false) }}"

Did you have to alter the MassPlayMediaAssist block in the intent file to get entity? The intent file uses name, but if you use name in the intent_script, you get the unresolved name - i.e if an alias was used in the voice command, you don’t get the resolved entity_id back. I tried using a list in/out block to convert the player name to an entity ID, but that didn’t seem to work for name - I guess name is “special”? When I renamed it to player, that worked in the debugger, but then the intent stopped matching altogether. It was at that point that I gave up and installed the HACS integration.

Ah yes, sorry. I’ve used what @rolo did write above and added aliases to the intent file:

language: "de"
intents:
  MassPlayMediaAssist:
    data:
      # CONTEXT AWARNESS
        - sentences:
            - "<play> <radio_station> {radio} [<on> (dem|den|der) {entity}] [(im) {radio_mode}]"
            - "<play> <track> {track} [ von {artist}] [<on> (dem|den|der) {entity}] [(im) {radio_mode}]"
            - "<play> <artist> {artist} [<on> (dem|den|der) {entity}] [(im) {radio_mode}]"
          expansion_rules:
              play: "(spiel|spiele)"
              artist: "[etwas ][(von|vom) ][(der|dem)] [(artist|künstler|band|gruppe)]"
              track: "[(das|den) ](track|song|lied|titel)"
              album: "[(der|die|das) ](album|ep|platte|sammlung|single)"
              playlist: "[der ]playlist"
              radio_station: "[((den)|(das)|(die)) ]((radio sender)|(radio)|(sender))"
              radio_mode: "(radiomodus|radio modus)"
              "on": "(auf|mit)"
        # requires_context:
        #   area:
        #     slot: true

lists:
  artist:
    wildcard: true
  album:
    wildcard: true
  track:
    wildcard: true
  playlist:
    wildcard: true
  radio:
    wildcard: true
  query:
    wildcard: true
  radio_mode:
    values:
      - "Radiomodus"
      - "Radio modus"
  entity:
    values:
      - in: "voice"
        out: "media_player.home_assistant_voice_091d31_media_player_2"
      - in: "voice assistant"
        out: "media_player.home_assistant_voice_091d31_media_player_2"
      - in: "boxen"
        out: "media_player.s10_2"
      - in: "stereoanlage"
        out: "media_player.s10_2"
      - in: "surroundsystem"
        out: "media_player.s10_2"
       
skip_words:
  - "bitte"
  - "kannst du"

So I can say something like Play radio XY on surroundsystem, which will stream to my S10.

Edit: Also, feel free to post what you have and I can have a look what might be wrong. :slight_smile:

Another edit:
Since MA didn’t have an intent_script to the intent file (probably because it’s not needed in the HACS implementation), I don’t know what magic it does to resolve the {{name}} to an actual entity.
In rolo’s and my intent, we do a match in lists to match a “human readable name” like “Speakers” to an actual entity, which is then passed to the intent_script instead.

In this case the placeholder in the sentences in the intent file was changed to {{entity}}, but if you want to keep {{name}}, you can just edit the lists: and change entity: to name:. Note that if you do that, you also need to change that in the intent_script.
If “name” somehow is special, I can’t tell. But there are some specials for sure, like I noticed if you don’t escape "on" in the expansion_rules, it won’t work. *shrugs*

I think {name} must be special, because I couldn’t get it to translate using the lists method.

Here’s how I think it works: The intent engine always tries to resolve a target from the request. The target can be an entity, or an area, in which case all entities in the area are the target. If a target is identified, then the result of the intent are sent to the entity to be processed, assuming the entity has registered an intent handler. Because the entity is getting the event, it doesn’t need to know what entity was picked - it’s obviously itself. I am deducing this from the fact that when I played with Developer->Assist, it was able to resolve a target entity ID as long as I used {name} in the intent, but when I changed the variable to {player}, target was then empty and matched==false

The HACS Mass integration registers an intent handler, so as long as {name} resolves to a HACS entity, the request is handled.

When I changed {name} to {player} and put a translation in my lists block as you did, the Developer->Assist then returned the correct value in the player variable, but matched==false, so the intent_script never even got called.

I definitely have a lot to learn here - I want to get volume and source selection working too, and those currently aren’t for me, but the Play stuff is working using HACS, so I’m going to leave that alone until the developers get that support baked into the core code.

Hi @rolo , @morkator ,
would you be so kind to post your complete sentences and intent script?

Cheers, mel

@mel you can find mine in the posts above.

Intent

Post

Intent Script

Post

Response

End of this Post
Here you can also see the paths / files where I’ve put the snippets into

Cheers