Howdy HA Friends!
I’m trying to configure some whole home audio with media_player.join.
I have multiple squeezelites that work and when manually joined by actions they work great.
alias: LMS CUSTOM Garagesqueeze Sync ON
description: Sync player to the lms_sync_master when the toggle is turned ON
triggers:
- trigger: state
entity_id:
- input_boolean.lms_player6_sync
from: null
to: "on"
for:
hours: 0
minutes: 0
seconds: 3
conditions: []
actions:
- action: media_player.join
metadata: {}
data:
group_members:
- media_player.garage_squeezelite
target:
entity_id: media_player.guest_squeezelite
mode: single
This basic automation works and my garage will join guest, no problem.
On my dashboard I have an input_select.lms_master_sync I would like to use this as the Target : Entity_ID, so that the master is selectable rather than hard coded into the automation.
I know the input_select works, as I can see the state change in dev tools. But how can I replace that entity ID with a template? I’ve tried with some AI to give me options but none seem to work. I’m banging my head against this one!
actions:
- action: media_player.join
metadata: {}
data:
group_members:
- media_player.guest_squeezelite
target:
entity_id: 'media_player.{{states.input_select.lms_sync_master.state}}'
This is what I last tried with no bueno.
Any help would be much appreciated!