Kodi Universal Media Component

I am attempting to set up kodi as a device within a universal media_player component. It is using a mqtt harmony switch, kodi component & Sonos sound bar.

  - platform: universal
    name: Living Room TV
    children:
      - media_player.living_room_kodi
    commands:
      turn_on:
        service: switch.turn_on
        data:
          entity_id: switch.living_room_tv
      turn_off:
        service: switch.turn_off
        data:
          entity_id: switch.living_room_tv
      media_stop:
        service: media_player.media_stop
        data:
          entity_id: media_player.living_room_kodi
      volume_up:
        service: media_player.volume_up
        data:
          entity_id: media_player.living_room
      volume_down:
        service: media_player.volume_down
        data:
          entity_id: media_player.living_room
      volume_mute:
        service: media_player.volume_mute
        data:
          entity_id: media_player.living_room
    attributes:
      state: switch.living_room_tv
      volume_level: media_player.living_room
      is_volume_muted: media_player.living_room

media_player.living_room = Sonos PlayBar

When I attempt to mute the universal component, I get the following error:
17-01-30 15:46:03 homeassistant.core: Invalid service data for media_player.volume_mute: required key not provided @ data['is_volume_muted']. Got None

Also, is it possible to stop kodi play via a stop (equivalent to hitting ‘X’ on keyboard) button? I added it to the universal component, but it (a square indicating stop) does not appear anywhere that I see.

Thanks!

Did you ever solve this? I’m having the same issue, and also an issue when trying to use the set_volume functionality.

@mbw I have not… volume works, but not mute.

Post is a long time ago. But I’d the same error today and figured it out.

Change the volume_mute part to this:

volume_mute:
  service: media_player.volume_mute
  data_template:
    entity_id: media_player.living_room
    is_volume_muted: >-
      {{ states.media_player.living_room.attributes.is_volume_muted }}