Giter VIP home page Giter VIP logo

now-playing-card's Introduction

title

now-playing-card

Custom card for Home Assistant to display a poster of the currently playing item in designated media_player.

This works with those media_player entities supporting the entity_picture attribute. Roku, Kodi, and Amazon Echo Dot all seem to work well for me.

The card is stackable, so you can position cards from several media players in the same spot to show whichever one is playing.

The card only shows the entity_picture while the status is playing. This is because some roku players and echo dots will show images even when not actively playing media content. It should be easy to edit this function out if you don't want it.

Known issues:

Transform is highly dependent on the image size, so if you attempt to display an image of a different size (this can happen in kodi) the transform will not work correctly and the image will look weird or in the wrong place.

If you use an old browser that doesn't display transform css properly, transform just won't work.


entity

(string)(Required)

Entity id

ย 

off_image

(string)(optional)

Optional Image to display when idle. This must be the same size as the media image if using transform.


Example Usage

      - type: "custom:now-playing-poster"
        entity: media_player.dot_lr  
        style:
          width: 10%
          top: 20%
          left: 9%
          transform: rotate(-76deg) rotateX(-57deg) skewX(-25deg)              

Installation

Installation is the same as any custom card.

  1. Copy the file now-playing-card.js to your /config/www/js/ directory

  2. Add the following to the resources area of your ui-lovelace.yaml (or add to resources on the lovelace dashboard)

         - url: /local/js/now-playing-card.js
           type: module
    

Once the card is copied and referenced, you can just add the entry as listed above.

Most likely you'll also want to move the image around your floorplan. This can be accomplished with CSS. A tool has been included to help figure out the skew and rotate values, it's not necessary to use this tool, but hopefully it makes things easier. To use the tool just open rotate.html from the Design Tool folder, and then copy your floorplan image and media image to the folder, or enter a valid URL for those images.

now-playing-card's People

Contributors

allangood avatar bradcrc avatar spike886 avatar zamberjo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.