Lovelace: Mini Media Player

I have a quiestion about idle_view. I dont think I understand it,or my other config options are overwriting it.

I have one sonos speaker. When playing I display the full artwork, taking up a good amount of space, and I like that. When I stop playing music, and it’s paused. I want to go to the normal, small player.

Right now it stays on the last source and displays the artwork.

Here is my config

artwork: full-cover
entity: media_player.living_room
hide:
  icon: true
  name: true
  next: true
  power: true
  power_state: true
  prev: true
  source: false
  volume: true
info: scroll
source: full
idle_view: true
consider_pause_idle: true
consider_idle_after: 30
type: 'custom:mini-media-player'

Hey folks, I’m fairly new to home assistant and stumbled across this in hacs. I’m struggling with the install. The files are in the right place (see below)

[root@hothserv1 mini-media-player]# pwd
/opt/home-assistant/www/community/mini-media-player
[root@hothserv1 mini-media-player]# ls
mini-media-player-bundle.js  mini-media-player-bundle.js.gz
[root@hothserv1 mini-media-player]# ls -ltrh
total 196K
-rw-r--r--. 1 root root 152K Aug  7 08:45 mini-media-player-bundle.js
-rw-r--r--. 1 root root  41K Aug  7 08:45 mini-media-player-bundle.js.gz

I set up the Resources for it. (note I tried both the suggested path during the install and the one where my other hacs lovelace ui mod is installed. Any help pointing me in the right direction would be much apprecited!

I keep getting these kinds of errors when trying to make my first card.

That’s not an error. It’s just saying you have to configure the player using yaml as there is no visual user interface to configure the card.

So I’m unable to add the mini-media-player from the manual method here? The guide kind of falls short at this step. The guide on the repo page is really good about telling me where things need to be up until getting to the card section.

No that is exactly what you do. You write a yaml config in a manual card.

Pretty sure this is unrelated to this card since the card isn’t caching anything at all, so a simple refresh should give you a “fresh start”, unless something has changed in HA and it’s now caching cards or something.
You can easily check if the card is the issue by taking a look at the media players attributes in developer tools, check the attributes and see if they match what’s shown in the card.

Your idle_view configuration is incorrect.
try this:

... rest of card config
idle_view:
  when_paused: true
  after: 30

Note: after in this configuration is redundant and can be removed since when_paused is already set to true and will render the idle view directly when playback is paused.

1 Like

Ok I think I figured it out thanks for your help @tom_l I was expecting to see exactly what I saw in the example so it didn’t really click in my head when I actually got it working. I’ve started playing with the card options and seeing elements appear so I’m pretty sure I have it working. Time to start tweaking it :slight_smile:

1 Like

The documentation is really poor (missing!?) for users in “non yaml mode”…
I’m not using the GUI to configure cards myself so if someone wants to improve the documentation I would be very happy :laughing:

Ok, i did a test and this is the result.

I play some music on my echo_show device and the attributes are:

After this i stopped the music (always using the card) and then i went to the developer/states and this is the result of the attributes of the same device:

As you can see nothing is changed after stopping the music and that’s what i posted. The card is still showing artwork and title track:

Schermata 2020-08-07 alle 20.03.44

And you can see also the card is showing the music playing also if i stopped it and no music is played in the device.
What do you think ?

EDIT: I noticed also the default media control card has the same behaviour:

Schermata 2020-08-07 alle 20.07.06

So i think now it depends directly from HA… I opened an issue regarding this but none is replying me…

EDIT: After 10 minutes stopping music the card is still showing is playing…

Schermata 2020-08-07 alle 20.09.53

Yep, it’s an backend issue then.

Hi
I keep getting ‘No card type found’

- entity: media_player.kitchen
  type: 'custom:mini-media-player'

If you are using the UI code editor (manual card) remove the dash and indentation.

entity: media_player.kitchen
type: 'custom:mini-media-player'
2 Likes

Ok, so now i hope my issue will be considered, but till now none care of it…
Can you do something about it?

Hi tom, when I do that I get:

Error: Custom element not found: mini-media-player

What I did:

resources:
  - url: /local/mini-media-player-bundle.js?v=1.10.1
    type: module
  • through the ‘Raw Configuration Editor’ & saved
  • restarted HA.

That’s not what the instructions say to do. They say this:

  1. Add a reference to mini-media-player-bundle.js inside your configuration.yaml or through the Home Assistant UI from the resource tab.

resources: - url: /local/mini-media-player-bundle.js?v=1.10.1 type: module

Cut the entry you made in the raw editor and paste it into your configuration.yaml file. Then config check and restart.

Or go to the configuration / dashboards / resources menu and add it to the list there.

1 Like

If you see the issue while using a core media player component I would suggest opening an issue in the Home Assistant GitHub repo.

This is what and where i opened:

Is it ok?

Tried at first in configuration.yaml but that gave an error too and bumped on this thread: Component error: resources - Integration 'resources' not found but didn’t read that last post :blush: (it was late)

So now added through the resources tab (had to dig deep to find that again, and this time with that last post from the above mentioned thread… EUREKA!) :ok_hand: :clap:

Thanks A LOT tom (again)

1 Like

It really is much easier to use HACS, it does all that for you.

How do I remove the state text?

state_text