Lovelace: Upcoming Media Card

Are you using storage or yaml mode?

yaml mode!

Think I see the issue. You have entity: sensor.plex_upcoming_media in your card config, but the sensor is actually called sensor.plex_recently_added

Wow, you have a sharp eye, it works!!

Thanks for your help,

Greetings,
Harry

1 Like

Great module! :slight_smile:

1 Like

Hi, tried setup Plex and Trakt but get errors on both :frowning:

Tried going trough all previous posts, but couldn’t find a solution.

Plex:
I don’t get any sensor but get downloaded posters in www/custom-lovelace/upcoming-media-card/images/plex.
My log shows this error:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 365, in _async_add_entity
await entity.async_update_ha_state()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 225, in async_update_ha_state
self._async_write_ha_state()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 256, in _async_write_ha_state
device_attr = self.device_state_attributes
File “/config/custom_components/plex_recently_added/sensor.py”, line 139, in device_state_attributes
media.get(‘parentIndex’, ‘’), media.get(‘index’, ‘’))
ValueError: Unknown format code ‘d’ for object of type ‘str’

Trakt
I get my sensor but it’s quite empty - only the number of shows (state) is correct.

data: [{“title_default”: “$title”, “line1_default”: “$episode”, “line2_default”: “$release”, “line3_default”: “$rating - $runtime”, “line4_default”: “$number - $studio”, “icon”: “mdi:arrow-down-bold”}]
unit_of_measurement: shows
friendly_name: Trakt Upcoming Calendar
icon: mdi:calendar

Hope anybody can help.

For Plex could you follow the troubleshooting guide to get the raw api response and PM it to me. It looks like you have a show that’s reporting something strange for it’s season or episode number.

Unsure about trakt, any idea @iantrich?

@onkelfarmor what version of HA are you on?

@iantrich Hass.io 91.4 - also didn’t work on 91.3.

Can you log your issue on the trakt plugin github repo so I can better track this and provide as much detail as possible? Thanks.

@iantrich done

Updated my components for Radarr, Sonarr, and Plex with a __init___.py file for changes in 0.92.0. Also a small fix for Plex to fix image downloading in some cases.

2 Likes

Just updated to 0.92
Even after updating your components I still get these errors:
Integration radarr_upcoming_media not found when trying to verify its sensor platform.
Integration sonarr_upcoming_media not found when trying to verify its sensor platform.
Integration plex_recently_added not found when trying to verify its sensor platform.

I ran into the same issue myself and a system reboot cleared it up.

Even after a reboot… same issue. Any troubleshooting tips?

Couple of things to try.

Make sure there is a file called __init__.py in the same folder as sensor.py for each component. If not either grab the one off github or create your own blank file called __init__.py in those folders.

Delete the __pycache__ folder in each of the components folders.

Reboot

I did exactly that! Created ‘init.py’ in all 3 folders and rebooted. I don’t see any ‘pycache’ files using configurator.

After 3 reboots it now works again! Thanks for replying anyway!

I upgraded to 0.92 and it broke this card. I sse this in the logs

Unable to set up dependencies of kodi_recently_added. Setup failed for dependencies: kodi
Unable to prepare setup for platform kodi_recently_added: Could not set up all dependencies.

I tried adding the kodi component but it didn’t help…

I see this in states as well…

title: Invalid config
message: The following components and platforms could not be set up:

  • kodi
  • kodi_recently_added.sensor

Please check your config.

1 Like

I released a new version that may fix the issue. I haven’t yet upgraded to 0.92 so I’m unable to test if the fix worked in v0.2.4. Give that a try. If it does not could you open up an issue on github with all pertinent information? https://github.com/custom-components/sensor.kodi_recently_added/issues