Is it possible to automatically select the media player based on the voice assistant speaker that is triggering the automation? This is what I tried to do but does not work:
alias: Help me relax with the sound of rain
description: ""
triggers:
- command:
- Help me relax
- Help me relax with the sound of rain
- Play rain sounds
trigger: conversation
id: "on"
conditions: []
actions:
- variables:
context_id: "{{ trigger.context.id }}"
- wait_for_trigger:
- event_type: assist_pipeline.run_start
event_data:
context:
id: "{{ context_id }}"
trigger: event
timeout: "00:00:05"
continue_on_timeout: false
- target:
entity_id: >-
{{ wait.trigger.event.data.device_id | replace('device/',
'media_player.') }}
data:
media_type: track
media_id: 2304
enqueue: play
action: music_assistant.play_media
- target:
entity_id: >-
{{ wait.trigger.event.data.device_id | replace('device/',
'media_player.') }}
data:
repeat: one
action: media_player.repeat_set
- set_conversation_response: ""
mode: single
Any help would be much appreciated.