sensor.emby_upcoming_media
sensor.emby_upcoming_media copied to clipboard
Home Assistant component to feed Upcoming Media Card with the latest releases on an Emby instance.
trafficstars
Emby Latest Media Component
Home Assistant component to feed Upcoming Media Card with the latest releases on an Emby instance. This component does not require, nor conflict with, the default Emby component.
If you're having issues, check out the troubleshooting guide before posting an issue or asking for help on the forums.
Installation:
- Install this component by copying these files to
/custom_components/emby_upcoming_media/. - Install the card: Upcoming Media Card
- Add the code to your
configuration.yamlusing the config options below. - Add the code for the card to your lovelace configuration.
- You will need to restart after installation for the component to start working.
| key | default | required | description |
|---|---|---|---|
| api_key | yes | Your Emby API key | |
| user_id | yes | The id of the user you want to impersonate. Note: this is an id, not a username. Spy on Emby API calls to retrieve yours. (The Libraries and Medias that get retrieved depend on what that user has access to) | |
| host | localhost | no | The host Emby is running on. |
| port | 8096 | no | The port Emby is running on. |
| ssl | false | no | Whether or not to use SSL for Emby. |
| max | 5 | no | Max number of items in sensor. |
| use_backdrop | false | no | Defines whether to use the Backdrop Image, instead of the poster. (Great for using with the fanart display mode) |
| include | no | The names of the Emby Libraries you want to include. If not specified, all libraries will be shown and this component will create one sensor per Library. This is language specific. | |
| group_libraries | false | no | This option generates only two sensors (emby_latest_movies / emby_latest_tv_shows), grouping all your movies and tv into seperate sensors despite library setup in Emby. This is useful for when Emby has many libraries but you only want one sensor in Home Assistant. |
| episodes | true | no | Setting this to false will change the items shown from Episodes to Seasons (for tv show libraries) and Songs to Albums (for music libraries). |
Do not just copy examples, please use config options above to build your own!
Sample for configuration.yaml:
This will add items from the 'Movies', 'Kids Movies', 'TV Shows' and 'Music' Libraries in Emby, as well as show seasons and albums for their respective libraries, creating a seperate sensor per library
sensor:
- platform: emby_upcoming_media
api_key: YOUR_EMBY_API_KEY
user_id: YOUR_EMBY_USER_ID
host: 192.168.1.4
port: 8096
ssl: True
max: 5
use_backdrop: true
group_libraries: false
episodes: false
include:
- Movies
- Kids Movies
- TV Shows
- Music
This will add all items Emby and create one sensor for movies (emby_latest_movies) and one for tv (emby_latest_tv_shows)
sensor:
- platform: emby_upcoming_media
api_key: YOUR_EMBY_API_KEY
user_id: YOUR_EMBY_USER_ID
host: 192.168.1.4
port: 8096
ssl: True
max: 5
use_backdrop: true
group_libraries: true
Sample for ui-lovelace.yaml:
- type: custom:upcoming-media-card
entity: sensor.emby_latest_movies
title: Latest Movies
Getting Information for the Plugin
api_key
- Navigate to the Emby Admin Dashboard (Cog in the top right)
- Select Api Keys from the side menu
- Select New Api Key from the top of the page
user_id
Via Web Interface
This is just an example, make sure you get your own personal user_id
- Navigate to the Emby Admin Dashboard (Cog in the top right)
- Select Users from the side menu
- Select the user you plan to use in HA from the list
- From the address bar you can get the user id http://emby_host_ip:8096/emby/web/index.html#!/users/user?userId=527563753xfd422288a32198522f821a
Via API Interface
- Navigate to http://emby_host_ip:8096/emby/Users/Public
- You will be provided a JSON response containing all the users details
- Find the Name attribute for your user in the results
- Next to the Name you will see an attribute name ServerId
- Next to the ServerId you will see Id - this is your user_id