Hi there,
There is something I do not understand. I have an automation that works perfectly to let squeezebox play my music according to a desired artist:
- id: '1710485725402'
alias: Sprach Musik Artist
description: ''
trigger:
- platform: conversation
command:
- Play songs from {artist}
condition: []
action:
- service: squeezebox.call_method
metadata: {}
data:
command: playlist
parameters:
- loadalbum
- ''
- '{{trigger.slots.artist}}'
- ''
target:
entity_id: media_player.whutzi
- service: media_player.media_play
metadata: {}
data: {}
target:
entity_id: media_player.whutzi
mode: single
… but to be able to map the voice recognition to certain values that actually exist as artists in my music collection (the voice recognition is not so exact due to different languages of the artists) I try the following in a custom_sentences/de/MyMusic.yaml. (I use this list-mapping also for TV channels where it works):
intents:
artists:
data:
- sentences:
- "Spielemusik von {artists}"
- "Spiele etwas von {artists}"
lists:
artists:
values:
- in: "(Hubert von Geusern | Hubert von Goisern | Goisern | Geuzen)"
out: "Hubert von Goisern"
- in: "Falko"
out: "Falco"
In the configuration.yaml I use the following intent_script (the first part only if squeezbox is turned off, so the -else- part is interesting :
artists:
action:
- if:
- condition: state
entity_id: media_player.whutzi
state: unavailable
then:
- service: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.musi_an
- wait_for_trigger:
- platform: state
entity_id:
- media_player.whutzi
to: 'on'
timeout:
hours: 0
minutes: 1
seconds: 45
milliseconds: 0
- service: squeezebox.call_method
metadata: {}
data:
command: playlist
parameters:
- loadalbum
- ''
- '{{artists}}'
- ''
target:
entity_id: media_player.whutzi
- service: media_player.media_play
metadata: {}
data: {}
target:
entity_id: media_player.whutzi
else:
- service: squeezebox.call_method
metadata: {}
data:
command: playlist
parameters:
- loadalbum
- ''
- '{{artists}}'
- ''
target:
entity_id: media_player.whutzi
- service: media_player.media_play
metadata: {}
data: {}
target:
entity_id: media_player.whutzi
mode: single
In this setup the playlist is not loaded an no music plays. Whereas it works in the automation above.
Anyone a hint?
Thanks in advance!
Flo