A different take on designing a Lovelace UI

I have change it and make a Sensor for the Markdown :

      eg_active:
        value_template: >-
              {% set lights = [states.light.wohnzimmer, states.light.kuche, states.light.tradfri_esszimmer, states.light.wc, states.light.flur_eg] %}
              {% set lights_on = lights | selectattr('state','eq','on') | list %}
              {% set lights_name = lights | selectattr('state','eq','on') | map(attribute='name') | join(', ') %}

              {% if (lights_on ) %} 
              {{ lights_name | regex_replace(',([^,]*)$',' und\\1') }} sind an</b>

              {% else %} 
              <font color='#6a7377'><b>Alle Lampen sind aus</font> 
              {% endif %}

now, it woks with the Name. But i need to have a Image for each light instead of the Name. hmmmmm…

The card now is easy and looks like:

          - type: custom:hui-markdown-card
            style: 
              top: 18.5%
              left: 65%
            content: >
              <b>{{ states('sensor.eg_active') }}</b>

You pretty much need all of it. What he has put on Github is pretty much the barebones essentials to get started. then you need to explore the code in all the YAML files, understand how everything works together, change sensors, switches, devices, integrations for yours, and then modify his UI code to get it to work with your stuff. It is honestly not something that you can do in a single day. Implementing this in your own Home Assistant instance, to work with your devices, integrations, entities, automations, etc is a pretty big job. There is no quick “click Next/Next/Next/Install” way to implement this. Everything in there is custom coded for his own stuff.

@xADDRx

You can’t use some features like includes in the “Raw config editor”. Use an external editor like VS Code.

why not one card works:

can anyone help me please?

Hi Mattias,
You’ve done an awesome job here, i’m trying to copy almost everything you’ve set up :wink:

I don’t use plex, but use Kodi so i have installed and configured correctly the kodi recently added addon (displaying perfectly in my standard dashboard).

But i’m really lost to replace plex by kodi in your media conditionnal card, nothing is displayed when the conditions are meet.
There is my sensor in the template page :

<template state sensor.kodi_recently_added_movies=off; data=[{"title_default": "$title", "line1_default": "$genres", "line2_default": "$release", "line3_default": "$rating - $runtime", "line4_default": "$studio", "icon": "mdi:arrow-down-bold"}], friendly_name=kodi_recently_added_movies @ 2020-09-01T18:50:35.392924+02:00>

and the conditionnal media card

                 - type: conditional
                   conditions:
                     - entity: light.salon
                       state: 'on'
                   elements:
                     - type: custom:button-card
                       entity: sensor.kodi_recently_added_movies
                       triggers_update:
                         ['sensor.kodi_recently_added_movies']
                       name: Derniers Films
                       state_display: >
                         [[[ const data = states[entity.entity_id].attributes.data;
                         const number = data[1].number == undefined ? '(' + data[1].aired.split('-')[0] + ')' : data[1].number;
                         return `${data[1].title} ${number}`; ]]]
                       custom_fields:
                         icon: >
                           <svg viewBox="0 0 50 50"><path d="M7.7.3h34.6c4.1 0 7.4 3.3 7.4 7.4v34.6c0 4.1-3.3 7.4-7.4 7.4H7.7c-4.1 0-7.4-3.3-7.4-7.4V7.7C.3 3.6 3.6.3 7.7.3z" fill="#282a2d"/><path d="M25,7.1H14.6L25,25L14.6,42.9H25L35.4,25L25,7.1z" fill="#e5a00d"/></svg>
                         blur: >
                           <svg viewBox="0 0 50 50" />
                       styles:
                         custom_fields:
                           media_image: &plex_poster
                             [background-position: center center, background-image: 
                             "[[[ return 'url(' + states[entity.entity_id].attributes.data[1].poster + ')'; ]]]"]
                           blur: *plex_poster
                           overlay: [background: 'rgba(0, 0, 0, 0.4)']
                         card:
                           [color: '#efefef', text-shadow: '1px 1px 5px rgba(18, 22, 23, 0.9)']
                       tap_action:
                         action: none
                       style:
                         top: 50%
                         left: 50%
                         width: 100%
                       template: conditional_media

Forget about the light.salon ‘on’ condition, it’s just for testing.

If you could point me in the right direction, it would be greatly apprecied :slight_smile:
Thx !

Just checked mine. Your sensor is off.

< template state sensor.kodi_recently_added_movies = off;
data = [{
  "title_default": "$title",
  "line1_default": "$genres",
  "line2_default": "$release",
  "line3_default": "$rating - $runtime",
  "line4_default": "$studio",
  "icon": "mdi:arrow-down-bold"
}], friendly_name = kodi_recently_added_movies @ 2020 - 09 - 01 T18: 50: 35.392924 + 02: 00 >

My sensor is online with data.

< template state sensor.plex_recently_added = Online;
data = [{
  'title_default': '$title',
  'line1_default': '$episode',
  'line2_default': '$release',
  'line3_default': '$number - $rating - $runtime',
  'line4_default': '$genres',
  'icon': 'mdi:eye-off'
}, {
  'airdate': '2020-08-25T19:20:32Z',
  'aired': '',
  'release': '$day, $date $time',
  'flag': True,
  'title': 'Firefly',
  'episode': 'Episode 15',
  'number': 'S01E15',
  'runtime': 44,
  'rating': '',
  'poster': '/local/Plex_Recently_Added/p3968.jpg',
  'fanart': '/local/Plex_Recently_Added/f3968.jpg'
}], friendly_name = Plex Recently Added @ 2020 - 08 - 29 T00: 50: 43.488463 + 02: 00 >
1 Like

Thx a lot, you’re right i had a problem with kodi.

Now my sensor is active and populated, but i have a white background and no image.

This is my sensor :

<template state sensor.kodi_recently_added_movies=on; data=[{"title_default": "$title", "line1_default": "$genres", "line2_default": "$release", "line3_default": "$rating - $runtime", "line4_default": "$studio", "icon": "mdi:arrow-down-bold"}, {"aired": "2020-03-05", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame", "rating": "\u2605 6.7", "release": "$date", "runtime": 108, "title": "The Way Back", "studio": "Warner Bros. Pictures", "fanart": "http://image.tmdb.org/t/p/original/5mubFanEHVFJff4jLQH0uIOThMz.jpg", "poster": "http://image.tmdb.org/t/p/original/ylPnfaphW3FrLBUVwAREVtiL9My.jpg"}, {"aired": "2020-03-11", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame,Romance,Histoire", "rating": "\u2605 6.3", "release": "$date", "runtime": 109, "title": "Radioactive", "studio": "Working Title Films", "fanart": "http://image.tmdb.org/t/p/original/e7tjpKP36Xd6BzyTMZo4AUe86VM.jpg", "poster": "http://image.tmdb.org/t/p/original/eTUBqUBLGx0LUY8HWBXD5zyLkOf.jpg"}, {"aired": "1992-05-22", "airdate": "2020-08-15T23:07:45Z", "flag": true, "genres": "Science-Fiction,Action,Horreur", "rating": "\u2605 6.3", "release": "$date", "runtime": 144, "title": "Alien\u00b3", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/9WO0CELoWq6tSdjqCs34Y0qek7l.jpg", "poster": "http://image.tmdb.org/t/p/original/6vWHGE0IZCkp1o4cqJ7PqqlYC1s.jpg"}, {"aired": "1986-07-18", "airdate": "2020-08-15T23:06:24Z", "flag": true, "genres": "Action,Thriller,Science-Fiction", "rating": "\u2605 7.9", "release": "$date", "runtime": 154, "title": "Aliens, le retour", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/jMBpJFRtrtIXymer93XLavPwI3P.jpg", "poster": "http://image.tmdb.org/t/p/original/3eHFrdmBENZMbutlNMguqTAl3bf.jpg"}, {"aired": "1979-05-25", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Horreur,Science-Fiction", "rating": "\u2605 8.1", "release": "$date", "runtime": 115, "title": "Alien, le huiti\u00e8me passager", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/AmR3JG1VQVxU8TfAvljUhfSFUOx.jpg", "poster": "http://image.tmdb.org/t/p/original/l8CES84JndFlNfBNMxdLRYaLvI6.jpg"}, {"aired": "2020-08-14", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Action,Crime,Science-Fiction", "rating": "\u2605 6.7", "release": "$date", "runtime": 113, "title": "Project Power", "studio": "Screen Arcade", "fanart": "http://image.tmdb.org/t/p/original/qVygtf2vU15L2yKS4Ke44U4oMdD.jpg", "poster": "http://image.tmdb.org/t/p/original/fjCezXiQWfGuNf4t7LruKky7kwV.jpg"}, {"aired": "2020-07-22", "airdate": "2020-08-15T23:01:59Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.8", "release": "$date", "runtime": 137, "title": "The King of Staten Island", "studio": "Universal Pictures", "fanart": "http://image.tmdb.org/t/p/original/5rwcd24GGltKiqdPT4G2dmchLr9.jpg", "poster": "http://image.tmdb.org/t/p/original/wIYkb0mS9WY53a2dOqCrg0xaSpt.jpg"}, {"aired": "1997-11-12", "airdate": "2020-08-15T22:55:45Z", "flag": true, "genres": "Science-Fiction,Horreur,Action", "rating": "\u2605 6.1", "release": "$date", "runtime": 116, "title": "Alien, la r\u00e9surrection", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/zQI8yxl61JTpjCB3MrTbcQBOT82.jpg", "poster": "http://image.tmdb.org/t/p/original/ePPdAnGJk9mR1qNxHhGrIhLAo4Q.jpg"}, {"aired": "2020-06-19", "airdate": "2020-08-15T22:49:16Z", "flag": true, "genres": "Guerre,Action,Drame", "rating": "\u2605 7.5", "release": "$date", "runtime": 91, "title": "USS Greyhound - La bataille de l'Atlantique", "studio": "Playtone", "fanart": "http://image.tmdb.org/t/p/original/xXBnM6uSTk6qqCf0SRZKXcga9Ba.jpg", "poster": "http://image.tmdb.org/t/p/original/stfW5cfX0A5Fvo2SBcXAazlWihg.jpg"}, {"aired": "2020-07-08", "airdate": "2020-08-15T08:33:44Z", "flag": true, "genres": "Familial,Animation,Com\u00e9die,Aventure", "rating": "\u2605 7.5", "release": "$date", "runtime": 93, "title": "Scooby !", "studio": "Warner Animation Group", "fanart": "http://image.tmdb.org/t/p/original/fKtYXUhX5fxMxzQfyUcQW9Shik6.jpg", "poster": "http://image.tmdb.org/t/p/original/4xiq5NpooMCBFjQhGQjx8LqmhTy.jpg"}, {"aired": "2020-02-19", "airdate": "2020-07-07T16:49:30Z", "flag": true, "genres": "Com\u00e9die", "rating": "\u2605 5.8", "release": "$date", "runtime": 97, "title": "10 jours sans maman", "studio": "Soyouz Films", "fanart": "http://image.tmdb.org/t/p/original/5xYyXBhcRfXmZMQ9gCr0a4W2lpu.jpg", "poster": "http://image.tmdb.org/t/p/original/xEbSztKAAwIljX8A537HeZDKXUS.jpg"}, {"aired": "2020-03-04", "airdate": "2020-07-07T16:44:16Z", "flag": true, "genres": "Histoire,Drame", "rating": "\u2605 6.2", "release": "$date", "runtime": 108, "title": "De Gaulle", "studio": "Vertigo Productions", "fanart": "http://image.tmdb.org/t/p/original/gQV3joTmJmqN7I5G6Cpjvy84WWd.jpg", "poster": "http://image.tmdb.org/t/p/original/lfxs2YnuuLR037Ad4wesW5O9oUW.jpg"}, {"aired": "2019-11-27", "airdate": "2020-07-07T16:43:23Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 4.5", "release": "$date", "runtime": 83, "title": "Toute ressemblance\u2026", "studio": "Les Films du 24", "fanart": "http://image.tmdb.org/t/p/original/ofZaU8KxCjWMZ6dz8uL5lbxuxre.jpg", "poster": "http://image.tmdb.org/t/p/original/pqSaIXltXdFKsu8dt4ppNmuBPWs.jpg"}, {"aired": "2019-12-19", "airdate": "2020-06-29T17:11:02Z", "flag": true, "genres": "Fantastique,Familial,Aventure,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 125, "title": "Pinocchio", "studio": "Fonds Eurimages du Conseil de l'Europe", "fanart": "http://image.tmdb.org/t/p/original/AdqOBPw4PdtzOcfEuQuZ8MNeTKb.jpg", "poster": "http://image.tmdb.org/t/p/original/xoYcb037L7JQw6MZo1fhM16mfJ7.jpg"}, {"aired": "2018-01-27", "airdate": "2020-06-29T17:08:49Z", "flag": true, "genres": "", "rating": 0.0, "release": "$date", "runtime": 11, "title": "Bluebird", "studio": "", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/c97uq80B1A3JxNS3SiVsK9xWoBM.jpg"}, {"aired": "2020-03-06", "airdate": "2020-06-13T16:58:23Z", "flag": true, "genres": "Drame", "rating": "\u2605 7.6", "release": "$date", "runtime": 120, "title": "The Banker", "studio": "Romulus Entertainment", "fanart": "http://image.tmdb.org/t/p/original/jqz8FwISQfyum47PUqgPTGtmiMk.jpg", "poster": "http://image.tmdb.org/t/p/original/biXzsw22U6vSd0XktmZwAOc4uik.jpg"}, {"aired": "1998-10-30", "airdate": "2020-06-13T16:55:41Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.4", "release": "$date", "runtime": 118, "title": "American History X", "studio": "New Line Cinema", "fanart": "http://image.tmdb.org/t/p/original/9LSsSPbP715XT9B7acIZzantPyX.jpg", "poster": "http://image.tmdb.org/t/p/original/yygSRdHdcIVPRNC0rDv658ZdJiD.jpg"}, {"aired": "2019-07-19", "airdate": "2020-06-13T16:54:41Z", "flag": true, "genres": "Animation,Romance,Fantastique,Drame,Aventure", "rating": "\u2605 8.0", "release": "$date", "runtime": 113, "title": "Les Enfants du Temps", "studio": "Toho Company, Ltd.", "fanart": "http://image.tmdb.org/t/p/original/ize3ZieqSy0TCWljmVoEiy8fSFS.jpg", "poster": "http://image.tmdb.org/t/p/original/k0tHYSbzOEkxOYoVLLstLg4Gdkd.jpg"}, {"aired": "2019-07-10", "airdate": "2020-06-03T17:14:01Z", "flag": true, "genres": "Horreur", "rating": "\u2605 6.4", "release": "$date", "runtime": 95, "title": "The Wretched", "studio": "", "fanart": "http://image.tmdb.org/t/p/original/su0huGwZfAmzPvUjnlG42LO9GFl.jpg", "poster": "http://image.tmdb.org/t/p/original/7Jk4pDMM3G9h29lWshEZjX711wg.jpg"}, {"aired": "2018-01-25", "airdate": "2020-06-03T17:13:32Z", "flag": true, "genres": "Drame", "rating": 0.0, "release": "$date", "runtime": 71, "title": "Tranquillo", "studio": "Letterbox Collective Filmproduktion", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/y6frInBbBht833Y40JSWiOfPMxu.jpg"}, {"aired": "2007-01-24", "airdate": "2020-06-03T17:13:06Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.5", "release": "$date", "runtime": 93, "title": "King of California", "studio": "Nu Image", "fanart": "http://image.tmdb.org/t/p/original/dp3SyjDLboXzyYHOciPGdAWemX7.jpg", "poster": "http://image.tmdb.org/t/p/original/zLoa3oJ83zo9g3mV9LNCHbqO7jH.jpg"}, {"aired": "2020-04-16", "airdate": "2020-05-29T14:41:41Z", "flag": true, "genres": "Science-Fiction,Drame,Thriller", "rating": "\u2605 6.3", "release": "$date", "runtime": 113, "title": "Spoutnik", "studio": "Vodorod", "fanart": "http://image.tmdb.org/t/p/original/lGydLXSaDLxN8WoAdubHCnhAgfd.jpg", "poster": "http://image.tmdb.org/t/p/original/tBi5xW9Rd0YoGB0aAggV0EN5LDP.jpg"}, {"aired": "2020-02-06", "airdate": "2020-05-29T14:39:36Z", "flag": true, "genres": "Horreur", "rating": "\u2605 5.2", "release": "$date", "runtime": 104, "title": "A Night of Horror: Nightmare Radio", "studio": "Black Mandala", "fanart": "http://image.tmdb.org/t/p/original/bs7mYckE4BeVRtxK9MRYhNZTTqg.jpg", "poster": "http://image.tmdb.org/t/p/original/g7EYDfGgNEF1IQymS7EvDLKnpxT.jpg"}, {"aired": "1986-05-16", "airdate": "2020-05-26T11:17:43Z", "flag": true, "genres": "Action,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 109, "title": "Top Gun", "studio": "Paramount", "fanart": "http://image.tmdb.org/t/p/original/vSZtQrlJqgjz4GIbnF3kBDkzJFE.jpg", "poster": "http://image.tmdb.org/t/p/original/oBe6dugbK95jabwiIo5uwMU7DYJ.jpg"}, {"aired": "2020-01-01", "airdate": "2020-05-22T09:13:18Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.0", "release": "$date", "runtime": 144, "title": "S\u00e9jour dans les monts Fuchun", "studio": "Dadi Film Group", "fanart": "http://image.tmdb.org/t/p/original/AsDanXphy2uvK227rIZP1BiUWEr.jpg", "poster": "http://image.tmdb.org/t/p/original/7vSuF1621x63Zc5OOyCAx5sxtu.jpg"}], friendly_name=kodi_recently_added_movies @ 2020-09-02T19:17:32.692334+02:00>

maybe its the &plex_poster and *plex_poster?
sorry i’m really lost in css and half only in yaml :stuck_out_tongue:

thx again !

I think I’m done! Thanks very much for this awesome layout and design!! Unfortunately my nexus 7 (2012) is not powerful enough to show this dashboard, so guess I need a new tablet :frowning:

7 Likes

What do you get in template dev tools?

{% set data = states.sensor.kodi_recently_added_movies.attributes.data %}
{{ data }}

{{ data[1].title }}
{{ data[1].poster }}

You don’t seem to have “number” in your attributes but the js is pretty much the same syntax. Here it checks if there is an episode number, if not then it’s a movie so it returns the release year instead. You can try removing that.

state_display: >
  [[[ const data = states[entity.entity_id].attributes.data;
  const number = data[1].number == undefined ? '(' + data[1].aired.split('-')[0] + ')' : data[1].number;
  return `${data[1].title} ${number}`; ]]]

I also have max 1 entry because it only shows the last added anyway and have it set to save the poster locally.

  - platform: plex_recently_added
    token: !secret plex_token
    host: !secret plex_host
    port: !secret plex_port
    max: 1
    img_dir: '/'
    image_resolution: 500

Since I’m a beginner, I would ask one of you to show me only part of the view:

grafik

Can someone make the part available to me?

Thank You!!

Did you install hacs? I bet /hacsfiles/… are only served if you install it. And then install all the resources yourself instead of cloning my repo so hacs can keep them up to date.

i Get this in the template dev tools.

[{"title_default": "$title", "line1_default": "$genres", "line2_default": "$release", "line3_default": "$rating - $runtime", "line4_default": "$studio", "icon": "mdi:arrow-down-bold"}, {"aired": "2020-03-05", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame", "rating": "\u2605 6.7", "release": "$date", "runtime": 108, "title": "The Way Back", "studio": "Warner Bros. Pictures", "fanart": "http://image.tmdb.org/t/p/original/5mubFanEHVFJff4jLQH0uIOThMz.jpg", "poster": "http://image.tmdb.org/t/p/original/ylPnfaphW3FrLBUVwAREVtiL9My.jpg"}, {"aired": "2020-03-11", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame,Romance,Histoire", "rating": "\u2605 6.3", "release": "$date", "runtime": 109, "title": "Radioactive", "studio": "Working Title Films", "fanart": "http://image.tmdb.org/t/p/original/e7tjpKP36Xd6BzyTMZo4AUe86VM.jpg", "poster": "http://image.tmdb.org/t/p/original/eTUBqUBLGx0LUY8HWBXD5zyLkOf.jpg"}, {"aired": "1992-05-22", "airdate": "2020-08-15T23:07:45Z", "flag": true, "genres": "Science-Fiction,Action,Horreur", "rating": "\u2605 6.3", "release": "$date", "runtime": 144, "title": "Alien\u00b3", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/9WO0CELoWq6tSdjqCs34Y0qek7l.jpg", "poster": "http://image.tmdb.org/t/p/original/6vWHGE0IZCkp1o4cqJ7PqqlYC1s.jpg"}, {"aired": "1986-07-18", "airdate": "2020-08-15T23:06:24Z", "flag": true, "genres": "Action,Thriller,Science-Fiction", "rating": "\u2605 7.9", "release": "$date", "runtime": 154, "title": "Aliens, le retour", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/jMBpJFRtrtIXymer93XLavPwI3P.jpg", "poster": "http://image.tmdb.org/t/p/original/3eHFrdmBENZMbutlNMguqTAl3bf.jpg"}, {"aired": "1979-05-25", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Horreur,Science-Fiction", "rating": "\u2605 8.1", "release": "$date", "runtime": 115, "title": "Alien, le huiti\u00e8me passager", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/AmR3JG1VQVxU8TfAvljUhfSFUOx.jpg", "poster": "http://image.tmdb.org/t/p/original/l8CES84JndFlNfBNMxdLRYaLvI6.jpg"}, {"aired": "2020-08-14", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Action,Crime,Science-Fiction", "rating": "\u2605 6.7", "release": "$date", "runtime": 113, "title": "Project Power", "studio": "Screen Arcade", "fanart": "http://image.tmdb.org/t/p/original/qVygtf2vU15L2yKS4Ke44U4oMdD.jpg", "poster": "http://image.tmdb.org/t/p/original/fjCezXiQWfGuNf4t7LruKky7kwV.jpg"}, {"aired": "2020-07-22", "airdate": "2020-08-15T23:01:59Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.8", "release": "$date", "runtime": 137, "title": "The King of Staten Island", "studio": "Universal Pictures", "fanart": "http://image.tmdb.org/t/p/original/5rwcd24GGltKiqdPT4G2dmchLr9.jpg", "poster": "http://image.tmdb.org/t/p/original/wIYkb0mS9WY53a2dOqCrg0xaSpt.jpg"}, {"aired": "1997-11-12", "airdate": "2020-08-15T22:55:45Z", "flag": true, "genres": "Science-Fiction,Horreur,Action", "rating": "\u2605 6.1", "release": "$date", "runtime": 116, "title": "Alien, la r\u00e9surrection", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/zQI8yxl61JTpjCB3MrTbcQBOT82.jpg", "poster": "http://image.tmdb.org/t/p/original/ePPdAnGJk9mR1qNxHhGrIhLAo4Q.jpg"}, {"aired": "2020-06-19", "airdate": "2020-08-15T22:49:16Z", "flag": true, "genres": "Guerre,Action,Drame", "rating": "\u2605 7.5", "release": "$date", "runtime": 91, "title": "USS Greyhound - La bataille de l'Atlantique", "studio": "Playtone", "fanart": "http://image.tmdb.org/t/p/original/xXBnM6uSTk6qqCf0SRZKXcga9Ba.jpg", "poster": "http://image.tmdb.org/t/p/original/stfW5cfX0A5Fvo2SBcXAazlWihg.jpg"}, {"aired": "2020-07-08", "airdate": "2020-08-15T08:33:44Z", "flag": true, "genres": "Familial,Animation,Com\u00e9die,Aventure", "rating": "\u2605 7.5", "release": "$date", "runtime": 93, "title": "Scooby !", "studio": "Warner Animation Group", "fanart": "http://image.tmdb.org/t/p/original/fKtYXUhX5fxMxzQfyUcQW9Shik6.jpg", "poster": "http://image.tmdb.org/t/p/original/4xiq5NpooMCBFjQhGQjx8LqmhTy.jpg"}, {"aired": "2020-02-19", "airdate": "2020-07-07T16:49:30Z", "flag": true, "genres": "Com\u00e9die", "rating": "\u2605 5.8", "release": "$date", "runtime": 97, "title": "10 jours sans maman", "studio": "Soyouz Films", "fanart": "http://image.tmdb.org/t/p/original/5xYyXBhcRfXmZMQ9gCr0a4W2lpu.jpg", "poster": "http://image.tmdb.org/t/p/original/xEbSztKAAwIljX8A537HeZDKXUS.jpg"}, {"aired": "2020-03-04", "airdate": "2020-07-07T16:44:16Z", "flag": true, "genres": "Histoire,Drame", "rating": "\u2605 6.2", "release": "$date", "runtime": 108, "title": "De Gaulle", "studio": "Vertigo Productions", "fanart": "http://image.tmdb.org/t/p/original/gQV3joTmJmqN7I5G6Cpjvy84WWd.jpg", "poster": "http://image.tmdb.org/t/p/original/lfxs2YnuuLR037Ad4wesW5O9oUW.jpg"}, {"aired": "2019-11-27", "airdate": "2020-07-07T16:43:23Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 4.5", "release": "$date", "runtime": 83, "title": "Toute ressemblance\u2026", "studio": "Les Films du 24", "fanart": "http://image.tmdb.org/t/p/original/ofZaU8KxCjWMZ6dz8uL5lbxuxre.jpg", "poster": "http://image.tmdb.org/t/p/original/pqSaIXltXdFKsu8dt4ppNmuBPWs.jpg"}, {"aired": "2019-12-19", "airdate": "2020-06-29T17:11:02Z", "flag": true, "genres": "Fantastique,Familial,Aventure,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 125, "title": "Pinocchio", "studio": "Fonds Eurimages du Conseil de l'Europe", "fanart": "http://image.tmdb.org/t/p/original/AdqOBPw4PdtzOcfEuQuZ8MNeTKb.jpg", "poster": "http://image.tmdb.org/t/p/original/xoYcb037L7JQw6MZo1fhM16mfJ7.jpg"}, {"aired": "2018-01-27", "airdate": "2020-06-29T17:08:49Z", "flag": true, "genres": "", "rating": 0.0, "release": "$date", "runtime": 11, "title": "Bluebird", "studio": "", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/c97uq80B1A3JxNS3SiVsK9xWoBM.jpg"}, {"aired": "2020-03-06", "airdate": "2020-06-13T16:58:23Z", "flag": true, "genres": "Drame", "rating": "\u2605 7.6", "release": "$date", "runtime": 120, "title": "The Banker", "studio": "Romulus Entertainment", "fanart": "http://image.tmdb.org/t/p/original/jqz8FwISQfyum47PUqgPTGtmiMk.jpg", "poster": "http://image.tmdb.org/t/p/original/biXzsw22U6vSd0XktmZwAOc4uik.jpg"}, {"aired": "1998-10-30", "airdate": "2020-06-13T16:55:41Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.4", "release": "$date", "runtime": 118, "title": "American History X", "studio": "New Line Cinema", "fanart": "http://image.tmdb.org/t/p/original/9LSsSPbP715XT9B7acIZzantPyX.jpg", "poster": "http://image.tmdb.org/t/p/original/yygSRdHdcIVPRNC0rDv658ZdJiD.jpg"}, {"aired": "2019-07-19", "airdate": "2020-06-13T16:54:41Z", "flag": true, "genres": "Animation,Romance,Fantastique,Drame,Aventure", "rating": "\u2605 8.0", "release": "$date", "runtime": 113, "title": "Les Enfants du Temps", "studio": "Toho Company, Ltd.", "fanart": "http://image.tmdb.org/t/p/original/ize3ZieqSy0TCWljmVoEiy8fSFS.jpg", "poster": "http://image.tmdb.org/t/p/original/k0tHYSbzOEkxOYoVLLstLg4Gdkd.jpg"}, {"aired": "2019-07-10", "airdate": "2020-06-03T17:14:01Z", "flag": true, "genres": "Horreur", "rating": "\u2605 6.4", "release": "$date", "runtime": 95, "title": "The Wretched", "studio": "", "fanart": "http://image.tmdb.org/t/p/original/su0huGwZfAmzPvUjnlG42LO9GFl.jpg", "poster": "http://image.tmdb.org/t/p/original/7Jk4pDMM3G9h29lWshEZjX711wg.jpg"}, {"aired": "2018-01-25", "airdate": "2020-06-03T17:13:32Z", "flag": true, "genres": "Drame", "rating": 0.0, "release": "$date", "runtime": 71, "title": "Tranquillo", "studio": "Letterbox Collective Filmproduktion", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/y6frInBbBht833Y40JSWiOfPMxu.jpg"}, {"aired": "2007-01-24", "airdate": "2020-06-03T17:13:06Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.5", "release": "$date", "runtime": 93, "title": "King of California", "studio": "Nu Image", "fanart": "http://image.tmdb.org/t/p/original/dp3SyjDLboXzyYHOciPGdAWemX7.jpg", "poster": "http://image.tmdb.org/t/p/original/zLoa3oJ83zo9g3mV9LNCHbqO7jH.jpg"}, {"aired": "2020-04-16", "airdate": "2020-05-29T14:41:41Z", "flag": true, "genres": "Science-Fiction,Drame,Thriller", "rating": "\u2605 6.3", "release": "$date", "runtime": 113, "title": "Spoutnik", "studio": "Vodorod", "fanart": "http://image.tmdb.org/t/p/original/lGydLXSaDLxN8WoAdubHCnhAgfd.jpg", "poster": "http://image.tmdb.org/t/p/original/tBi5xW9Rd0YoGB0aAggV0EN5LDP.jpg"}, {"aired": "2020-02-06", "airdate": "2020-05-29T14:39:36Z", "flag": true, "genres": "Horreur", "rating": "\u2605 5.2", "release": "$date", "runtime": 104, "title": "A Night of Horror: Nightmare Radio", "studio": "Black Mandala", "fanart": "http://image.tmdb.org/t/p/original/bs7mYckE4BeVRtxK9MRYhNZTTqg.jpg", "poster": "http://image.tmdb.org/t/p/original/g7EYDfGgNEF1IQymS7EvDLKnpxT.jpg"}, {"aired": "1986-05-16", "airdate": "2020-05-26T11:17:43Z", "flag": true, "genres": "Action,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 109, "title": "Top Gun", "studio": "Paramount", "fanart": "http://image.tmdb.org/t/p/original/vSZtQrlJqgjz4GIbnF3kBDkzJFE.jpg", "poster": "http://image.tmdb.org/t/p/original/oBe6dugbK95jabwiIo5uwMU7DYJ.jpg"}, {"aired": "2020-01-01", "airdate": "2020-05-22T09:13:18Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.0", "release": "$date", "runtime": 144, "title": "S\u00e9jour dans les monts Fuchun", "studio": "Dadi Film Group", "fanart": "http://image.tmdb.org/t/p/original/AsDanXphy2uvK227rIZP1BiUWEr.jpg", "poster": "http://image.tmdb.org/t/p/original/7vSuF1621x63Zc5OOyCAx5sxtu.jpg"}]

<built-in method title of str object at 0x7f788f6e89b0>

I tried to remove the state display part, but it is the same behavior.

i think if you dont have another idea on the subject, i will put this in the end of my todo list :wink:

Thx a lot for your time and your awesome UI !

{% set data = [{"title_default": "$title", "line1_default": "$genres", "line2_default": "$release", "line3_default": "$rating - $runtime", "line4_default": "$studio", "icon": "mdi:arrow-down-bold"}, {"aired": "2020-03-05", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame", "rating": "\u2605 6.7", "release": "$date", "runtime": 108, "title": "The Way Back", "studio": "Warner Bros. Pictures", "fanart": "http://image.tmdb.org/t/p/original/5mubFanEHVFJff4jLQH0uIOThMz.jpg", "poster": "http://image.tmdb.org/t/p/original/ylPnfaphW3FrLBUVwAREVtiL9My.jpg"}, {"aired": "2020-03-11", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame,Romance,Histoire", "rating": "\u2605 6.3", "release": "$date", "runtime": 109, "title": "Radioactive", "studio": "Working Title Films", "fanart": "http://image.tmdb.org/t/p/original/e7tjpKP36Xd6BzyTMZo4AUe86VM.jpg", "poster": "http://image.tmdb.org/t/p/original/eTUBqUBLGx0LUY8HWBXD5zyLkOf.jpg"}, {"aired": "1992-05-22", "airdate": "2020-08-15T23:07:45Z", "flag": true, "genres": "Science-Fiction,Action,Horreur", "rating": "\u2605 6.3", "release": "$date", "runtime": 144, "title": "Alien\u00b3", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/9WO0CELoWq6tSdjqCs34Y0qek7l.jpg", "poster": "http://image.tmdb.org/t/p/original/6vWHGE0IZCkp1o4cqJ7PqqlYC1s.jpg"}, {"aired": "1986-07-18", "airdate": "2020-08-15T23:06:24Z", "flag": true, "genres": "Action,Thriller,Science-Fiction", "rating": "\u2605 7.9", "release": "$date", "runtime": 154, "title": "Aliens, le retour", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/jMBpJFRtrtIXymer93XLavPwI3P.jpg", "poster": "http://image.tmdb.org/t/p/original/3eHFrdmBENZMbutlNMguqTAl3bf.jpg"}, {"aired": "1979-05-25", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Horreur,Science-Fiction", "rating": "\u2605 8.1", "release": "$date", "runtime": 115, "title": "Alien, le huiti\u00e8me passager", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/AmR3JG1VQVxU8TfAvljUhfSFUOx.jpg", "poster": "http://image.tmdb.org/t/p/original/l8CES84JndFlNfBNMxdLRYaLvI6.jpg"}, {"aired": "2020-08-14", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Action,Crime,Science-Fiction", "rating": "\u2605 6.7", "release": "$date", "runtime": 113, "title": "Project Power", "studio": "Screen Arcade", "fanart": "http://image.tmdb.org/t/p/original/qVygtf2vU15L2yKS4Ke44U4oMdD.jpg", "poster": "http://image.tmdb.org/t/p/original/fjCezXiQWfGuNf4t7LruKky7kwV.jpg"}, {"aired": "2020-07-22", "airdate": "2020-08-15T23:01:59Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.8", "release": "$date", "runtime": 137, "title": "The King of Staten Island", "studio": "Universal Pictures", "fanart": "http://image.tmdb.org/t/p/original/5rwcd24GGltKiqdPT4G2dmchLr9.jpg", "poster": "http://image.tmdb.org/t/p/original/wIYkb0mS9WY53a2dOqCrg0xaSpt.jpg"}, {"aired": "1997-11-12", "airdate": "2020-08-15T22:55:45Z", "flag": true, "genres": "Science-Fiction,Horreur,Action", "rating": "\u2605 6.1", "release": "$date", "runtime": 116, "title": "Alien, la r\u00e9surrection", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/zQI8yxl61JTpjCB3MrTbcQBOT82.jpg", "poster": "http://image.tmdb.org/t/p/original/ePPdAnGJk9mR1qNxHhGrIhLAo4Q.jpg"}, {"aired": "2020-06-19", "airdate": "2020-08-15T22:49:16Z", "flag": true, "genres": "Guerre,Action,Drame", "rating": "\u2605 7.5", "release": "$date", "runtime": 91, "title": "USS Greyhound - La bataille de l'Atlantique", "studio": "Playtone", "fanart": "http://image.tmdb.org/t/p/original/xXBnM6uSTk6qqCf0SRZKXcga9Ba.jpg", "poster": "http://image.tmdb.org/t/p/original/stfW5cfX0A5Fvo2SBcXAazlWihg.jpg"}, {"aired": "2020-07-08", "airdate": "2020-08-15T08:33:44Z", "flag": true, "genres": "Familial,Animation,Com\u00e9die,Aventure", "rating": "\u2605 7.5", "release": "$date", "runtime": 93, "title": "Scooby !", "studio": "Warner Animation Group", "fanart": "http://image.tmdb.org/t/p/original/fKtYXUhX5fxMxzQfyUcQW9Shik6.jpg", "poster": "http://image.tmdb.org/t/p/original/4xiq5NpooMCBFjQhGQjx8LqmhTy.jpg"}, {"aired": "2020-02-19", "airdate": "2020-07-07T16:49:30Z", "flag": true, "genres": "Com\u00e9die", "rating": "\u2605 5.8", "release": "$date", "runtime": 97, "title": "10 jours sans maman", "studio": "Soyouz Films", "fanart": "http://image.tmdb.org/t/p/original/5xYyXBhcRfXmZMQ9gCr0a4W2lpu.jpg", "poster": "http://image.tmdb.org/t/p/original/xEbSztKAAwIljX8A537HeZDKXUS.jpg"}, {"aired": "2020-03-04", "airdate": "2020-07-07T16:44:16Z", "flag": true, "genres": "Histoire,Drame", "rating": "\u2605 6.2", "release": "$date", "runtime": 108, "title": "De Gaulle", "studio": "Vertigo Productions", "fanart": "http://image.tmdb.org/t/p/original/gQV3joTmJmqN7I5G6Cpjvy84WWd.jpg", "poster": "http://image.tmdb.org/t/p/original/lfxs2YnuuLR037Ad4wesW5O9oUW.jpg"}, {"aired": "2019-11-27", "airdate": "2020-07-07T16:43:23Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 4.5", "release": "$date", "runtime": 83, "title": "Toute ressemblance\u2026", "studio": "Les Films du 24", "fanart": "http://image.tmdb.org/t/p/original/ofZaU8KxCjWMZ6dz8uL5lbxuxre.jpg", "poster": "http://image.tmdb.org/t/p/original/pqSaIXltXdFKsu8dt4ppNmuBPWs.jpg"}, {"aired": "2019-12-19", "airdate": "2020-06-29T17:11:02Z", "flag": true, "genres": "Fantastique,Familial,Aventure,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 125, "title": "Pinocchio", "studio": "Fonds Eurimages du Conseil de l'Europe", "fanart": "http://image.tmdb.org/t/p/original/AdqOBPw4PdtzOcfEuQuZ8MNeTKb.jpg", "poster": "http://image.tmdb.org/t/p/original/xoYcb037L7JQw6MZo1fhM16mfJ7.jpg"}, {"aired": "2018-01-27", "airdate": "2020-06-29T17:08:49Z", "flag": true, "genres": "", "rating": 0.0, "release": "$date", "runtime": 11, "title": "Bluebird", "studio": "", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/c97uq80B1A3JxNS3SiVsK9xWoBM.jpg"}, {"aired": "2020-03-06", "airdate": "2020-06-13T16:58:23Z", "flag": true, "genres": "Drame", "rating": "\u2605 7.6", "release": "$date", "runtime": 120, "title": "The Banker", "studio": "Romulus Entertainment", "fanart": "http://image.tmdb.org/t/p/original/jqz8FwISQfyum47PUqgPTGtmiMk.jpg", "poster": "http://image.tmdb.org/t/p/original/biXzsw22U6vSd0XktmZwAOc4uik.jpg"}, {"aired": "1998-10-30", "airdate": "2020-06-13T16:55:41Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.4", "release": "$date", "runtime": 118, "title": "American History X", "studio": "New Line Cinema", "fanart": "http://image.tmdb.org/t/p/original/9LSsSPbP715XT9B7acIZzantPyX.jpg", "poster": "http://image.tmdb.org/t/p/original/yygSRdHdcIVPRNC0rDv658ZdJiD.jpg"}, {"aired": "2019-07-19", "airdate": "2020-06-13T16:54:41Z", "flag": true, "genres": "Animation,Romance,Fantastique,Drame,Aventure", "rating": "\u2605 8.0", "release": "$date", "runtime": 113, "title": "Les Enfants du Temps", "studio": "Toho Company, Ltd.", "fanart": "http://image.tmdb.org/t/p/original/ize3ZieqSy0TCWljmVoEiy8fSFS.jpg", "poster": "http://image.tmdb.org/t/p/original/k0tHYSbzOEkxOYoVLLstLg4Gdkd.jpg"}, {"aired": "2019-07-10", "airdate": "2020-06-03T17:14:01Z", "flag": true, "genres": "Horreur", "rating": "\u2605 6.4", "release": "$date", "runtime": 95, "title": "The Wretched", "studio": "", "fanart": "http://image.tmdb.org/t/p/original/su0huGwZfAmzPvUjnlG42LO9GFl.jpg", "poster": "http://image.tmdb.org/t/p/original/7Jk4pDMM3G9h29lWshEZjX711wg.jpg"}, {"aired": "2018-01-25", "airdate": "2020-06-03T17:13:32Z", "flag": true, "genres": "Drame", "rating": 0.0, "release": "$date", "runtime": 71, "title": "Tranquillo", "studio": "Letterbox Collective Filmproduktion", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/y6frInBbBht833Y40JSWiOfPMxu.jpg"}, {"aired": "2007-01-24", "airdate": "2020-06-03T17:13:06Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.5", "release": "$date", "runtime": 93, "title": "King of California", "studio": "Nu Image", "fanart": "http://image.tmdb.org/t/p/original/dp3SyjDLboXzyYHOciPGdAWemX7.jpg", "poster": "http://image.tmdb.org/t/p/original/zLoa3oJ83zo9g3mV9LNCHbqO7jH.jpg"}, {"aired": "2020-04-16", "airdate": "2020-05-29T14:41:41Z", "flag": true, "genres": "Science-Fiction,Drame,Thriller", "rating": "\u2605 6.3", "release": "$date", "runtime": 113, "title": "Spoutnik", "studio": "Vodorod", "fanart": "http://image.tmdb.org/t/p/original/lGydLXSaDLxN8WoAdubHCnhAgfd.jpg", "poster": "http://image.tmdb.org/t/p/original/tBi5xW9Rd0YoGB0aAggV0EN5LDP.jpg"}, {"aired": "2020-02-06", "airdate": "2020-05-29T14:39:36Z", "flag": true, "genres": "Horreur", "rating": "\u2605 5.2", "release": "$date", "runtime": 104, "title": "A Night of Horror: Nightmare Radio", "studio": "Black Mandala", "fanart": "http://image.tmdb.org/t/p/original/bs7mYckE4BeVRtxK9MRYhNZTTqg.jpg", "poster": "http://image.tmdb.org/t/p/original/g7EYDfGgNEF1IQymS7EvDLKnpxT.jpg"}, {"aired": "1986-05-16", "airdate": "2020-05-26T11:17:43Z", "flag": true, "genres": "Action,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 109, "title": "Top Gun", "studio": "Paramount", "fanart": "http://image.tmdb.org/t/p/original/vSZtQrlJqgjz4GIbnF3kBDkzJFE.jpg", "poster": "http://image.tmdb.org/t/p/original/oBe6dugbK95jabwiIo5uwMU7DYJ.jpg"}, {"aired": "2020-01-01", "airdate": "2020-05-22T09:13:18Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.0", "release": "$date", "runtime": 144, "title": "S\u00e9jour dans les monts Fuchun", "studio": "Dadi Film Group", "fanart": "http://image.tmdb.org/t/p/original/AsDanXphy2uvK227rIZP1BiUWEr.jpg", "poster": "http://image.tmdb.org/t/p/original/7vSuF1621x63Zc5OOyCAx5sxtu.jpg"}] %}

{{ data[1].title }}
{{ data[1].poster }}

Should output

The Way Back
http://image.tmdb.org/t/p/original/ylPnfaphW3FrLBUVwAREVtiL9My.jpg

But you get

<built-in method title of str object at 0x7f788f6e89b0>

So I don’t know what’s wrong.


Just guessing here…

{% set data = state_attr('sensor.kodi_recently_added_movies', 'data') | from_json %} 
{{ data[1].title }}

or worst case

{% set data = state_attr('sensor.kodi_recently_added_movies', 'data') %}
{{ data | regex_findall_index('(?:"title": ")(.*?)(?:",)') }}

mmmh the first template output the right thing :

{% set data = [{"title_default": "$title", "line1_default": "$genres", "line2_default": "$release", "line3_default": "$rating - $runtime", "line4_default": "$studio", "icon": "mdi:arrow-down-bold"}, {"aired": "2020-03-05", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame", "rating": "\u2605 6.7", "release": "$date", "runtime": 108, "title": "The Way Back", "studio": "Warner Bros. Pictures", "fanart": "http://image.tmdb.org/t/p/original/5mubFanEHVFJff4jLQH0uIOThMz.jpg", "poster": "http://image.tmdb.org/t/p/original/ylPnfaphW3FrLBUVwAREVtiL9My.jpg"}, {"aired": "2020-03-11", "airdate": "2020-08-16T01:19:07Z", "flag": true, "genres": "Drame,Romance,Histoire", "rating": "\u2605 6.3", "release": "$date", "runtime": 109, "title": "Radioactive", "studio": "Working Title Films", "fanart": "http://image.tmdb.org/t/p/original/e7tjpKP36Xd6BzyTMZo4AUe86VM.jpg", "poster": "http://image.tmdb.org/t/p/original/eTUBqUBLGx0LUY8HWBXD5zyLkOf.jpg"}, {"aired": "1992-05-22", "airdate": "2020-08-15T23:07:45Z", "flag": true, "genres": "Science-Fiction,Action,Horreur", "rating": "\u2605 6.3", "release": "$date", "runtime": 144, "title": "Alien\u00b3", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/9WO0CELoWq6tSdjqCs34Y0qek7l.jpg", "poster": "http://image.tmdb.org/t/p/original/6vWHGE0IZCkp1o4cqJ7PqqlYC1s.jpg"}, {"aired": "1986-07-18", "airdate": "2020-08-15T23:06:24Z", "flag": true, "genres": "Action,Thriller,Science-Fiction", "rating": "\u2605 7.9", "release": "$date", "runtime": 154, "title": "Aliens, le retour", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/jMBpJFRtrtIXymer93XLavPwI3P.jpg", "poster": "http://image.tmdb.org/t/p/original/3eHFrdmBENZMbutlNMguqTAl3bf.jpg"}, {"aired": "1979-05-25", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Horreur,Science-Fiction", "rating": "\u2605 8.1", "release": "$date", "runtime": 115, "title": "Alien, le huiti\u00e8me passager", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/AmR3JG1VQVxU8TfAvljUhfSFUOx.jpg", "poster": "http://image.tmdb.org/t/p/original/l8CES84JndFlNfBNMxdLRYaLvI6.jpg"}, {"aired": "2020-08-14", "airdate": "2020-08-15T23:04:23Z", "flag": true, "genres": "Action,Crime,Science-Fiction", "rating": "\u2605 6.7", "release": "$date", "runtime": 113, "title": "Project Power", "studio": "Screen Arcade", "fanart": "http://image.tmdb.org/t/p/original/qVygtf2vU15L2yKS4Ke44U4oMdD.jpg", "poster": "http://image.tmdb.org/t/p/original/fjCezXiQWfGuNf4t7LruKky7kwV.jpg"}, {"aired": "2020-07-22", "airdate": "2020-08-15T23:01:59Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.8", "release": "$date", "runtime": 137, "title": "The King of Staten Island", "studio": "Universal Pictures", "fanart": "http://image.tmdb.org/t/p/original/5rwcd24GGltKiqdPT4G2dmchLr9.jpg", "poster": "http://image.tmdb.org/t/p/original/wIYkb0mS9WY53a2dOqCrg0xaSpt.jpg"}, {"aired": "1997-11-12", "airdate": "2020-08-15T22:55:45Z", "flag": true, "genres": "Science-Fiction,Horreur,Action", "rating": "\u2605 6.1", "release": "$date", "runtime": 116, "title": "Alien, la r\u00e9surrection", "studio": "Brandywine Productions", "fanart": "http://image.tmdb.org/t/p/original/zQI8yxl61JTpjCB3MrTbcQBOT82.jpg", "poster": "http://image.tmdb.org/t/p/original/ePPdAnGJk9mR1qNxHhGrIhLAo4Q.jpg"}, {"aired": "2020-06-19", "airdate": "2020-08-15T22:49:16Z", "flag": true, "genres": "Guerre,Action,Drame", "rating": "\u2605 7.5", "release": "$date", "runtime": 91, "title": "USS Greyhound - La bataille de l'Atlantique", "studio": "Playtone", "fanart": "http://image.tmdb.org/t/p/original/xXBnM6uSTk6qqCf0SRZKXcga9Ba.jpg", "poster": "http://image.tmdb.org/t/p/original/stfW5cfX0A5Fvo2SBcXAazlWihg.jpg"}, {"aired": "2020-07-08", "airdate": "2020-08-15T08:33:44Z", "flag": true, "genres": "Familial,Animation,Com\u00e9die,Aventure", "rating": "\u2605 7.5", "release": "$date", "runtime": 93, "title": "Scooby !", "studio": "Warner Animation Group", "fanart": "http://image.tmdb.org/t/p/original/fKtYXUhX5fxMxzQfyUcQW9Shik6.jpg", "poster": "http://image.tmdb.org/t/p/original/4xiq5NpooMCBFjQhGQjx8LqmhTy.jpg"}, {"aired": "2020-02-19", "airdate": "2020-07-07T16:49:30Z", "flag": true, "genres": "Com\u00e9die", "rating": "\u2605 5.8", "release": "$date", "runtime": 97, "title": "10 jours sans maman", "studio": "Soyouz Films", "fanart": "http://image.tmdb.org/t/p/original/5xYyXBhcRfXmZMQ9gCr0a4W2lpu.jpg", "poster": "http://image.tmdb.org/t/p/original/xEbSztKAAwIljX8A537HeZDKXUS.jpg"}, {"aired": "2020-03-04", "airdate": "2020-07-07T16:44:16Z", "flag": true, "genres": "Histoire,Drame", "rating": "\u2605 6.2", "release": "$date", "runtime": 108, "title": "De Gaulle", "studio": "Vertigo Productions", "fanart": "http://image.tmdb.org/t/p/original/gQV3joTmJmqN7I5G6Cpjvy84WWd.jpg", "poster": "http://image.tmdb.org/t/p/original/lfxs2YnuuLR037Ad4wesW5O9oUW.jpg"}, {"aired": "2019-11-27", "airdate": "2020-07-07T16:43:23Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 4.5", "release": "$date", "runtime": 83, "title": "Toute ressemblance\u2026", "studio": "Les Films du 24", "fanart": "http://image.tmdb.org/t/p/original/ofZaU8KxCjWMZ6dz8uL5lbxuxre.jpg", "poster": "http://image.tmdb.org/t/p/original/pqSaIXltXdFKsu8dt4ppNmuBPWs.jpg"}, {"aired": "2019-12-19", "airdate": "2020-06-29T17:11:02Z", "flag": true, "genres": "Fantastique,Familial,Aventure,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 125, "title": "Pinocchio", "studio": "Fonds Eurimages du Conseil de l'Europe", "fanart": "http://image.tmdb.org/t/p/original/AdqOBPw4PdtzOcfEuQuZ8MNeTKb.jpg", "poster": "http://image.tmdb.org/t/p/original/xoYcb037L7JQw6MZo1fhM16mfJ7.jpg"}, {"aired": "2018-01-27", "airdate": "2020-06-29T17:08:49Z", "flag": true, "genres": "", "rating": 0.0, "release": "$date", "runtime": 11, "title": "Bluebird", "studio": "", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/c97uq80B1A3JxNS3SiVsK9xWoBM.jpg"}, {"aired": "2020-03-06", "airdate": "2020-06-13T16:58:23Z", "flag": true, "genres": "Drame", "rating": "\u2605 7.6", "release": "$date", "runtime": 120, "title": "The Banker", "studio": "Romulus Entertainment", "fanart": "http://image.tmdb.org/t/p/original/jqz8FwISQfyum47PUqgPTGtmiMk.jpg", "poster": "http://image.tmdb.org/t/p/original/biXzsw22U6vSd0XktmZwAOc4uik.jpg"}, {"aired": "1998-10-30", "airdate": "2020-06-13T16:55:41Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.4", "release": "$date", "runtime": 118, "title": "American History X", "studio": "New Line Cinema", "fanart": "http://image.tmdb.org/t/p/original/9LSsSPbP715XT9B7acIZzantPyX.jpg", "poster": "http://image.tmdb.org/t/p/original/yygSRdHdcIVPRNC0rDv658ZdJiD.jpg"}, {"aired": "2019-07-19", "airdate": "2020-06-13T16:54:41Z", "flag": true, "genres": "Animation,Romance,Fantastique,Drame,Aventure", "rating": "\u2605 8.0", "release": "$date", "runtime": 113, "title": "Les Enfants du Temps", "studio": "Toho Company, Ltd.", "fanart": "http://image.tmdb.org/t/p/original/ize3ZieqSy0TCWljmVoEiy8fSFS.jpg", "poster": "http://image.tmdb.org/t/p/original/k0tHYSbzOEkxOYoVLLstLg4Gdkd.jpg"}, {"aired": "2019-07-10", "airdate": "2020-06-03T17:14:01Z", "flag": true, "genres": "Horreur", "rating": "\u2605 6.4", "release": "$date", "runtime": 95, "title": "The Wretched", "studio": "", "fanart": "http://image.tmdb.org/t/p/original/su0huGwZfAmzPvUjnlG42LO9GFl.jpg", "poster": "http://image.tmdb.org/t/p/original/7Jk4pDMM3G9h29lWshEZjX711wg.jpg"}, {"aired": "2018-01-25", "airdate": "2020-06-03T17:13:32Z", "flag": true, "genres": "Drame", "rating": 0.0, "release": "$date", "runtime": 71, "title": "Tranquillo", "studio": "Letterbox Collective Filmproduktion", "fanart": "", "poster": "http://image.tmdb.org/t/p/original/y6frInBbBht833Y40JSWiOfPMxu.jpg"}, {"aired": "2007-01-24", "airdate": "2020-06-03T17:13:06Z", "flag": true, "genres": "Com\u00e9die,Drame", "rating": "\u2605 6.5", "release": "$date", "runtime": 93, "title": "King of California", "studio": "Nu Image", "fanart": "http://image.tmdb.org/t/p/original/dp3SyjDLboXzyYHOciPGdAWemX7.jpg", "poster": "http://image.tmdb.org/t/p/original/zLoa3oJ83zo9g3mV9LNCHbqO7jH.jpg"}, {"aired": "2020-04-16", "airdate": "2020-05-29T14:41:41Z", "flag": true, "genres": "Science-Fiction,Drame,Thriller", "rating": "\u2605 6.3", "release": "$date", "runtime": 113, "title": "Spoutnik", "studio": "Vodorod", "fanart": "http://image.tmdb.org/t/p/original/lGydLXSaDLxN8WoAdubHCnhAgfd.jpg", "poster": "http://image.tmdb.org/t/p/original/tBi5xW9Rd0YoGB0aAggV0EN5LDP.jpg"}, {"aired": "2020-02-06", "airdate": "2020-05-29T14:39:36Z", "flag": true, "genres": "Horreur", "rating": "\u2605 5.2", "release": "$date", "runtime": 104, "title": "A Night of Horror: Nightmare Radio", "studio": "Black Mandala", "fanart": "http://image.tmdb.org/t/p/original/bs7mYckE4BeVRtxK9MRYhNZTTqg.jpg", "poster": "http://image.tmdb.org/t/p/original/g7EYDfGgNEF1IQymS7EvDLKnpxT.jpg"}, {"aired": "1986-05-16", "airdate": "2020-05-26T11:17:43Z", "flag": true, "genres": "Action,Drame", "rating": "\u2605 6.9", "release": "$date", "runtime": 109, "title": "Top Gun", "studio": "Paramount", "fanart": "http://image.tmdb.org/t/p/original/vSZtQrlJqgjz4GIbnF3kBDkzJFE.jpg", "poster": "http://image.tmdb.org/t/p/original/oBe6dugbK95jabwiIo5uwMU7DYJ.jpg"}, {"aired": "2020-01-01", "airdate": "2020-05-22T09:13:18Z", "flag": true, "genres": "Drame", "rating": "\u2605 8.0", "release": "$date", "runtime": 144, "title": "S\u00e9jour dans les monts Fuchun", "studio": "Dadi Film Group", "fanart": "http://image.tmdb.org/t/p/original/AsDanXphy2uvK227rIZP1BiUWEr.jpg", "poster": "http://image.tmdb.org/t/p/original/7vSuF1621x63Zc5OOyCAx5sxtu.jpg"}] %}

{{ data[1].title }}
{{ data[1].poster }}
The Way Back
http://image.tmdb.org/t/p/original/ylPnfaphW3FrLBUVwAREVtiL9My.jpg

the last 2 templates just output “The Way Back” without the url.

but i dont know what to do with this information :stuck_out_tongue:

Well there you go :innocent:

“from_json … de-serializing a JSON string back into an object.”

I have no way of testing it but I guess something like JSON.parse() in js

state_display: >
  [[[ const data = JSON.parse(states[entity.entity_id].attributes.data);
  return `${data[1].title} (${data[1].aired.split('-')[0]})`; ]]]

media_image: &plex_poster
  [background-position: center center, background-image: 
  "[[[ return 'url(' + JSON.parse(states[entity.entity_id].attributes.data[1].fanart) + ')'; ]]]"]

lovelace :

                  - type: conditional
                    conditions:
                      - entity: light.salon
                        state: 'on'
                    elements:
                      - type: custom:button-card
                        entity: sensor.kodi_recently_added_movies
                        triggers_update:
                          ['sensor.kodi_recently_added_movies']
                        name: Derniers Films
                        state_display: >
                          [[[ const data = JSON.parse(states[entity.entity_id].attributes.data);
                          return `${data[1].title} (${data[1].aired.split('-')[0]})`; ]]]
                        custom_fields:
                          icon: >
                            <svg viewBox="0 0 50 50"><path d="M7.7.3h34.6c4.1 0 7.4 3.3 7.4 7.4v34.6c0 4.1-3.3 7.4-7.4 7.4H7.7c-4.1 0-7.4-3.3-7.4-7.4V7.7C.3 3.6 3.6.3 7.7.3z" fill="#282a2d"/><path d="M25,7.1H14.6L25,25L14.6,42.9H25L35.4,25L25,7.1z" fill="#e5a00d"/></svg>
                          blur: >
                            <svg viewBox="0 0 50 50" />
                        styles:
                          custom_fields:
                            media_image: &plex_poster
                              [background-position: center center, background-image:
                              "[[[ return 'url(' + JSON.parse(states[entity.entity_id].attributes.data[1].fanart) + ')'; ]]]"]
                            blur: *plex_poster
                            overlay: [background: 'rgba(0, 0, 0, 0.4)']
                          card:
                            [color: '#efefef', text-shadow: '1px 1px 5px rgba(18, 22, 23, 0.9)']
                        tap_action:
                          action: none
                        style:
                          top: 50%
                          left: 50%
                          width: 100%
                        template: conditional_media

error in the card :

errors in chrome develloper mode :

button-card.js:1643 Uncaught (in promise) TypeError: e.setConfig is not a function

button-card.js:1643 ButtonCardJSTemplateError: SyntaxError: Unexpected token u in JSON at position 0 in 'return 'url(' + JSON.parse(states[entity.entity_id].attributes.data[1].fanart) + ')';'
    at JSON.parse (<anonymous>)
    at HTMLElement.eval (eval at _evalTemplate (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1693:14), <anonymous>:3:37)
    at HTMLElement._evalTemplate (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1693:106)
    at HTMLElement._getTemplateOrValue (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1702:97)
    at http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1736:19
    at Array.forEach (<anonymous>)
    at HTMLElement._buildCustomStyleGeneric (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1735:28)
    at http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1766:56
    at Array.forEach (<anonymous>)
    at HTMLElement._buildCustomFields (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1764:24)



button-card.js:1643 ButtonCardJSTemplateError: SyntaxError: Unexpected token u in JSON at position 0 in 'return 'url(' + JSON.parse(states[entity.entity_id].attributes.data[1].fanart) + ')';'
    at JSON.parse (<anonymous>)
    at HTMLElement.eval (eval at _evalTemplate (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1693:14), <anonymous>:3:37)
    at HTMLElement._evalTemplate (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1693:106)
    at HTMLElement._getTemplateOrValue (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1702:97)
    at http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1736:19
    at Array.forEach (<anonymous>)
    at HTMLElement._buildCustomStyleGeneric (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1735:28)
    at http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1766:56
    at Array.forEach (<anonymous>)
    at HTMLElement._buildCustomFields (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1764:24)



button-card.js:1643 ButtonCardJSTemplateError: SyntaxError: Unexpected token u in JSON at position 0 in 'return 'url(' + JSON.parse(states[entity.entity_id].attributes.data[1].fanart) + ')';'
    at JSON.parse (<anonymous>)
    at HTMLElement.eval (eval at _evalTemplate (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1693:14), <anonymous>:3:37)
    at HTMLElement._evalTemplate (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1693:106)
    at HTMLElement._getTemplateOrValue (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1702:97)
    at http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1736:19
    at Array.forEach (<anonymous>)
    at HTMLElement._buildCustomStyleGeneric (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1735:28)
    at http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1766:56
    at Array.forEach (<anonymous>)
    at HTMLElement._buildCustomFields (http://192.168.0.20:8123/hacsfiles/button-card/button-card.js:1764:24)

i checked all i could to find the error by myself, but i’m out of competence here :slight_smile:

Thx for your help :stuck_out_tongue:

It work for the image !
changed

  "[[[ return 'url(' + JSON.parse(states[entity.entity_id].attributes.data[1].fanart) + ')'; ]]]"]

to

  "[[[ return 'url(' + JSON.parse(states[entity.entity_id].attributes.data)[1].fanart + ')'; ]]]"]

Thx a lot :smiley:

A last thing, state display dont work the way it does in your screenshot, it dont display anything.
I managed to display the film’s name with

                        name: >
                          [[[ const data = JSON.parse(states[entity.entity_id].attributes.data);
                          return `${data[1].title} (${data[1].aired.split('-')[0]})`; ]]]

but it seems a little hacky :stuck_out_tongue:
all in all, your guessing was right, you’re a master !

Many Thanks.

thank YOU Mattias!

when i click the button, doosent work:

grafik

when i hold a button works fine:

Why dosent word with click? Any Idea?

LOG:2020-09-05 21:20:14 ERROR (MainThread) [frontend.js.latest.202008110] http://ip adress/hacsfiles/button-card/button-card.js line 1693 > Function:3:20 ButtonCardJSTemplateError: TypeError: states['switch.fullykiosk_screensaver'] is undefined in 'if (entity.state === 'off' && states['switch.fullykiosk_screensaver'].state === 'off') { hass.call...'