Universal Media Player: Select source data template error (using example code)

Hi guys,

I’m using the documentation example for Universal Media Player ( https://home-assistant.io/components/media_player.universal/ ) and am still getting an error when trying to change sources. Maybe a bug? I’ve tried using " instead of ’ but still the same error.

Error: [homeassistant.helpers.service] Invalid config for calling service: template value should be a string for dictionary value @ data[‘data_template’][‘source’]

My config:

  - platform: universal
    name: Universal Media Player (Living)
    children:
      - media_player.shield_tv
      - media_player.playstation_4
      - media_player.living_room
    commands:
      select_source:
        service: media_player.select_source
        data_template:
          entity_id: media_player.yamaha_avr_receiver
		  source: '{{ source }}'

vs Example:

      service: media_player.select_source
      data_template:
        entity_id: media_player.receiver
        source: '{{ source }}'

Has syntax changed somehow?

I see the same issue. This used to work before. volume_mute is working fine, but select_source isn’t.

Invalid config for calling service: template value should be a string for dictionary value @ data[‘data_template’][‘topic’]

- platform: universal
  name: livingroom
  children:
    - media_player.woonkamer
  commands:
    ...
    volume_mute:
      service: mqtt.publish
      data:
        topic: media/cec/tx
        payload: '15:44:43'
    select_source:
      service: mqtt.publish
      data_template:
        topic: 'media/cec/tx'
        payload: >
                  {% if (source == "Chromecast") %}
                     15:44:69:02
                  {% elif (source == "TV") %}
                     15:44:69:03
                  {% elif (source == "Radio") %}
                     15:44:69:07
                  {% elif (source == "CD/DVD/Bluray") %}
                     15:44:69:01
                  {% endif %}
    ...

This really looks like a bug. It works fine in 0.57 but is broken in 0.58. I’ve opened https://github.com/home-assistant/home-assistant/issues/10981

Thanks for opening the bug - was just running into this issue also