This Home Assistant component is used to feed custom cards like Upcoming Media Card and Kodi Playlist Card with data coming from Kodi. It is based on the project of Aaron Godfrey (https://github.com/boralyl/kodi-recently-added). Check the credits section.
- Kodi Recently Added Media for Home Assistant
- Table of Contents
NOTE: This component has been tested with Home Assistant 2021.1.3 only. Additionally Kodi must be setup via the UI in the integrations section of the Home Assistant configuration.
- Search for
Kodi Media Sensors
underIntegrations
in the HACS Store tab. - You will need to restart after installation for the component to start working.
- Go to Integration Installation your sensor using the options.
** This method is not recommended **
- In your
/config
directory, create acustom_components
folder if one does not exist. - Copy the kodi_media_sensors folder and all of it's contents from to your
custom_components
directory. - Restart Home Assistant.
- Go to Integration Installation your sensor using the options.
- After Automatic install or manual install, go to the Integration panel (under Configuration section) and search for the ne component by clicking on the button 'Add Integration'. Enter the name of the component (Kodi Media Sensors).
- During the installation, choose the Kodi entity previously installed.
- Select the sensors you want to use (see Available Sensors)
- Click Submit
- You should now see new entities in Home Assistant (one for each sensor activated)
It's not possible to add new sensors after installation, so if you need new ones (or if you don't need one anymore), just uninstall the integration and add it again. You will then be able to select the sensors you need.
An Options
button will appear on the integration. Clicking this will allow you to
toggle additional options. Currently the only option is whether or not the "recently added" should
ignore watched media or not. By default it does not.
Depending on the sensors you added and the custom card you installed, you can use the code below to display information from Kodi.
Here two examples with Upcoming Media Card and Kodi Playlist Card
- type: custom:upcoming-media-card
entity: sensor.kodi_recently_added_tv
title: Recently Added Episodes
image_style: fanart
- type: custom:kodi-playlist-card
entity: sensor.kodi_playlist
sensor.kodi_recently_added_tv
tracks your recently added tv showssensor.kodi_recently_added_movies
tracks your recently added moviessensor.kodi_playlist
tracks your playlist in Kodi (audio and video)
- Remove any sensors in your
configuration.yaml
that reference thekodi_media_sensors
platform. - Restart Home Assistant.
- Follow the steps from the begining in the section Installation
Below is a list of known issues that either can't be fixed by changes to the component itself due to external factors.
One reason this could occur is if you setup you Home Assistance instance to use SSL and your Kodi instance does not use SSL. When the upcoming-media-card tries to load the artwork it will fail to do so since modern browsers do not allow loading insecure requests. See #6 for more details and possible workarounds.
Currently genres, rating, and studio are only populated for Movies. This is a limitation of the data Kodi stores for TV shows.
Aaron Godfrey is the original developer of this project and did an excellent job. As I needed something similar to display my running playlist in Kodi, I started to enhance the component. Thanks a lot Aaron for letting me enhance your project! Let's hope other people might find it useful. Do not hesitate to support Aaron and his many projects.