Lovelace: Upcoming Media Card


#309

hi all

sorry for being stupid here, but for some reason i cant get the card to show up or work.

my sonarr sensor working correctly, but the custom media sensor not showing.

my config in lovelace.yaml as follows
resources:
- url: /local/custom_ui/mini-media-player.js
type: module
- url: /local/custom_ui/button-card.js
type: module
- url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.3.3
type: js

it is almost like HA is not picking up the card. i have double checked the path and all looks fine.


#310

When posting your code, please use codeblocks (see top of any forum page).

Follow steps here and report back: Troubleshooting


#311

Hi! i have done everything like descripded and i only get this;

Please define service type

{
  "type": "custom:upcoming-media-card",
  "entity": "sensor.sonarr_upcoming",
  "date": "ddmm",
  "image_style": "poster"
}

What am i doing wrong?
here is my code in lovelace.yaml

    icon: mdi:plex
    background: center / cover no-repeat url("/local/background-15.gif") fixed
    name: Sonarr
    cards:
      - type: custom:upcoming-media-card
        entity: sensor.sonarr_upcoming
        date: ddmm
        image_style: poster

#312

That isn’t the sensor for this card, that is the default HA sensor. Please checkout the trouble shooting guide one post above yours.


#313

Sorry about that! Got it to work.
Looks awesome :slight_smile:


#314

Hey @mayker Thank you for the awesome component. I finally switched everything over to Sonarr and Radarr when my Synology crashed, and have been using your card for a while now.

I have a slight problem though, I keep getting timeout/not available errors in the HA log now and again. The card works fine, they show up, update no problems. I have HA running in a docker container, and also have sonarr and radarr running on the same host, also in docker containers.

It would possibly be user error on my behalf, but was just wondering if you might have any insight as to what might be up.

Many thanks in advance.

Host 10.0.0.2 is not available
6:17 PM custom_components/sensor/sonarr_upcoming_media.py (WARNING)
Update of sensor.sonarr_upcoming_media is taking over 10 seconds
6:17 PM util/async_.py (WARNING)
Host 10.0.0.2 is not available
6:17 PM custom_components/sensor/sonarr_upcoming_media.py (WARNING)
Update of sensor.sonarr_upcoming_media is taking over 10 seconds
6:17 PM util/async_.py (WARNING)
Host 10.0.0.2 is not available
6:01 PM custom_components/sensor/sonarr_upcoming_media.py (WARNING)
Update of sensor.sonarr_upcoming_media is taking over 10 seconds
6:01 PM util/async_.py (WARNING)
Host 10.0.0.2 is not available
6:00 PM custom_components/sensor/radarr_upcoming_media.py (WARNING)
Update of sensor.radarr_upcoming_media is taking over 10 seconds
6:00 PM util/async_.py (WARNING)
Host 10.0.0.2 is not available
6:00 PM custom_components/sensor/radarr_upcoming_media.py (WARNING)
Update of sensor.radarr_upcoming_media is taking over 10 seconds
6:00 PM util/async_.py (WARNING)
Host 10.0.0.2 is not available
5:52 PM custom_components/sensor/radarr_upcoming_media.py (WARNING)
Update of sensor.radarr_upcoming_media is taking over 10 seconds
5:52 PM util/async_.py (WARNING)
Host 10.0.0.2 is not available
5:51 PM custom_components/sensor/radarr_upcoming_media.py (WARNING)
Update of sensor.radarr_upcoming_media is taking over 10 seconds
5:51 PM util/async_.py (WARNING)

#315

If they’re still functioning, it could be that the api’s are just slow to respond. Something you could try:

Find this line in the components ( line 146 for sonarr and line 141 for radarr):

headers={'X-Api-Key': self.apikey}, timeout=10)

And increase the timeout by a few seconds until you no longer see the error, i.e:

headers={'X-Api-Key': self.apikey}, timeout=15)

You’ll probably still see the following error, but unfortunately there’s not much I can do about that. Will look into it though.:

Update of sensor.radarr_upcoming_media is taking over 10 seconds

Report back if it works out for you, might add it to config options.


#316

Thank you for the reply @mayker I have adjusted the timeout code to 15 and given HA a restart and lets see what happens.


#317

Great job on the component @mayker… really sleek look and feel. For those of us not using any download or media player application it would be great to hook into all upcoming shows sans Sonarr/Radarr/Plex.


#318

Though it might be a bit overkill for essentially a media calendar, you can use radarr and sonarr to do just that. Just don’t setup the download portion and add your shows.


#319

My card is open for others to create components for it and there is a trakt sensor that currently has an issue to make it compatible with this card, but im not sure of the status.


#320

True. I used to use Sonarr… only problem is I’ll need to have a permanent instance up and running (which I’m OK with if I can get it to run within Hass.io).


#321

Will look into options for this, whether it’s creating a new custom component or adding a PR to the trakt component. Can’t really say it’ll be soon, but it’s on my list.


#322

Thanks man that would be awesome… no rush though :slight_smile:


#323

I’ve had a go at setting this up but don’t seem to be having much luck.

In dev-state the sensor gives me:

Entity: [sensor.plex_recently_added]
State: Online
Attributes: data: [{"line2_default": "$release", "title_default": "$title", "line1_default": "$episode", "icon": "mdi:eye-off", "line4_default": "$genres", "line3_default": "$number - $rating - $runtime"}] friendly_name: Plex_Recently_Added

And going to http://[IP]:[port]/library/recentlyAdded?X-Plex-Token=[token] returns plenty of listings/data

My card config in Lovelace is:

    - type: custom:upcoming-media-card
      entity: sensor.plex_recently_added
      title: Recently Downloaded

But all I get is an empty card, no errors in the logs or console.
image


#324

Will look into options for this, whether it’s creating a new custom component or adding a PR to the trakt component . Can’t really say it’ll be soon, but it’s on my list.

I’ve been meaning to make my trakt component work with your card, will start working on that tonight :slight_smile: Thanks for the prompt


#325

the custom card isn’t showing in the updater anymore (the components are though).


#326

@mynameisdaniel - Feel free to PM me the first few results from http://[IP]:[port]/library/recentlyAdded?X-Plex-Token=[token] and I’ll take a look, unsure what’s going on there. With no errors and status online you should be getting something, unless nothings been recently downloaded, but as you said the URL returns info.

@iantrich - Awesome! Let me know if you have any questions or need anything changed on my side to accommodate.

@DavidFW1960 - Nothing on my side has changed in 2 months and tracker card/custom updater haven’t been updated in 3 months, so I couldn’t tell you what’s going on there. Might want to ask on that component/cards post/github.


#327

I don’t think it’s reading a JSON file with the version information anymore. It seems to only be seeing cards that I added in config manually. The components are ok…
image
@thomasloven 's cards are missing as well.


#328

Probably best to place an issue on that projects github page or talk to @ludeeus