I’ve been using markdown cards inside conditional cards to display information in a simpler way that I can get from other cards or integrations, and I am wondering if I’m missing cards that already do this?
The Flight Card was made using a Tidbyt applet as inspiration, and then I created a Now Playing applet using a similar format, so I figured I’d add it to my HA dashboard and I like it
I don’t like the media player cards for this because I don’t want controls, I just want information about what’s playing in a specific Media Player.
As I was searching for similar things I discovered a custom Sonos card that I now love, and maybe I haven’t found one.
I know there’s Upcoming Media Card, but that doesn’t do what I’m doing here.
The code below pulls data from a Plex Media Player and displays info depending on if it’s a TV Show or a Movie.
{% set player = 'media_player.NAME' %}
<table>
<center>
<tr>
<td><img src="{{ state_attr(player, 'entity_picture')}}" height="90"></td></td>
<td> <td>
{% if state_attr(player, 'media_content_type') == 'tvshow' %}
<td>
<font size="4"><b>{{ state_attr(player, 'media_series_title') }}</font><br></b>
S{{ state_attr(player, 'media_season')}} E{{ state_attr(player, 'media_episode')}}<br>
{{ state_attr(player, 'media_title') }}<br>
{% if state_attr(player, 'media_duration') < 3600 %}{{ (state_attr(player, 'media_duration'))|timestamp_custom('%-Mmin', false)}}
{% elif state_attr(player, 'media_duration') == 3600 %}1hr
{% elif state_attr(player, 'media_duration') > 3600 %}{{ (state_attr(player, 'media_duration'))|timestamp_custom('%-Hhr %-Mmin', false)}}
{% endif %}
{% elif state_attr(player, 'media_content_type') == 'movie' %}
<td>
<font size="4"><b>{{ state_attr(player, 'media_title').split('(')[0] }}</font><br></b>
{{ state_attr(player, 'media_title').split('(')[1][:4] }}<br>
{{ (state_attr(player, 'media_duration'))|timestamp_custom('%-Hhr %-Mmin', false)}}
</tr>
</center>
{% endif %}
</table>