Lovelace: Mini Media Player

I can only use the card to turn my TV off as it doesn’t support LAN control for turning on
 maybe that’s your bathroom issue?

It’s a sonos player so it supports remote turn on (it never really turns off I suspect)

What TV do you have? My Sony had a setting hiding that allows for wake on lan (it had some obscure name) but it fixed the problem you are having.

Samsung
 it’s documented you can’t use the app to turn it on. It’s a bit old now
 longer than 5 years I think


@gerard33 Nice solution, I think we could end up with something great if we combine our ideas.

@Stewface Thanks for the feedback. I love the points in your wishlist and they are certainly possible to implement, I’ll take a stab at it when I got time!

I won’t push betas to the tracker, the code there is really just for testing, and might not work as expected. If you want to try it you’ll have to update the card manually. :wink:

Thank you sm for your kind words. Possibly in the future, if people would like that, I still have some things I want to get done first though!

All Good. You could just get them done in core :stuck_out_tongue_winking_eye: but yea eventually man you have to put this developing power to the core.

1 Like

Try like this:

- type: entity-filter
  entities:
    - type: custom:mini-media-player
      entity: media_player.livingroom_directv
      icon: mdi:google-home
      group: true
      artwork: cover
  state_filter:
    - playing
  show_empty: false

Let me know if it works :smiley:

1 Like

That did the trick. Thanks!

1 Like

Understood but manually updating it will then throw a red ‘update available’ in the custom card updater
 I assume at some point you’ll update the version to this card.

Used the newest .9 beta, but still has the same token problem with .8
Error message from the source you linked, HA restartad, cache, cookie deleted.

http://localhost:8123/local/mini-media-player.js:293:27 Uncaught SyntaxError: Invalid or unexpected token

Edit.
Put back the old 2~ months old js file and changed back to type:js and it works fine. No idea where it goes wrong.

Yes of course, when the code is ready a new version will be available.

If that is the case, I suspect you are running an old browser with no ES6 support. What browser are you using (including version)?

You could also try:

Oh, didn’t see anything about the need of ES6 support. I’m using Firefox 55.0.3.

You could try updating your browser and/or make sure you have javascript_version: latest in your configuration.yaml under frontend: .

The error is quite strange though, there shouldn’t really be any ES5/6 specific syntax on that line, If you are using the latest release.

@gerard33 & @Stewface
Ok guys, I made some changes with your feedback in mind.

  • When player is considered idle, progress/artwork/volume & media controls are hidden
  • When player is considered idle, media information (if available) is faded and restricted to one row
  • When player is considered idle and media is available/paused a play button is visible

Here is an example of the changes when the player switches to idle:

YAML:

- entity: media_player.chromecast_sovrum
  type: "custom:mini-media-player"
  show_progress: true
  consider_idle_after: 10

Note that I renamed consider_off_after to consider_idle_after.

Once again, would be great if you can test run the code and give me feedback. :slightly_smiling_face:

  • You can grab the updated mini-media-player.js code here . replace your existing

  • Change your card reference to something like this (make sure the url path is correct)

    - url: /local/mini-media-player.js?v=0.8.9-beta2
      type: module
    
  • Add the new option consider_idle_after: x to your cards yaml, where x equals amount of minutes since media_position_updated_at

    - type: "custom:mini-media-player"
      ...
      consider_idle_after: 10
    

And where can I find the last non ES6 version?

Want to update Firefox but I cant, I’m using too much old addons for my work.

Alright, gotcha.
I think v0.4.1 should work.

Hi guys,

I tried to hide the player, when nothing is played:

- type: conditional
  conditions:
    - entity: media_player.spotify
      state: "playing"
  card:
    - type: custom:mini-media-player
      entity: media_player.spotify
      name: Spotify Player
      artwork: cover
      power_color: true
      hide_volume: true
      show_progress: true

But I get this error:
30_22h48m06s_009_

Did I config something wrong?

I do the same thing. Check out the snippet in this post


2 Likes

Conditional cards are broken in 0.81.x releases. It is supposed to be fixed in 0.81.3 when it arrives


2 Likes

Thanks for the awesome custom card @kalkih. I have it in my to-do list to make a video guide on different custom cards for Lovelace. Will definitely be covering your custom cards. :grinning:

1 Like

Thanks you for the kinds words. :pray:
Love the videos man, have helped and inspired me a lot throughout my home automation journey!

1 Like