Universal Media Player Integration - Errors

I’m trying, as the docs suggest, to combine the Android TV Remote and Google Cast integrations to create a Universal Media Player for my NVIDIA Shield. However, doing so broke the functioning media player automations I’d managed to put together.

First issue: configurations.yaml has two entries for “media_player”: one for my custom Emby integration, one for my universal integration. I’m unsure how to combine these into one - I assume this is what broke my Emby automations.

Second issue:

Invalid config for ‘media_player’ from integration ‘universal’ at configuration.yaml, line 29: expected a dictionary for dictionary value ‘commands->turn_on->target’, got None, please check the docs at…

It errors every four lines thereafter. Same error. I can’t copy-paste the full thing because the docs link isn’t allowed.

Here’s what it looks like, which seems to me to be the same as the documentation:

media_player:
  - platform: universal
    name: Universal Shield
    children:
      - media_player.shield
      - media_player.shield_2
    commands:
      turn_on:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield
      turn_off:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield
      volume_up:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield
      volume_down:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield
      volume_mute:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield
      media_play:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield_2
      media_pause:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield_2
      media_previous_track:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield_2
      media_next_track:
        action: media_player.turn_on
        target:
        entity_id: media_player.shield_2
    attributes:
      is_volume_muted: media_player.shield|is_volume_muted
      state: media_player.shield_2|state
    browse_media_entity: media_player.CHILD_2_ID
    device_class: tv
    unique_id: media_player.universal_shield

All your entities need indented

 action: media_player.turn_off
 target:
        entity_id: media_player.shield

Okay, that doesn’t generate any errors now. But it’s still not working? The Google Cast one needs to be manually powered on, and doing so kills whatever I’m doing and replaces it with a Home Assistant splash screen on my TV. The universal player is never powering on under any circumstances, even if I attempt to power it on manually. And the Google Cast one doesn’t seem to be tracking playback state anyway, which I thought was the reason for including it?

Yu really don’t need to start with all those commands. Get the Media Players joined first

My YAML looks like this

media_player:
  - platform: universal
    name: Media Players
    unique_id: media_players
    children:
      - media_player.shield_cast
      - media_player.emby_shield
  - platform: emby
    host: 192.168.50.240
    api_key: *your emby key*

- media_player.shield_cast is my Nvidia Shield connected via Google Cast

I now have a Universal player that’s turned on, but the Google Cast one is still greyed out and neither the universal nor the cast - nor, obviously, the Shield itself - are reporting playback state.

A few things

  1. Post your YAML code

  2. Is Universal Media Player showing in your integrations?

media_player:
  - platform: emby
    host: [ip address]
    api_key: [key]
  - platform: universal
    name: Universal Shield
    children:
      - media_player.shield
      - media_player.shield_2
    unique_id: media_player.universal_shield

for testing make this unique_id: media_players

That doesn’t seem to have changed anything at all.

Rebooting the Shields is a must. We have very similar setups. I run two shields as well

I don’t have two Shields, I have one Shield. I’m attempting to combine the Google Cast integration with the Android TV Remote integration so I can get playback state in order to control my lights. The Universal Integration documentation suggests it should support this.

You don’t need to combine them to get the playback state

Ensure the Shield is installed with Google Cast

And
Android TV Remote

You’ll get the status

Well it’s not giving me the playback state as-is, and according to the documentation for the Android TV Remote integration “Due to API limitations, the integration will not display the playback status. It is recommended to use this integration together with Google Cast integration.”

Yes I stated in the previous post that you need both installed and referencing the device

When you go to the Cast Integration do you activity from your Shield?

No, it’s just turned off.

It will show OFF if a app isn’t playing. If you don’t see activity in HA when a app is playing, reboot

If you reboot the Shield and experience the same, you Shield needs to be reconnected/reinstalled to HA

Even after rebooting the Shield, the Cast version is still off. The Emby version shows playback state, the Android Remote version shows it’s on but nothing else, and the Universal version is the same as the Android Remote version.

What CAST settings do you have set on the Shield?

Have you activated Developer Tools on the Shield?

I figured if HA picked it up, then it must be set up as needed? I’ve enabled Developer Options now, I’m not sure what the Cast settings are or are supposed to be? There’s a “Google Cast” option in the Shield menu but the only setting seems to be whether to have a notification or something?