Hi guys!
I have multizone amp (DAX88) that creates media_player for each zone in HA.
The problem is that these players lack PLAY_MEDIA command and are not available in Music Assistant.
Each of my 8 HA players have 4 inputs replicated from amp that can be selected, like on a picture below:
I have thought that it would be best to sacrifice one input just for use of Music Assistant and create 8 separate universal players just for MA by recreating them and adding PLAY_MEDIA command and fixing them to single input (AUDIO).
In this case I would need to create universal players with just one input (AUDIO) that are visible in MA.
I have managed to create this players with universal player - HA did create new media_players from universal media player integration and they are visible in MA, but they are not separated - e.g. - they still change inputs whenever I change input on “original” xantech integration input, and they remember last input chosen on the original player - and thus don’t work.
Could anyone help me with that issue please?
my configuration.yaml for one of the zones of universal player:
### Recreate DAX zones for MA - universal player for each zone and one input! ###
### Source: AUDIO ###
- platform: universal
name: Kitchen
unique_id: audio_kitchen
# children:
# - media_player.chw_kitchen
commands:
turn_on:
service: media_player.turn_on
target:
entity_id:
- media_player.chw_kitchen
service: input_select.select option
# target:
# entity_id:
# - media_player.chw_kitchen
data:
option: AUDIO
target:
entity_id:
- media_player.chw_kitchen
turn_off:
service: media_player.turn_off
target:
entity_id:
- media_player.chw_kitchen
volume_up:
service: media_player.volume_up
target:
entity_id:
- media_player.chw_kitchen
volume_down:
service: media_player.volume_down
target:
entity_id:
- media_player.chw_kitchen
volume_mute:
service: media_player.mute
target:
entity_id:
- media_player.chw_kitchen
select_source:
service: input_select.dax_source_kitchen
target:
entity_id:
- media_player.chw_kitchen
data:
entity_id:
- media_player.chw_kitchen
option: AUDIO
volume_set:
service: media_player.volume_set
target:
entity_id:
- media_player.chw_kitchen
data:
volume_level: "{{ volume_level }}"
play_media:
service: media_player.play_media
target:
entity_id:
- media_player.chw_kitchen
Or maybe it should be universal media player combining the INPUT media_player.audio and zone media_player.chw_kitchen ?
What is the best way to create a player for MA (it needs play_media: command which is missing in the original xantech integration for zones.
summarizing: my goal is to have a media player accessible in MA that is bind for good with one of DAX inputs.
The inputs are generated and selected somehow by input_select helper that is also created for every player:
alias: Generate Dax Sources
description: ""
triggers:
- event: start
trigger: homeassistant
conditions: []
actions:
- data_template:
entity_id:
- input_select.dax_source_kitchen
- input_select.dax_source_terrace
- input_select.dax_source_guest_room
- input_select.dax_source_master_bathroom
- input_select.dax_source_zosia_s_bedroom
- input_select.dax_source_zosia_s_bathroom
- input_select.dax_source_master_bedroom
- input_select.dax_source_zone8pre
options: "{{ state_attr('media_player.chw','source_list') }}"
action: input_select.set_options
mode: single
alias: changeDAXsources
description: ""
triggers:
- entity_id:
- input_select.dax_source_kitchen
- input_select.dax_source_terrace
- input_select.dax_source_master_bathroom
- input_select.dax_source_zosia_s_bedroom
- input_select.dax_source_zosia_s_bathroom
- input_select.dax_source_zone8pre
- input_select.dax_source_guest_room
- input_select.dax_source_master_bedroom
trigger: state
conditions: []
actions:
- data:
source: "{{ states(trigger.entity_id) }}"
options: "{{ state_attr('media_player.chw','source_list') }}"
target:
entity_id: "{{'media_player.chw_' + trigger.entity_id.split('source_')[1]}}"
action: input_select.set_options
mode: single
When I perform an action on input_select it does change the state of
input_select.zone helper but it doesn’t change actual zone.
action: input_select.select_option
data:
option: AUDIO
target:
entity_id: input_select.dax_source_guest_room
my goal is to create player that only has one input AUDIO available and switches on zone player and selects input AUDIO for it.
How to approach this?
I would be greatful if someone could show me the direction to go.