The media_player “parent” entity media_player.lg_webos_smart_tv displays a different icon depending on what input or App is selected in the TV. That’s part of the integration feature and it works great:
The switch itself works fine. However, I have tried to get such dynamic icon into the switch entity with the icon_template code stated in the code above. Tried different options but neither of them work:
Is this what you are suggesting to share? Got this from the States tab in Developer Tools:
source_list:
- AV
- Componente
- DAZN
- Disney+
- Foto y Video
- HDMI 1
- HDMI 2
- LG Channels
- LG Content Store
- Live TV
- Movistar+
- MĂşsica
- Navegador web
- Netflix
- Prime Video
- Spotify – Música y podcasts
- YouTube
assumed_state: true
device_class: tv
friendly_name: LG webOS Smart TV
supported_features: 24381
volume_level: 0.07
is_volume_muted: false
media_content_type: channel
media_title: Telecinco
source: Live TV
sound_output: tv_external_speaker
Thank you, Mats789. Just noticed that after a while, another attribute is displayed under States tab:
source_list:
- AV
- Componente
- DAZN
- Disney+
- Foto y Video
- HDMI 1
- HDMI 2
- LG Channels
- LG Content Store
- Live TV
- Movistar+
- MĂşsica
- Navegador web
- Netflix
- Prime Video
- Spotify – Música y podcasts
- YouTube
volume_level: 0.01
is_volume_muted: false
source: Movistar+
sound_output: tv_external_speaker
assumed_state: true
device_class: tv
entity_picture: >-
/api/media_player_proxy/media_player.lg_webos_smart_tv?token=9055fb58c17171e27d99f537cb2667ef4f92f10d2a2d98f55e26bd2783988d53&cache=6e29b417822c6c30
friendly_name: LG webOS Smart TV
supported_features: 24381
One of them is actually the “entity_picture” one, so it should work. However, after updating the switch code accordingly, the icon is not updated, although the template tester returns the attribute content fine: