Depreciated! Lovelace: Sonarr Upcoming

never mind I just missed it, it’s there and seems functional:

thats not it, that’s the HA default sonarr sensor. it will be “sensor.sonarr_upcoming_card”
try a restart and make sure the component is installed like this:

custom_components/sensor/sonarr_upcoming_card.py

oh right sorry…
I double checked everything, should be fine…
I have other custom components and they’re fine.

I’ll try keep looking in case I missed something obvious…

ok, I got it to work, I simply changed it so it is not in its own folder (just personal preference) and corrected the spacing

title: Home
resources:
  - url: /local/custom-lovelace/sonarr-upcoming-card.js
    type: js

It’s my stupid fault, I had it like that:

title: Home
resources:
- url: /local/custom-lovelace/sonarr-upcoming-card.js
  type: js

Looks nice :slight_smile:
Need Radarr now lol
Nice work, simple but nice

1 Like

Ok I must be stupid as well. I’m getting the same error as sfnetwork was. I’m running HassIO. Will that make a difference?

My folder structure:
\192.168.1.198\config\www\custom-lovelace\sonarr-upcoming-card
\192.168.1.198\config\custom_components\sensor

Would that not be accurate? Here my my lovelace YAML:

title: Home
resources:
  - url: /local/custom-lovelace/sonarr-upcoming-card/sonarr-upcoming-card.js
    type: js

That sounds right. These files should exist:

/config/custom_components/sensor/sonarr_upcoming_card.py
/config/www/custom-lovelace/sonarr-upcoming-card/sonarr-upcoming-card.js

Something like this should be in your config and you need to restart after adding it:

sensor:
- platform: sonarr_upcoming_card
  api_key: YOUR_API_KEY
  host: 192.168.1.4
  port: 8989
  days: 2
  ssl: true

In your lovelace yaml at the top:

resources:
- url: /local/custom-lovelace/sonarr-upcoming-card/sonarr-upcoming-card.js
  type: js

and later in your lovelace yaml:

  cards:
    - type: custom:upcoming-media-card

Pretty sure either of the spacings there are correct. I have mine like your second example and it works fine. Glad you got it working though!

I get a score of 0

Confirmed the files are in the right path. I’ve rebooted a dozen times already. My configuration has a “!include sensors.yaml” where I then references the sensor. Not sure why it’s not working at this point.

lovelace-2 sensors

1 Like

Does the sensor exist? Look in dev tools > dev state.

It does not. (I’ve had the regular Sonarr addon working prior to this, which is now disabled)

How many days ahead is the sensor configured to look? If it’s not configured it would just be the default 7. Can you confirm that there are episodes to be released during the time frame? Do you use the default sonarr upcoming sensor? Does it show any upcoming episodes?

Thanks for the answer - I changed to 20 days back and it works.

There’s something new about the movie plugin :slight_smile:

Are you getting any other errors besides “Cannot read property ‘state’ of undefined” ?
For some reason the component isn’t loading, but beyond that I am at a loss.

Log Details (ERROR)

Thu Aug 30 2018 12:31:53 GMT-0500 (Central Daylight Time)

https://xxxx:8123/local/custom-lovelace/sonarr-upcoming-card/sonarr-upcoming-card.js:25:43 Uncaught TypeError: Cannot read property ‘state’ of undefined

Also, yes - I just re-enabled the regular Sonarr addon and changed days to 7. Lots of episodes upcoming, but still the error I listed above.

Yup, that just tells us what we already know. The component isn’t loading. Only things I could suggest would be to double check your indentation and make sure the component is inside the sensor folder which is inside the custom-components folder. The component is just a slight modification of the regular Sonarr component, so if it works then mine should too. Another thing you could try would be to view the RAW code of the component on github here and copy and paste that into the component on your system. Maybe when installing you copied from the displayed code and not the raw?

Thanks. I’ve quadruple checked everything and still no idea. Thanks for your help with this. If you’re really interested, I can zip up my configuration.yaml, sensors.yaml, lovelace-ui.yaml and PM you so you can take a look.

Go for it, I like a good puzzle!