Lovelace: Upcoming Media Card

One more thing while I’m trying to get all this fixed. Does anyone else have an issue with chrome showing Sonarr images.

I have a lot of custom css here, but its the same across all three integrations. So I can only assume its got something to do with Sonarr.

The other browser is edge

Ad blocker blocking the images I think. I had similar till I whitelisted HA.

I unblocked HA altogether.

HAHA, you’re right! Thank you :slight_smile:

When you said that, I was like no way! But lo and behold LOL

1 Like

I’m trying to use HA to send a noticifation when the recently added changes… In order to do this i thought i would make a sensor with the title of the most recently added serie.

  - platform: template
    sensors:
      plex_added_tv_title:
        friendly_name: "Plex added TV Serie Title"
        value_template: "{{ state_attr('sensor.recently_added_tv', 'title') }}"         

but it will not get the attribute data, i thin nk bacasue it is in a list item…

	data: 
- title_default: $title
  line1_default: $episode
  line2_default: $release
  line3_default: $number - $rating - $runtime
  line4_default: $genres
  icon: mdi:eye-off
- airdate: '2022-03-03T09:25:24Z'
  aired: '2022-03-03'
  release: $day, $date $time
  flag: true
  title: 'Star Trek: Picard'
  episode: The Star Gazer
  number: S02E01
  runtime: 55
  rating: ''
  poster: /local/upcoming-media-card-images/plex/Recently_Added_TV/p1727.jpg
  fanart: /local/upcoming-media-card-images/plex/Recently_Added_TV/f1727.jpg

In this case im trying to get the picard mention…any advise on how to do this?

If the data attribute is a list you could do:

value_template: "{{ state_attr('sensor.recently_added_tv', 'data')[1].title }}"

But it’s possible the data attribute is a json string, you’ll know if you the value ends up being a string representation of the title method, e.g. <built-in method title of str object at 0x7f6834efb9f0>.

Just added this card to pull latest info in from kodi. However when i add the card to my dashboard all the cards disapper and i get the following error in my log

https://xxx/local/lovelace/upcoming-media-card.js?v=0.4.3:16:88 SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

I have installed this manually, i dont use HACS. I have added the version at the end of the JS module name in my resources. Any idea?

Edit: ignore that. Seems my kodi integration needed removing and re-adding. Odd it removed every card from the dashboard when it failed to load.

thanks to @nfs for sharing the code of your layout. I took that as a base and restructured it to fit into a standard Lovelace card for use with mobile dashboards.

Still playing with the layout but seems to work across different providers that ive tested (trakt, kodi). Using Flex layout for the grid so naturally flows.

3 Likes

Is anyone else having trouble since the april update?

The UMC won’t display at all with an HTML error. It’s been reported almost a month ago but i’m not sure anyone found a solution yet. (github link :UMC prevents an entire view to display in 2022.4 · Issue #82 · custom-cards/upcoming-media-card · GitHub)

Could you please share your code for this?

Hello. Sorry for the inconvenience. I am having problems with the recently added integration that brings me empty data. When I install the integration it is installed with this name “plex_recently_added”. Could it be that it doesn’t work for me? How do you change the name of the integration? I installed it from hacs but I don’t know if I can do that. I can’t find a solution to my problem.
When I hit the url with the token it returns an xml. I think that indicates it’s okay. At least the token right?
I also don’t know if this address should return this little information to me. But the server responds

http://192.168.1.2:32400/library/recentlyAdded?X-Plex-Token=xxxx

<MediaContainer size="0" allowSync="0" identifier="com.plexapp.plugins.library" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1652162132" mixedParents="1"> </MediaContainer>

But this url gives me error 404

http://192.168.1.114:32400/library/metadata/147?X-Plex-Token=xxxxx

Thank you very much

For integrations that are not installed from hacs. Do we have to put the version number when we add the library? Yes that’s how it is. How do you find out which is the latest version? Thank you

The version number is unimportant it just simply has to be different in order to break the cache in the browser for the card. Version can literally be anything that is different

ok. Thanks

It looks like the repository has now been archived. https://github.com/custom-cards/upcoming-media-card

What does this mean? I am getting to same error with plex recently added, sonarr and kiosk mode

Just remove them from hacs and manually install them. There wont be any updates anyway. Backup the cards folder and remove from hacs and then restore the backup folder and edit the resource.

1 Like

Any possibility to share your code?

im really struggling to get manual install to work. custom element does not exist and the js file is in the right place and resources is set correctly. dont know what latest version is but dont think thats the issue. cache cleared, system restarted, tried another browser etc.

@Littlejoe
I also did this yesterday.
I put the js file to: www\custom-lovelace\upcoming-media-card
I clicked on configure in any UI page and then on the 3 dot menu “Manage ressources”
I added /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.4.3 and selected JavaScript module. As 0.4.3 was the latest release

I installed Plex recently added and added this code to one view:
type: custom:upcoming-media-card entity: sensor.recently_added_movies title: Recently Downloaded

1 Like