Giter Site home page Giter Site logo

sensor.radarr_upcoming_media's Introduction

Radarr Upcoming Media Component

Home Assistant component to feed Upcoming Media Card with Radarr's upcoming added media.
This component does not require, nor conflict with, the default Radarr component.

Issues

Read through these two resources before posting issues to GitHub or the forums.



This product uses the TMDb API but is not endorsed or certified by TMDb.

If you're having issues, check out the troubleshooting guide before posting an issue or asking for help on the forums.

Installation:

  1. Install this component by copying these files to /custom_components/radarr_upcoming_media/.
  2. Install the card: Upcoming Media Card
  3. Add the code to your configuration.yaml using the config options below.
  4. Add the code for the card to your ui-lovelace.yaml.
  5. You will need to restart after installation for the component to start working.

Options

key default required description
api_key yes Your Radarr API key
host localhost no The host Radarr is running on.
port 7878 no The port Radarr is running on.
urlbase / no The base URL Radarr is running under.
days 60 no How many days to look ahead for the upcoming sensor.
ssl false no Whether or not to use SSL for Radarr.
theaters true no Show or hide theater releases.
max 5 no Max number of items in sensor.

Do not just copy examples, please use config options above to build your own!

Sample for configuration.yaml:

sensor:
  - platform: radarr_upcoming_media
    api_key: YOUR_API_KEY
    host: 127.0.0.1
    port: 7878
    days: 14
    ssl: false
    theaters: false
    max: 10

Sample for ui-lovelace.yaml:

- type: custom:upcoming-media-card
  entity: sensor.radarr_upcoming_media
  title: Upcoming Movies

Card Content Defaults

key default example
title $title "Night of the Living Dead"
line1 $release "In Theaters Mon, 10/31" if it's a theater release and more than a week away or "Available Monday" if it's a physical release and within a week.
line2 $genres "Action, Adventure, Comedy"
line3 $rating - $runtime "★ 9.8 - 01:30"
line4 $studio "Laurel Group Inc."
icon mdi:arrow-down-bold https://materialdesignicons.com/icon/arrow-down-bold

sensor.radarr_upcoming_media's People

Contributors

agneevx avatar davidfw1960 avatar jbassett avatar maykar avatar mkanet avatar pinkywafer avatar raman325 avatar xxinvictus 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensor.radarr_upcoming_media's Issues

radarr_upcoming_media: Error on device update

Describe the Bug
sensor not showing in states - radarr_upcoming_media: Error on device update

The Error
Traceback (most recent call last):
File "/config/custom_components/radarr_upcoming_media/sensor.py", line 183, in update
'780', tmdb_json['backdrop_path'])
IndexError: list assignment index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/radarr_upcoming_media/sensor.py", line 185, in update
movie['images'][1] = ''
IndexError: list assignment index out of range

Indicate if you followed all steps in the troubleshooting doc
All steps followed

What data does the sensor display if any?
Sensor is not displayed in states

What displays when visiting the API URL from the troubleshooting guide?
When visiting API URL info is displayed correctly

Does the default Home Assistant Radarr component work for you?
Yes, default component works

Home Assistant Version
0.104.3

Additional Context
``
radarr_issue

Images not showing

No images are showing in poster or fanart layout, they are working for the plex though...

I dont actually get an error, it's just that images are missing, everything else is okay.

HA is whitelisted in my adblocker.

Read both trouble shooting docs did the http://ip+api+start/end date test sucessfully

heres a snippet of the result for api/calendar:
Screen Shot 2021-02-20 at 6 20 28 AM

All the info is shown EXCEPT the images.
Screen Shot 2021-02-20 at 6 26 39 AM

Not using the default Home Assistant Radarr component
Home Assistant 2021.2.3 / Latest Docker Available on a Synology NAS

That's it!

thank you for your time, it's really appreciated!

Radarr

I'm seeing a lot of slow results for this sensor:

2018-10-11 21:59:39 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.radarr_upcoming_media is taking over 10 seconds
2018-10-11 22:00:09 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.radarr_upcoming_media is taking over 10 seconds
2018-10-11 22:00:40 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.radarr_upcoming_media is taking over 10 seconds

I have it set to show only 5 results in the next 30 days.

Digital Releases are not populating

On my Radarr Calendar I have a few upcoming releases. Some are "Phyiscal" release dates, some are "Digital" release dates and some are "Cinemas" release dates.

The "Digital" ones (which are the ones i care about the most) are not appearing in the upcoming card.

Radarr became broken, Sonarr is fine.

Radarr component stopped working with latest HASS upgrade

I have identical Radarr and Sonarr addons (port and API different of course).
Both have worked perfectly until latest HASS update. Now only Sonarr works, Radarr does not.

I followed all troubleshooting guides. I cannot directly access Sonarr via the command line query.
So this might be a Sonarr issue, but thought it shared same engine as Radarr which works fine.

No data appears because it gets a 404 error.

What displays when visiting the API URL from the troubleshooting guide?
Answered above.

Does the default Home Assistant Radarr component work for you?
Default component does not work either.

Home Assistant Version
What version of HA are you running?
2022.2.0

I'm going crazy because it worked fine, broke with zero changes to config file etc. just routine upgrades.

wiki info wrong?

On the wiki should:

this Install this component by copying these files to /custom_components/sonarr_upcoming_media/.

not be

Install this component by copying these files to /custom_components/radarr_upcoming_media/

? :)

Radarr Data Not Populating

Describe the Bug
I can get Sonarr working, but Radarr doesn't work. The built-in integration for Radarr works fine. The sensor reports 'Online'.

The Error
I don't get an error, just no results.

Indicate if you followed all steps in the troubleshooting doc
Yes, and when I put in a manual URL it works as expected:

http://10.1.200.1:7878/api/calendar?apikey=3a2611d25472470e97319835f1d5f46c&start=2021-10-31&end=2022-05-15

What data does the sensor display if any?
The state attributes of the sensor.radarr_upcoming_media is:

data:
  - title_default: $title
    line1_default: $release
    line2_default: $genres
    line3_default: $rating - $runtime
    line4_default: $studio
    icon: mdi:arrow-down-bold
friendly_name: Radarr_Upcoming_Media

What displays when visiting the API URL from the troubleshooting guide?
Full JSON report of all upcoming movies.

Does the default Home Assistant Radarr component work for you?
Works perfectly.

Home Assistant Version
core-2021.11.5

Additional Context
Sensor config:

- platform: radarr_upcoming_media
  api_key: 3a2611d25472470e97319835f1d5f46c
  host: 10.1.200.1
  port: 7878
  days: 14
  ssl: false
  theaters: false
  max: 10

Fanart - IndexError: list index out of range

Describe the Bug
Index out of bounds error

The Error
hass[2263]: 2020-05-13 09:57:10 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up radarr_upcoming_media platform for sensor
hass[2263]: Traceback (most recent call last):
hass[2263]: File "/opt/Homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
hass[2263]: await asyncio.gather(*pending)
hass[2263]: File "/opt/Homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
hass[2263]: await asyncio.gather(*tasks)
hass[2263]: File "/opt/Homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 445, in _async_add_entity
hass[2263]: entity.async_write_ha_state()
hass[2263]: File "/opt/Homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
hass[2263]: self._async_write_ha_state() # type: ignore
hass[2263]: File "/opt/Homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 324, in _async_write_ha_state
hass[2263]: attr.update(self.device_state_attributes or {})
hass[2263]: File "/home/groot/Documents/Home_Assistant/custom_components/radarr_upcoming_media/sensor.py", line 121, in device_state_attributes
hass[2263]: if '.jpg' in movie['images'][1]:
hass[2263]: IndexError: list index out of range

Indicate if you followed all steps in the troubleshooting doc
Yes

What data does the sensor display if any?
Displays nothing because sensor fails to be setup during Home Assistant staring procedure

Does the default Home Assistant Radarr component work for you?
Yes

Home Assistant Version
0.109.4

Additional Context
Not every movie from radarr returns more than one image url. Need an array length check or use first element as default. Tested the below code change and the sensor functions normally

From:
if '.jpg' in movie['images'][1]: card_item['fanart'] = movie['images'][1]

To:
if '.jpg' in movie['images'][0]: card_item['fanart'] = movie['images'][0]

Error in 2021.12.7 and later

Describe the Bug
Radarr_upcoming_media sensor not loading

The Error

2022-01-05 18:34:40 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform radarr_upcoming_media
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in _async_write_ha_state
    extra_state_attributes = self.extra_state_attributes
  File "/config/custom_components/radarr_upcoming_media/sensor.py", line 113, in extra_state_attributes
    if 'ratings' in movie and movie['ratings']['value'] > 0:
KeyError: 'value'
2022-01-05 18:34:40 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up radarr_upcoming_media platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in _async_write_ha_state
    extra_state_attributes = self.extra_state_attributes
  File "/config/custom_components/radarr_upcoming_media/sensor.py", line 113, in extra_state_attributes
    if 'ratings' in movie and movie['ratings']['value'] > 0:
KeyError: 'value'

Indicate if you followed all steps in the troubleshooting doc
Well, did you? Yes

What data does the sensor display if any?
Feel free to censor information pertaining to titles, networks, etc.

What displays when visiting the API URL from the troubleshooting guide?
Feel free to censor information pertaining to titles, networks, etc.
I get valid data from the API (v3 of API)
Does the default Home Assistant Radarr component work for you?
This is important to know, helps rule out issues with your Radarr installation.
It doesn't the current core API is broken as it uses the older API etc. A PR to fix it for APIv3 is pending merge and I have a dev version of it that is working correctly
Home Assistant Version
What version of HA are you running?
2021.12.8
Additional Context
Add any other context about the problem here.
this only broke in the .7 release I think it was fine before that. Sonarr is working fine and seems to have similar code?

Error when inCinemas isnt populated

Describe the Bug
When inCinemas isnt populated in the API, an error is returned

The Error

2020-07-18 16:56:07 ERROR (MainThread) [homeassistant.components.sensor] radarr_upcoming_media: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 319, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    self.update  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/radarr_upcoming_media/sensor.py", line 187, in update
    if days_until(movie['inCinemas'], self._tz) > -1:
KeyError: 'inCinemas'

Indicate if you followed all steps in the troubleshooting doc
Yes

What data does the sensor display if any?
None

What displays when visiting the API URL from the troubleshooting guide?

{
title: "Irresistible",
alternativeTitles: [
{
sourceType: "tmdb",
movieId: 324,
title: "Неотразимый",
sourceId: 0,
votes: 0,
voteCount: 0,
language: {
id: 11,
name: "Russian"
},
id: 2661
}
],
secondaryYearSourceId: 0,
sortTitle: "irresistible",
sizeOnDisk: 4222873587,
status: "released",
overview: "A Democratic political consultant helps a retired Marine colonel run for mayor in a small, conservative Wisconsin town.",
physicalRelease: "2020-09-14T00:00:00Z",
images: [
{
coverType: "poster",
url: "https://image.tmdb.org/t/p/original/izGiAbtC2lmGk3bbV5t3OowJhtP.jpg"
},
{
coverType: "fanart",
url: "https://image.tmdb.org/t/p/original/eZ8eK0moqUo6Vwq08OK1POfyUF5.jpg"
}
],
website: "https://www.focusfeatures.com/irresistible",
downloaded: true,
year: 2020,
hasFile: true,
youTubeTrailerId: "0vhaAoSm1NY",
studio: "Focus Features",
path: "/movies/Irresistible (2020)",
profileId: 1,
monitored: true,
minimumAvailability: "announced",
isAvailable: true,
folderName: "/movies/Irresistible (2020)",
runtime: 101,
lastInfoSync: "2020-07-14T17:10:40.1817231Z",
cleanTitle: "irresistible",
imdbId: "tt9076562",
tmdbId: 595148,
titleSlug: "595148",
certification: "R",
genres: [
"Comedy",
"Drama"
],
tags: [ ],
added: "2020-06-16T23:43:08.2354507Z",
ratings: {
votes: 46,
value: 6.6
},
movieFile: {
movieId: 0,
relativePath: "Irresistible (2020) WEBDL-1080p.mkv",
size: 4222873587,
dateAdded: "2020-06-26T09:18:55.9476703Z",
releaseGroup: "EVO",
quality: {
quality: {
id: 3,
name: "WEBDL-1080p",
source: "webdl",
resolution: 1080,
modifier: "none"
},
revision: {
version: 1,
real: 0,
isRepack: false
}
},
edition: "",
mediaInfo: {
containerFormat: "Matroska",
videoFormat: "AVC",
videoCodecID: "V_MPEG4/ISO/AVC",
videoProfile: "High@L4",
videoCodecLibrary: "",
videoBitrate: 5133577,
videoBitDepth: 8,
videoMultiViewCount: 0,
videoColourPrimaries: "BT.709",
videoTransferCharacteristics: "BT.709",
width: 1800,
height: 1080,
audioFormat: "AC-3",
audioCodecID: "A_AC3",
audioCodecLibrary: "",
audioAdditionalFeatures: "",
audioBitrate: 384000,
runTime: "01:42:00.8000000",
audioStreamCount: 1,
audioChannels: 6,
audioChannelPositions: "3/2/0.1",
audioChannelPositionsText: "Front: L C R, Side: L R, LFE",
audioProfile: "",
videoFps: 23.976,
audioLanguages: "English",
subtitles: "",
scanType: "Progressive",
schemaRevision: 5
},
id: 254
},
qualityProfileId: 1,
id: 324
},

Does the default Home Assistant Radarr component work for you?
Yes

Home Assistant Version
0.112.4

Additional Context
Add any other context about the problem here.

Not receiving any data

The component seems to be working, but I do not receive any data, while there are upcoming movies.

Seems to be the same as described here: custom-cards/upcoming-media-card#20

configuration.yaml

sensor:
  - platform: radarr_upcoming_media
    api_key: !secret radarr_api
    host: 192.168.2.2
    port: 7878
    theaters: false
    days: 300
    max: 10

Indicate if you followed all steps in the troubleshooting doc
Sure

What data does the sensor display if any?
Status: online
Attributes: data: [{"title_default": "$title", "line1_default": "$release", "line2_default": "$genres", "line3_default": "$rating - $runtime", "line4_default": "$studio", "icon": "mdi:arrow-down-bold"}]
friendly_name: Radarr_Upcoming_Media

What displays when visiting the API URL from the troubleshooting guide?
[ { "title": "Artemis Fowl", "alternativeTitles": [], "secondaryYearSourceId": 0, "sortTitle": "artemis fowl", "sizeOnDisk": 0, "status": "announced", "overview": "With the help of his loyal protector Butler, 12-year-old genius Artemis Fowl, descendant of a long line of criminal masterminds, seeks to find his mysteriously disappeared father, and in doing so, uncovers an ancient, underground civilization—the amazingly advanced world of fairies. Deducing that his father’s disappearance is somehow connected to the secretive, reclusive fairy world, cunning Artemis concocts a dangerous plan—so dangerous that he ultimately finds himself in a perilous war of wits with the all-powerful fairies.", "inCinemas": "2020-06-11T22:00:00Z", "physicalRelease": "2020-06-12T00:00:00Z", "images": [ { "coverType": "poster", "url": "/radarr/MediaCover/887/poster.jpg" }, { "coverType": "fanart", "url": "/radarr/MediaCover/887/fanart.jpg" } ], "website": "", "downloaded": false, "year": 2020, "hasFile": false, "youTubeTrailerId": "wXlBep9uFjI", "studio": "Tribeca Productions", "path": "E:\\Movies\\Artemis Fowl (2020)", "profileId": 6, "pathState": "static", "monitored": true, "minimumAvailability": "released", "isAvailable": false, "folderName": "E:\\Movies\\Artemis Fowl (2020)", "runtime": 0, "lastInfoSync": "2020-05-15T00:57:07.3343431Z", "cleanTitle": "artemisfowl", "imdbId": "tt3089630", "tmdbId": 475430, "titleSlug": "artemis-fowl-475430", "genres": [], "tags": [], "added": "2020-05-13T13:20:55.8897037Z", "ratings": { "votes": 0, "value": 0.0 }, "qualityProfileId": 6, "id": 887 } ]

Does the default Home Assistant Radarr component work for you?
Yes, works fine. As a state I get a full list of all my movies.

Home Assistant Version
HassOS 3.13

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.