Select_output functionality for media players

Media Player components currently support the concept of selecting an input source, which is then piped to the output of the device, with the assumption only one output is possible.

For media players representing matrix devices (Monoprice 6 Zone, for example), each individual output zone can reasonably be treated as an independent media player; this allows flexibly mapping the input sources to the individual outputs.

However, there does not appear to be any concept in Home Assistant of a media player which has a fixed input, but a flexible output routing. I’m specifically thinking of this for the forked_daapd system (and more generally for MPD systems or any other source which has a single input at a time but can be flexibly mapped to one or more of many output devices.)

Given this, I would propose a select_output functionality. Ideally, this would take a checkbox approach (select whichever of the X outputs you would like to enable/disable) rather than a dropdown approach.

This might also be useful in controlling audio receivers with multi-zone outputs or non-matrix audio distribution amplifiers, or for matrix switchers with fewer inputs than outputs (where the Monoprice approach of treating each output as independent with input selection is less logical than treating each input as independent with output selection.)

The checkbox/multiple selection approach has been previously requested for the input_select function, e.g. in Input_select dynamic fill and multiple select - it could conceivably be implemented by having each element of the list be an attribute of the input_select component, with its selection state as the value of the attribute. In the media_player, each output could similarly be an attribute with its state as the value; ie, media_player.forked_daapd.attributes.apple_tvwould be on if the apple_tv is a currently selected output, while it would be off if it is not.

I’m dealing with this in my Smartvideohub component by having a ‘media player’ device for each output, then you select the input from the source option. Seems to work OK but would depend on each platform whether they did it like this I guess

That approach is okay if you have a fixed number of outputs; it doesn’t work as well for something like forked-daapd, which has a fixed number of inputs (1) but the number of outputs can vary over time (as output devices come on and off network.)