📰 Lovelace: RSS Feed Parser Plugin/List Card

I would try editing the lines about enclosure to links instead for your use case


https://pythonhosted.org/feedparser/reference-entry-links.html#entries-i-links-j-href

Hi Niklas, i would like to follow Expressen as well and did you ever get this to work?
Thanks :slight_smile:

Hi, how can I display the 16/9 thumbnail images of a newspaper rss feed (Le Soir) properly in list-card? Actually, the images are stretched vertically and look awful.
Thanks!

You are an absolute legend, this resolved the issue for me. Thank you!

Hey, trying to install this list card, but cant find it at HACS!

- platform: feedparser
    name: rotter
    feed_url: 'https://rotter.net/rss/rotternews.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - description
      - pubDate

I try to work this way. - I write the code inside configuartion.yaml
what am I not doing right?

I got the RSS feeds working with the feedparser and Card-list. I just can’t seem to get pictures to go with the news. I have used the developer tool to request the entry and I get this:

entries:
  - title: >-
      Nederland heeft meerdere locaties op het oog om OekraĂŻense vluchtelingen
      op te vangen
    title_detail:
      type: text/plain
      language: null
      base: https://www.nrc.nl/rss/
      value: >-
        Nederland heeft meerdere locaties op het oog om OekraĂŻense vluchtelingen
        op te vangen
    summary: >-
      Staatssecretaris Eric van der Burg wilde nog niet zeggen om welke locaties
      het gaat, omdat hij eerst in gesprek moet met meerdere gemeenten.
    summary_detail:
      type: text/html
      language: null
      base: https://www.nrc.nl/rss/
      value: >-
        Staatssecretaris Eric van der Burg wilde nog niet zeggen om welke
        locaties het gaat, omdat hij eerst in gesprek moet met meerdere
        gemeenten.
    published: 'Fri, 25 Feb 2022 17:39:27 '
    links:
      - length: '0'
        type: image/jpeg
        href: >-
          https://images.nrc.nl/VP_oHVIXTq63i8Sw6_Vr4hrNMmc=/1280x/filters:no_upscale()/s3/static.nrc.nl/liveblog/files/2022/02/ministerraad-op-het-binnenhof45716861.jpg
        rel: enclosure
      - rel: alternate
        type: text/html
        href: >-
          https://www.nrc.nl/nieuws/2022/02/25/nederland-heeft-meerdere-locaties-op-het-oog-om-oekraiense-vluchtelingen-op-te-vangen-a4094741
    tags:
      - term: Laatste nieuws OekraĂŻne
        scheme: index/block
        label: null
    link: >-
      https://www.nrc.nl/nieuws/2022/02/25/nederland-heeft-meerdere-locaties-op-het-oog-om-oekraiense-vluchtelingen-op-te-vangen-a4094741
    id: http://www.nrc.nl/4094741
    guidislink: false

I have this as a card-list:

type: custom:list-card
entity: sensor.nrc
title: Nieuws
feed_attribute: entries
row_limit: 3
columns:
  - title: ''
    field: links
    type: image
  - title: ''
    field: summary

Resulting in this:

I suspect that I do not get the pictures because many Dutch RSS feeds differ from the standard.
I think it lies with these rules:

- length: '0'
        type: image/jpeg
        href: >-
          https://images.nrc.nl/VP_oHVIXTq63i8Sw6_Vr4hrNMmc=/1280x/filters:no_upscale()/s3/static.nrc.nl/liveblog/files/2022/02/ministerraad-op-het-binnenhof45716861.jpg
        rel: enclosure

Have more people encountered this and is there a solution?

I think your problem has to do with ‘title, description and pubdate’. You best refer back to post 208. There afishe2000 explains what to do. Probably ‘description’ should be something like ‘summary’ and ‘pubdate’ maybe doesn’t even exists.

Hi,

Can you help me?
My RSS feed is: hvg.hu RSS
The image URL:
{{ states.sensor.hvg.attributes.entries[0][‘links’][1][‘href’]}}

I try this code:

  - platform: feedparser
    name: hvg
    feed_url: 'https://hvg.hu/rss'
    date_format: '%b %d'
    inclusions:
      - title
      - link
      - published
      - summary
      - image
                if 'image' in self._inclusions and 'image' not in entryValue.keys():
                    images = []
                    if 'summary' in entry.keys():
                        images = re.findall(r"<img.+?src=\"(.+?)\".+?>", entry['summary'])
                    if images:
                        entryValue['image'] = images[0]
                    else:
                        if 'links' in entry.keys():
                            images = re.findall("\'href\': \'(.+?)\'", str(entry['links']))
                        if images:
                            entryValue['image'] = images[1]
                        else:
                            entryValue['image'] = "https://www.home-assistant.io/images/favicon-192x192-full.png"

But, If I use include “inclusions”, the sensor not showing in entites list. If I delete the inclusions section, the sensor appear in entites list, but it don’t show image url.

What do I do wrong?

Thanks!

anyone know why since 2022.3.0 This Home Assistant Podcast card looks like this?

              - entity: sensor.gpodder
                type: custom:podcast-card
                name: Home Assistant Podcasts
                icon: mdi:home-assistant
                default_target: media_player.office_speaker
                show_player: true
                custom_player: true

I think it uses some paper elements that were removed. I’ll see about a fix this weekend

Can you create an issue on the repo so I don’t forget?

Will do Ian
 I’m not sure how this ended up in this thread


Could you then also have a look at RSS-feeds where the image is a type within the links section. In the present situation the images don’t show. See e.g 266 of this topic. I would be very nice to have the pictures as well in this splendid card-list.

Hi folks!
Really love this FeedParser

However, having one issue with a rss feed

The RSS contains:

entries: 
- id: rss:sr.se/traffic/8754486
  guidislink: true
  link: https://sverigesradio.se/trafiken?id=8754486
  title: E18 NorrtÀljevÀgen (Trafikstörning)
  title_detail:
    type: text/plain
    language: sv
    base: https://api.sr.se/api/rss/traffic/2859
    value: E18 NorrtÀljevÀgen (Trafikstörning)
  summary: >-
    <p>VÀgen avstÀngd i riktning mot NorrtÀlje pÄ grund av bil som brinner.
    Prognos 13:15.<br />Slutet pÄ eller strax efter pÄfarten vid tpl Rösa i
    riktning mot NorrtÀlje</p>
  summary_detail:
    type: text/html
    language: sv
    base: https://api.sr.se/api/rss/traffic/2859
    value: >-
      <p>VÀgen avstÀngd i riktning mot NorrtÀlje pÄ grund av bil som brinner.
      Prognos 13:15.<br />Slutet pÄ eller strax efter pÄfarten vid tpl Rösa i
      riktning mot NorrtÀlje</p>
  published: 'Sat, 05 Mar 2022 12:27:04 '
  updated: 'Sat, 05 Mar 2022 12:27:04 '
  authors:
    - name: Trafikredaktionen Stockholm
  author_detail:
    name: Trafikredaktionen Stockholm
  author: Trafikredaktionen Stockholm
  links:
    - href: https://sverigesradio.se/trafiken?id=8754486
      rel: alternate
      type: text/html
  tags:
    - term: VĂ€g
      scheme: null
      label: null

I want to use the “tags → term” as a column in the list-card. How do I do that?

type: custom:list-card
entity: sensor.trafiken_test
title: TRAFIK
feed_attribute: entries
columns:
  - title: Title
    field: tags

This give me [object Object] only

image

Guys, I’m sorry for this super basic question, but how do you add a second feed? I’m very new to this and I read through this entire post but didn’t see an example of the yaml. I tried adding it like I’ve shown below as well as a few other combinations but I only ever see one feedparser sensor in the Developer Tool.

  - platform: feedparser
    name: Engineering Feed
    feed_url: 'https://www.sciencedaily.com/rss/matter_energy/engineering.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - link
      - description
      - image
      - language
      - pubDate
    exclusions:
      - language
	  
  - platform: feedparser
    name: CNN
    feed_url: 'https://www.cnn.com/services/rss/'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
    exclusions:

If someone could point me in the right direction, I’d really appreciate it. Thank you!

Probably because you have nothing under ‘inclusions’ for the second one? I’m not completely sure but other than that, your config is like mine for multiple feeds.

Your feed_url is invalid. This is the page for all the RSS from CNN, not an actual RSS feed. Use: http://rss.cnn.com/rss/cnn_topstories.rss for top stories for example as listed on that page you are referencing.

hello,
I would like to read the content of the title with tts.
I can’t retrieve this data
can someone help me?
Thank you

Hi Ian. Thanks for the lovely work.

I would like to ask a question. Is there a way to display the news horizontally ?

type: horizontal-stack
cards:
  - columns:
      - field: image
        type: image
      - field: title
        title: ''
    entity: sensor.besiktas
    title: BeƟiktaƟ
    feed_attribute: entries
    row_limit: 7
    type: custom:list-card
    style: |
      ha-card {
        max-width: 750px;
        margin-left: auto;
        margin-right: auto;
      }
      img {
        float: center;
        width: 400px;
        height: 200px;
        margin-left: 10px;
        margin-right: 15px;
        margin-top: 10px;
        margin-bottom: 15px;
        box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.5);
      }
      .title {
        font-weight: 700;
        font-size: 22px;
        line-height: 1.2;
      } 
      td:first-child {
        padding-left: 10px;
        padding-top: 10px;
        display: block;
      }
      td:nth-of-type(2) {
        padding-left: 10px;
        opacity: 0.7;
        display: block;
      }
      td:last-child {
        min-height: 23px;
        display: block;
      }
      tr {
        display: block;
      }
      th {
        display: none;
      }
      p {
        margin: 10px;
      }

As you can see its vertical right now but I want it to be horizontal.