[WORKAROUND] Source list not showing up in universal media_player

Hello,

I have some universal media_player used to select some action to perform in Apple HomeKit.
Unfortunatelly since a few time the list of source doesn’t show anymore in Home Assistant (and therefore in Homekit)
It’s quite strange because it was working fine… and then stopped.

Here is my configuration

  1. in configuration.yaml
media_player:
  - platform: universal
    name: Chauffage 
    commands:
      turn_on:
        service: input_select.select_option 
        entity_id: input_select.chauffage 
        data:
          option: Normal
      turn_off:
        service: input_select.select_option 
        entity_id: input_select.chauffage 
        data:
          option: Eté
      select_source:
        service: input_select.select_option
        data_template:
          entity_id: input_select.chauffage
          option: >-
            {% if source == 'Normal' %}
              Normal 
            {% elif source == 'Confinement' %}
              Confinement
            {% elif source == 'Visite' %}
              Visite 
            {% elif source == 'Présent' %}
              Présent
            {% elif source == 'Télétravail' %}
              Télétravail
            {% elif source == 'Absence longue' %}
              Absence longue
            {% elif source == 'Absence courte' %}
              Absence courte
            {% elif source == 'Eté' %}
              Eté
            {% else %}
              Normal 
            {% endif %}
    attributes:
      state: input_boolean.homekit_chauffage
      source: input_select.chauffage
  1. in input_select.yaml
chauffage:
  name: Etats du Chauffage
  icon: mdi:home-minus
  options:
   - Normal
   - Confinement
   - Visite
   - Présent
   - Télétravail
   - Absence courte
   - Absence longue
   - Eté 
  1. in customize.yaml
chauffage:
  name: Etats du Chauffage
  icon: mdi:home-minus
  options:
   - Normal
   - Confinement
   - Visite
   - Présent
   - Télétravail
   - Absence courte
   - Absence longue
   - Eté 

And the result which unfortunatelly doesn’t show the list of sources anymore

For what it’s worth, I got the same problem after upgrading to 2021.3.x

universal media player typically only shows controls when the device is on.

This did work previously and volume controls are still shown when the device is on. Only source selection is missing.

I openned a bug, since it’s a regression compared to previous versions : https://github.com/home-assistant/frontend/issues/8673

Did someone find a solution to this issue ?

Adding a children: entry, I managed to get it working again.

Can you please use home assistant lingo and explain what you did so other users coming to this thread can work around the issue? Thanks.

What is home assistant lingo ?
As explained above, I added one entry in the configuration of the media_player config to indicate that one entity is used as a children.

From :

media_player:
  - platform: universal
    name: Chauffage
    commands:
      turn_on:
        service: input_select.select_option 
        entity_id: input_select.chauffage 
        data:
          option: Normal
      turn_off:
        service: input_select.select_option 
        entity_id: input_select.chauffage 
        data:
          option: Eté
      select_source:
        service: input_select.select_option
        data_template:
          entity_id: input_select.chauffage
          option: >-
            {% if source == 'Normal' %}
              Normal 
            {% elif source == 'Confinement' %}
              Confinement
            {% elif source == 'Visite' %}
              Visite 
            {% elif source == 'Présent' %}
              Présent
            {% elif source == 'Télétravail' %}
              Télétravail
            {% elif source == 'Absence longue' %}
              Absence longue
            {% elif source == 'Absence courte' %}
              Absence courte
            {% elif source == 'Eté' %}
              Eté
            {% else %}
              Normal 
            {% endif %}
    attributes:
      state: input_boolean.homekit_chauffage
      source: input_select.chauffage

To (search for children)

media_player:
  - platform: universal
    name: Chauffage
    children:
      - media_player.cuisine
    commands:
      turn_on:
        service: input_select.select_option 
        entity_id: input_select.chauffage 
        data:
          option: Normal
      turn_off:
        service: input_select.select_option 
        entity_id: input_select.chauffage 
        data:
          option: Eté
      select_source:
        service: input_select.select_option
        data_template:
          entity_id: input_select.chauffage
          option: >-
            {% if source == 'Normal' %}
              Normal 
            {% elif source == 'Confinement' %}
              Confinement
            {% elif source == 'Visite' %}
              Visite 
            {% elif source == 'Présent' %}
              Présent
            {% elif source == 'Télétravail' %}
              Télétravail
            {% elif source == 'Absence longue' %}
              Absence longue
            {% elif source == 'Absence courte' %}
              Absence courte
            {% elif source == 'Eté' %}
              Eté
            {% else %}
              Normal 
            {% endif %}
    attributes:
      state: input_boolean.homekit_chauffage
      source: input_select.chauffage```
1 Like

Thanks, this lingo was unclear to me, and potentially others:

The lingo I would expect: “I added a media_player entity_id to children”

Got a different problem then but also found a solution. Currently it is important to not use whitespace when defining the source_list attribute.

See home-assistant/core#53804

Fixed in 2021.8.7

1 Like
service: media_player.select_source
data:
  source: Netflix
target:
  entity_id: media_player.sony_bravia_tv

Open a app like Netflix work in the media player pick th application and it works but not in service