Lovelace: Upcoming Media Card

Thanks for taking the time to help. I FINALLY figured it out For some reason when I hit the copy API button it left out the last character:man_facepalming::man_facepalming::man_facepalming:

Well that will do it lol…

Trying to add the sonarr card, not sure why it can’t be found, i can navigate to http://192.168.1.246:8123/local/custom_components/sensor/sonarr_upcoming_media.py
this is what my sensor.yaml file looks like, i have other sensors in here that work fine…

  - platform: sonarr_upcoming_media
    api_key: e69debdbf70d4be2b229aeda8201a975
    host: 192.168.1.189
    port: 8989
    days: 7
    ssl: false
    max: 10

Components do not go in the /www/ folder. Take it out of that folder and put it one level up. You currently have it here /www/custom_components/sensor/sonarr_upcoming_media.py

Needs to go here: /custom_components/sensor/sonarr_upcoming_media.py

i feel dumb! lol, got it thanks, anychance are you good with rasberry pi’s?

My setup used to be on a raspberry pi, but it would be far better to either find a thread relevant to your question or make a new one. Much more likely to get the help you need.

why am i getting this? Integrations need to be in their own folder. Change sensor/sonarr_upcoming_media.py to sonarr_upcoming_media/sensor.py. This will stop working soon.

i just tried to add the plex component

That is warning of an upcoming breaking change to how custom_components should be named/placed in HA. I quite literally just updated all my components github readme’s and directories to reflect the changes.

1 Like

Hello
I am trying to make a custom feeder for the upcoming media card. The attributes looks like this:

However, the card crashes with this info

What’s the error?

my json value dropped the _ in the default_title, etc. So I edited the card to use it without the _.

1 Like

Hello everyone, any chance to monitor the emby?

I just took a look at the emby API and it’s definitely possible, but no upcoming media component exists for emby yet. This card is open for other developers to create components for it, but I do not use emby myself.

Can somebody show me how to write a script to loop inside the data[] and take out only show “titles” in one sensor and show “titles” with an arrow “icon” in a different one?

thank you.

I made a component for the upcoming media card for SageTV: https://github.com/jdeath/SageTVHomeassistant

Due to the way SageTV does json, I cannot use “_” ,so I had to edit your code. I am not good with github, so the change I needed for a different field name is below

const title_text = this.config.title_text || json[0]['titledefault'];
const line1_text = this.config.line1_text || json[0]['line1default'];
const line2_text = this.config.line2_text || json[0]['line2default'];
const line3_text = this.config.line3_text || json[0]['line3default'];
const line4_text = this.config.line4_text || json[0]['line4default'];

So, I have the same exact problem after moving plex server to a nuc. Everythong worked with the card on rpi. Added new port and token to sensor config but shows up empty. Going to link shows up plenty. So same behaviour.

Any suggestion?

I would suggest just editing the JSON key’s in your sensor.

If I recall correctly the issue Daniel was having was with using localhost rather than a direct URL, so it doesn’t sound like your issue is related. If you use the default HA plex component with the same info does it work as expected?

For some reason no plex sensor comes up with official component. Strange, same setup worked when server was on rpi.

Hi there. Trying to get Upcoming media card working here, I got the Plex connection working, and have a filled “sensor.plex_recently_added”.

In ui-lovelace.yaml I put:
resources:

  • url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.3.4
    type: js

And a seperate title to try it out:

  • title: Plex
    icon: mdi:music
    cards:
    • type: custom:upcoming-media-card
      entity: sensor.plex_upcoming_media
      title: Recent gedownload

Now I get no errors, but just an empty card with the title showing. All the standard troubelshooting done.

Running on a RPI3 with hass.io, no other weird stuff happening.

Any ideas?

Greetings,
Harry Westerman

PS first part of the data in the sensor:
data: [{“title_default”: “$title”, “line1_default”: “$episode”, “line2_default”: “$release”, “line3_default”: “$number - $rating - $runtime”, “line4_default”: “$genres”, “icon”: “mdi:eye-off”}, {“airdate”: “2019-03-31T11:58:54Z”, “aired”: “2018-04-11”, “release”: “$day, $date $time”, “flag”: true, “title”: “The Expanse”, “episode”: “Fight or Flight”, “number”: “S03E01”, “runtime”: 43, “rating”: “\u2605 7.7”, “poster”: “/local/custom-lovelace/upcoming-media-card/images/plex/p9552.jpg”, “fanart”: