Universal Media Player Configuration Examples

Hello,

Can anyone send me configuration code examples for Universal Media Player(Configuration.yaml-Dashboard)? I can’t find something easy to understand. I want to control switches as a sources and a shell_command as a volume. I have done the below setup but i have problems.

  1. the volume slider after HA restart goes to 0
  2. I can’s see the sources at Media Player.
media_player:
- platform: universal
  name: My Media Player
  state_on: playing
  commands:
    volume_set:
      service: input_number.set_value
      data_template:
        entity_id: input_number.volume1
        value: "{{ ((volume_level * 84) | round(0)) - 72 }}"
  source_list:
    - Input 1
    - Input 2
  source_template: >
    {% if is_state('switch.out1in1', 'on') %}
      Input 1
    {% elif is_state('switch.out1in2', 'on') %}
      Input 2
    {% else %}
      Unknown
    {% endif %}
  state_template: >
    playing

image