Skip to content

"undefined" is not valid JSON. #42

@Phyxsius7

Description

@Phyxsius7

Describe the Bug
When defining entity in card, the following error occurs
"undefined" is not valid JSON.

The Error
Copy and paste the full error from Home Assistant

Indicate if you followed all steps in the troubleshooting doc
Yes, I did followed these instructions.

What data does the sensor display if any?
No error message

What displays when visiting the API URL from the troubleshooting guide?
[
{
"seriesId": 629,
"episodeFileId": 12987,
"seasonNumber": 5,
"episodeNumber": 1,
"title": "Syr",
"airDate": "2024-10-03",
"airDateUtc": "2024-10-02T15:30:00Z",
"overview": "Syr is not the only one who has feelings for Bell. When she notices the shift in her friend’s behavior, she asks Ryu a question that shakes the elf to the core.",
"episodeFile": {
"seriesId": 629,
"seasonNumber": 5,
"relativePath": "Season 5\Is It Wrong to Try to Pick Up Girls in a Dungeon! - S05E01 - Syr WEBDL-1080p.mkv",
"path": "D:\Video\TV Shows\Is It Wrong to Try to Pick Up Girls in a Dungeon!\Season 5\Is It Wrong to Try to Pick Up Girls in a Dungeon! - S05E01 - Syr WEBDL-1080p.mkv",
"size": 1038141666,
"dateAdded": "2024-10-03T17:08:47.775894Z",
"sceneName": "Is.It.Wrong.to.Try.to.Pick.Up.Girls.in.a.Dungeon.S05E01.1080p.WEB.H264-KAWAII",
"quality": {
"quality": {
"id": 3,
"name": "WEBDL-1080p",
"source": "web",
"resolution": 1080
},
"revision": {
"version": 1,
"real": 0,
"isRepack": false
}
},
"language": {
"id": 1,
"name": "English"
},
"mediaInfo": {
"audioChannels": 2,
"audioCodec": "AAC",
"videoCodec": "x264"
},
"originalFilePath": "Is.It.Wrong.to.Try.to.Pick.Up.Girls.in.a.Dungeon.S05E01.1080p.WEB.H264-KAWAII\Is.It.Wrong.to.Try.to.Pick.Up.Girls.in.a.Dungeon.S05E01.1080p.WEB.H264-KAWAII.mkv",
"qualityCutoffNotMet": false,
"id": 12987
},
"hasFile": true,
"monitored": true,
"absoluteEpisodeNumber": 64,
"sceneAbsoluteEpisodeNumber": 1,
"sceneEpisodeNumber": 1,
"sceneSeasonNumber": 5,
"unverifiedSceneNumbering": false,
"series": {
"title": "Is It Wrong to Try to Pick Up Girls in a Dungeon?",
"sortTitle": "is it wrong to try to pick up girls in a dungeon",
"seasonCount": 5,
"status": "continuing",
"overview": "In a world, where the deities have descended from the heavens lies the town of Orario that features the Dungeon, which contains an assortment of monsters from goblins to dragons. Adventurers slay those monsters and take their shards, which are then used to craft magic items. To become an adventurer, people join groups called Familia. Each of which is named after and serves a resident deity. The adventurers and their attributes and abilities are ranked by level, improved by experience and supervised by their Familia's deity.\r\nBell Cranel, a novice adventurer, is the sole member of the Familia under the goddess Hestia. After being saved by top level adventurer Ais Wallenstein of the Loki Familia, he falls in love with her and decides to improve and become worthy of her attention. All the while mostly unaware that other girls, deities and mortals, also develop feelings for him. Especially Hestia herself.",
"network": "Tokyo MX",
"airTime": "00:30",
"images": [
{
"coverType": "banner",
"url": "https://artworks.thetvdb.com/banners/graphical/289882-g3.jpg"
},
{
"coverType": "poster",
"url": "https://artworks.thetvdb.com/banners/v4/series/289882/posters/6167c1e908d41.jpg"
},
{
"coverType": "fanart",
"url": "https://artworks.thetvdb.com/banners/fanart/original/5ccee55ed58bb.jpg"
},
{
"coverType": "unknown",
"url": "https://artworks.thetvdb.com/banners/v4/series/289882/clearlogo/611c02aa51aec.png"
}
],
"seasons": [
{
"seasonNumber": 0,
"monitored": false
},
{
"seasonNumber": 1,
"monitored": false
},
{
"seasonNumber": 2,
"monitored": false
},
{
"seasonNumber": 3,
"monitored": false
},
{
"seasonNumber": 4,
"monitored": true
},
{
"seasonNumber": 5,
"monitored": true
}
],
"year": 2015,
"path": "my path",
"profileId": 7,
"languageProfileId": 1,
"seasonFolder": true,
"monitored": true,
"useSceneNumbering": true,
"runtime": 25,
"tvdbId": 28982,
"tvRageId": 481858,
"tvMazeId": 53142,
"firstAired": "2015-04-04T00:00:00Z",
"lastInfoSync": "2024-10-04T15:53:40.662715Z",
"seriesType": "standard",
"cleanTitle": "isitwrongtotrytopickupgirlsindungeon",
"imdbId": "tt4728568",
"titleSlug": "is-it-wrong-to-try-to-pick-up-girls-in-a-dungeon",
"certification": "TV-MA",
"genres": [
"Action",
"Adventure",
"Animation",
"Anime",
"Comedy",
"Fantasy",
"Romance"
],
"tags": [],
"added": "2023-08-12T21:25:41.0607576Z",
"ratings": {
"votes": 10732,
"value": 7.4
},
"qualityProfileId": 7,
"id": 629
},
"id": 68461
}
]

Does the default Home Assistant Sonarr component work for you?
Yes

Home Assistant Version
2024.10.0

I have the following in my HA

  1. installed "Upcoming Media Card" via HACS
  2. followed the instruction from the following page, at that page step 4 was not possible
    https://github.com/custom-components/sensor.sonarr_upcoming_media/tree/master#manual-configuration-steps
  3. added the following folders and files to homeassistant/www
    custom-lovelace/upcoming-media-card/upcoming-media-card.js
  4. Add the following to settings > Dashboards > Resources (top left menu)
    url: /local/custom-lovelace/upcoming-media-card/upcoming-media-card.js?v=0.1.1
    resource type: javascript module
  5. added card with the following YAML
title: TV
type: custom:upcoming-media-card
entity: sensor.sonarr_upcoming
image_style: fanart
collapse: flag=true
sort_by: number
enable_tooltips: true

at this point I get the error in the card
"undefined" is not valid JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions