Hey @JN_Jones, thanks for posting your config. I tweaked it a little bit with new functionalities and some adjustments.
media_player:
# Templated Android TV media player
- platform: media_player_template
media_players:
sony_bravia_android_templated:
friendly_name: Sony Bravia Android TV templated
device_class: tv
current_source_template: "{{ state_attr('media_player.sony_bravia_psk', 'source') }}"
current_volume_template: "{{ state_attr('media_player.sony_bravia_psk', 'volume_level') }}"
current_is_muted_template: "{{ state_attr('media_player.sony_bravia_psk', 'is_volume_muted') }}"
value_template: >
{% if is_state("media_player.sony_bravia_android_tv", "on") %}
{% if is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.google.android.apps.tv.launcherx") or is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.google.android.apps.tv.dreamx") or is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.android.tv.settings") %}
on
{% else %}
playing
{% endif %}
{% else %}
off
{% endif %}
turn_on:
service: media_player.turn_on
target:
entity_id: media_player.sony_bravia_psk
turn_off:
service: media_player.turn_off
target:
entity_id: media_player.sony_bravia_psk
volume_up:
service: media_player.volume_up
target:
entity_id: media_player.sony_bravia_psk
volume_down:
service: media_player.volume_down
target:
entity_id: media_player.sony_bravia_psk
set_volume:
service: media_player.volume_set
target:
entity_id: media_player.sony_bravia_psk
data:
volume_level: "{{ volume | float }}"
mute:
service: media_player.volume_mute
target:
entity_id: media_player.sony_bravia_psk
data:
is_volume_muted: "{{ not state_attr('media_player.sony_bravia_psk', 'is_volume_muted') }}"
play:
service: media_player.media_play
target:
entity_id: media_player.sony_bravia_psk
pause:
service: media_player.media_pause
target:
entity_id: media_player.sony_bravia_psk
stop:
service: media_player.media_stop
target:
entity_id: media_player.sony_bravia_psk
next:
service: media_player.media_next_track
target:
entity_id: media_player.sony_bravia_psk
previous:
service: media_player.media_previous_track
target:
entity_id: media_player.sony_bravia_psk
media_content_type_template: "{{ state_attr('media_player.sony_bravia_psk', 'media_content_type') }}"
title_template: >
{% if is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.apple.atve.sony.appletv") %}
Apple TV
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.calibrationmonitor") %}
Calman for BRAVIA
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.canal.android.canal") %}
CANAL+
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.dailymotion.dailymotion") %}
dailymotion
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.disney.disneyplus") %}
Disney+
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.recapp") %}
Title List
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.wbd.stream") %}
Max
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.osat.music") %}
Music
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.promos") %}
My BRAVIA
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.netflix.ninja") %}
Netflix
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.smartmediaapp") %}
Media Player
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.smarthelp") %}
Help
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.notificationcenter") %}
BRAVIA notifications
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.amazon.amazonvideo.livingroom") %}
Prime Video
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.ecodashboard") %}
Eco Dashboard
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.skyshowtime.skyshowtime.google") %}
SkyShowtime
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sonypicturescore") %}
SONY PICTURES CORE
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.sonyselect") %}
Sony Select
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.sonytab") %}
Sony Tab
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.spotify.tv.android") %}
Spotify
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.timers") %}
Timers and Clock
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.tvx") %}
TV
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "org.videolan.vlc") %}
VLC
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.voice.guide") %}
Voice Guide
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.google.android.youtube.tv") %}
YouTube
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.google.android.youtube.tvmusic") %}
YouTube Music
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.livingfit") %}
Living Decor
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.sony.dtv.airplayapp") %}
AirPlay
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.google.android.apps.tv.launcherx") %}
Home screen
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.google.android.apps.tv.dreamx") %}
Screensaver
{% elif is_state_attr('media_player.sony_bravia_android_tv', 'app_id', "com.android.tv.settings") %}
Settings
{% else %}
Smart TV
{% endif %}
# Universal Media Player
- platform: universal
name: Sony Bravia
unique_id: sony_bravia
device_class: tv
children:
- media_player.sony_bravia_cast
- media_player.sony_bravia_psk
- media_player.sony_bravia_android_templated
active_child_template: >
{% if not is_state("media_player.sony_bravia_psk", 'off') and not is_state("media_player.sony_bravia_cast", "off") and is_state_attr('media_player.sony_bravia_psk', 'media_title', "Smart TV") %}
media_player.sony_bravia_cast
{% elif not is_state("media_player.sony_bravia_psk", 'off') and not is_state("media_player.sony_bravia_android_templated", "off") and is_state_attr('media_player.sony_bravia_psk', 'media_title', "Smart TV") and not is_state_attr('media_player.sony_bravia_android_templated', 'media_title', "Smart TV") %}
media_player.sony_bravia_android_templated
{% else %}
media_player.sony_bravia_psk
{% endif %}
browse_media_entity: media_player.sony_bravia_psk
commands:
turn_on:
service: media_player.turn_on
target:
entity_id: media_player.sony_bravia_psk
turn_off:
service: media_player.turn_off
target:
entity_id: media_player.sony_bravia_psk
toggle:
service: media_player.toggle
target:
entity_id: media_player.sony_bravia_psk
volume_up:
service: media_player.volume_up
target:
entity_id: media_player.sony_bravia_psk
volume_down:
service: media_player.volume_down
target:
entity_id: media_player.sony_bravia_psk
volume_set:
service: media_player.volume_set
target:
entity_id: media_player.sony_bravia_psk
data:
volume_level: "{{ volume_level }}"
volume_mute:
service: media_player.volume_mute
target:
entity_id: media_player.sony_bravia_psk
data:
is_volume_muted: "{{ not state_attr('media_player.sony_bravia_psk', 'is_volume_muted') }}"
media_play_pause:
service: media_player.media_play_pause
target:
entity_id: media_player.sony_bravia_psk
media_play:
service: media_player.media_play
target:
entity_id: media_player.sony_bravia_psk
media_pause:
service: media_player.media_pause
target:
entity_id: media_player.sony_bravia_psk
media_stop:
service: media_player.media_stop
target:
entity_id: media_player.sony_bravia_psk
media_next_track:
service: media_player.media_next_track
target:
entity_id: media_player.sony_bravia_psk
media_previous_track:
service: media_player.media_previous_track
target:
entity_id: media_player.sony_bravia_psk
play_media:
service: media_player.play_media
target:
entity_id: media_player.sony_bravia_psk
data:
media_content_id: "{{ media_content_id }}"
media_content_type: "{{ media_content_type }}"
select_source:
service: media_player.select_source
target:
entity_id: media_player.sony_bravia_psk
data:
source: "{{ source }}"
attributes:
is_volume_muted: media_player.sony_bravia_psk|is_volume_muted
volume_level: media_player.sony_bravia_psk|volume_level
source: media_player.sony_bravia_psk|source
source_list: media_player.sony_bravia_psk|source_list
media_player.sony_bravia_cast - Google Cast media player entity
media_player.sony_bravia_psk - Sony Bravia TV media player entity
media_player.sony_bravia_android_tv - Android TV Remote media player entity
sony_bravia_android_templated - media_player.template media player entity
Here are the changes: