📰 Lovelace: RSS Feed Parser Plugin/List Card

ah fair enough bud

The RSS feed I want to use doesn’t have a seperate description field but it does have a summary. The issue however is their summary field contains unnecessary info, such as button for sharing. Is there a way to only take the text/description from the summary and not everything?

e.g. this is the html. Realistically I only need the field which would give me both picture and description underneath or just the description

  summary: >-
    <img
    src="https://www.skai.gr/sites/default/files/styles/article_580x326/public/2020-05/dendias_maas_tilediaskepsi_ypex_eyt7zuzxsaiupaq.jpg?itok=DoXOFzzy"
    />  Η τηλεδιάσκεψη του γερμανού ΥΠΕΞ με ομολόγους του από 10 ευρωπαϊκές
    χώρες -μεταξύ αυτών Ελλάδα και Κύπρος. Ελεγχόμενη επιστροφή στον τουρισμό με
    διαφάνεια. Ταξιδιωτικές οδηγίες για κάθε τουριστικό προορισμό ξεχωριστά.<div
    class="feedflare">

    <a
    href="http://feeds.feedburner.com/~ff/skai/Uulu?a=bWyY5_zqHMk:3_SsbvKM-g0:yIl2AUoC8zA"><img
    border="0" src="http://feeds.feedburner.com/~ff/skai/Uulu?d=yIl2AUoC8zA"
    /></a> <a
    href="http://feeds.feedburner.com/~ff/skai/Uulu?a=bWyY5_zqHMk:3_SsbvKM-g0:qj6IDK7rITs"><img
    border="0" src="http://feeds.feedburner.com/~ff/skai/Uulu?d=qj6IDK7rITs"
    /></a> <a
    href="http://feeds.feedburner.com/~ff/skai/Uulu?a=bWyY5_zqHMk:3_SsbvKM-g0:ediIyDSnjWY"><img
    border="0"
    src="http://feeds.feedburner.com/~ff/skai/Uulu?i=bWyY5_zqHMk:3_SsbvKM-g0:ediIyDSnjWY"
    /></a> <a
    href="http://feeds.feedburner.com/~ff/skai/Uulu?a=bWyY5_zqHMk:3_SsbvKM-g0:xPm9H916Bxo"><img
    border="0" src="http://feeds.feedburner.com/~ff/skai/Uulu?d=xPm9H916Bxo"
    /></a>

    </div><img alt="" height="1"
    src="http://feeds.feedburner.com/~r/skai/Uulu/~4/bWyY5_zqHMk" width="1" />

I started to use feedparser but it gives me an error:

Setup failed for feedparser: No setup function defined.

I have installed with HACS and put feedparser: in configuration.yaml

Debug is not giving me more info

2020-05-20 16:37:09 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

2020-05 20 16:37:18 ERROR (MainThread) [homeassistant.setup] Setup failed for feedparser: No setup function defined.

2020-05-20 16:37:18 INFO (MainThread) [homeassistant.setup] Setting up ssdp



2020-05-20 16:37:09 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

2020-05-20 16:37:18 INFO (MainThread) [homeassistant.setup] Setting up feedparser

2020-05-20 16:37:18 ERROR (MainThread) [homeassistant.setup] Setup failed for feedparser: No setup function defined.


2020-05-20 16:37:18 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following integrations and platforms could not be set up:

 - feedparser

Please check your config., notification_id=invalid_config>

2020-05-20 16:37:19 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following integrations and platforms could not be set up:

 - feedparser

Please check your config. @ 2020-05-20T16:37:19.105935+02:00>>

Sorry, but I don’t know what I’m doing wrong

hey there,
im trying to reproduce your Netflix upcoming media lovelace card but i doesnt get it, can you please help me out with the configs?

in sensor.yaml i got

  - platform: feedparser
    name: Netflix
    feed_url: 'https://www.vodspy.de/netflix/rss.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - summary
      - published
      - image
      - img

and in lovelace.yaml i got following:

      - type: vertical-stack
        cards:
          - columns:
          - field: title
            title: ''
          - field: published
            title: ''
          - field: summary
            title: ''
        entity: sensor.netflix
        title: Netflix
        feed_attribute: entries
        type: 'custom:list-card'
        style: |
          ha-card {
            max-width: 750px;
            margin-left: auto;
            margin-right: auto;
          }
          img {
            float: left;
            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: 230px;
            display: block;
          }
          tr {
            display: block;
          }
          th {
            display: none;
          }
          p {
            margin: 10px;
          }
      - columns:
          - field: summary
            title: ''
        entity: sensor.netflix
        title: ''
        type: 'custom:list-card'
        style: |
          ha-card {
            position: fixed !important;
            top: 0px;
            left: -10px;
            width: 380px;
            z-index: -10000;
            filter: blur(3px);
            opacity: 0.5;
          }
          img {
            height: 250px;
            margin: 0px;

            box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.5);
          }
          td:last-child {
            display: inline;
          }
          td:last-child p {
            display: none;
          }
          tr {
            display: inline;
          }
          th {
            display: none;
          }
      - columns:
          - field: summary
            title: ''
        entity: sensor.netflix
        title: ''
        type: 'custom:list-card'
        style: |
          ha-card {
            position: fixed !important;
            top: 0px;
            right: -10px;
            width: 380px;
            z-index: -10000;
            filter: blur(3px);
            opacity: 0.5;
          }
          img {
            height: 250px;
            margin: 0px;

            box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.5);
          }
          td:last-child {
            display: inline;
          }
          td:last-child p {
            display: none;
          }
          tr {
            display: inline;
          }
          th {
            display: none;
          }

what am i missing in this?

How did you fix it?

I have the same, only title and link in the dev overview at the entity.

I’m having in configuration.yaml sensors:

  • platform: feedparser
    name: Weather Images Feed
    feed_url: ‘http://rss .localwebsite /rss/weather.xml’
    date_format: ‘%a %b %d %H:%M:%S %Z %Y’
    inclusions:
    • title
    • link
    • description
    • pubDate
      exclusions:
    • guid

And the XML file has this information:


  <item>
    <title>Weather Graphic [barometer.jpg]</title>
    <link>http://rss *localwebsite* /rss/barometer.jpg</link>
    <description>Display of barometer [800 x 480]</description>
    <pubDate>Wed Jul 02 21:50:14 GMT 2020</pubDate>
    <guid isPermaLink="false">a848657c-58bd-4616-92fc-708945a458d6</guid>
    <media:content url="http://rss * localwebsite* /rss/barometer.jpg" width="800" height="480" type="image/jpeg" />
  </item>

And in the Dev ‘States’

[sensor.weather_images_feed] 11 entries: -
title: ‘Weather Graphic [watch.jpg]’
link: ‘http://rss. localwebsite /rss/watch.jpg’

  • and 10 more entries

But I can’t get the card working.
I want Description and the Image showing.

ps. localwebsite is ‘fingered’

Need someone help you with testing?

Hi there. I use this plugin with list card.

1: I don’t understant how to fit the text perfectly in the card. Actually looks bad:

2: How to add only the 10 last news in the card (here i’ve got 25-30 news, it’s a lot !).

Any advice is welcome. Thanks.

row_limit: 10
Add column style‘, probably text-align: center` should center it if that’s what you want

1 Like

Hi All,

Loving Feedparser but am struggling to get an image through to display. Image always shows the HA logo. show do i get the image from the rss feed?

TIA

Dave G

Hey @iantrich, am I missing something or is this not listed in HACS anymore? I can’t seem to find it to install it. Thanks!

I think Ian moved some of his repos a while ago. You should still be able to add the repo as a custom repo in HACS though.

Hi all

I’m trying to make it work in my setup but it is not working yet.

I want to retrieve the 10 last feeds in Home Assistant and have the titles displayed on a esp32 with esphome.

in Home Assistant I have configured it as below (which I have seen in the replies above)

  - platform: feedparser
    name: franceinfo
    feed_url: 'https://www.francetvinfo.fr/titres.rss'
    show_topn: 10

  - platform: template
    sensors:
      fi_10_title:
        friendly_name: 'fi_10_title'
        value_template: >
          {{ states.sensor.franceinfo.attributes.entries | map(attribute='title') | list | join(' -- ') }}

but even in HA itself it doesn’t work. it always show “Unknown”

however I’m able to display the first two titles if I use this. but from the thrid title it doesn’t work anymore

  - platform: template
    sensors:
      fi_10_title:
        friendly_name: 'fi_10_title'
        value_template: >
          {{ states.sensor.franceinfo.attributes.entries[0].title }} 
          {{ states.sensor.franceinfo.attributes.entries[1].title }} 

any advice ?

Luj

Hi,

I have this entry in the Feeder sensor, and I a able to get everything out in the list-card module, except the image. Image wont show up.

Here an entry in the sensor:

entries:
  - title: 'L&#039;État de New York veut dissoudre la NRA'
    title_detail:
      type: text/html
      language: null
      base: 'https://www.lapresse.ca/manchettes/rss'
      value: 'L&#039;État de New York veut dissoudre la NRA'
    links:
      - length: '245664'
        type: image/jpg
        href: >-
          https://mobile-img.lpcdn.ca/lpca/924x/r3996/cf44f5bb-d7fc-11ea-b8ad-02fe89184577.jpg
        rel: enclosure
      - rel: alternate
        type: text/html
        href: >-
          https://www.lapresse.ca/international/etats-unis/2020-08-06/l-etat-de-new-york-veut-dissoudre-la-nra.php
    link: >-
      https://www.lapresse.ca/international/etats-unis/2020-08-06/l-etat-de-new-york-veut-dissoudre-la-nra.php
    id: 7a0ec5128c2831098dfd3c4d91f4fd95
    guidislink: false
    published: 'Thu, Aug 06 11:54 AM'
    summary: >-
      L’État de New York a annoncé jeudi qu’il portait plainte contre le lobby
      pro-armes NRA et son influent patron Wayne LaPierre pour fraude
      financière, avec pour objectif la dissolution de ce puissant groupe
      conservateur.
    summary_detail:
      type: text/html
      language: null
      base: 'https://www.lapresse.ca/manchettes/rss'
      value: >-
        L’État de New York a annoncé jeudi qu’il portait plainte contre le lobby
        pro-armes NRA et son influent patron Wayne LaPierre pour fraude
        financière, avec pour objectif la dissolution de ce puissant groupe
        conservateur.
    authors:
      - {}
    author: ''
    dc_source: Agence France-Presse

and here is my lovelace card:

cards:
      - columns:
          - add_link: link
            field: links
            title: ''
            type: image
          - field: title
            title: Title
          - field: summary
            title: Summary
        entity: sensor.lapresse_ca
        feed_attribute: entries
        title: LaPresse.ca
        type: 'custom:list-card'
    path: newsfeed
    title: NewsFeed

Ive got the feedparser working, and my sensor has data, but for the life of me i cannot get the list-card working.

I added a custom repo to HACS, and installed it from there, but i just get card not found errors.

Error: Custom element not found: list-card

Im sure ive just done something obvious wrong, its been one of those days!

Have you refreshed your page - eg. pressed Ctrl+F5 or have tried restarting Home Assistant?

If it is still not working, add an additional entry into the Configuration -> Lovelace -> Resources area :
/local/community/list-card/list-card.js

Remember to refresh your browser (Ctrl-F5) after doing that.

Did you end up finding this? I can’t find it in HACS either.

Ensure you have it in quote in your lovelace setting:

type: 'custom:list-card'

@iantrich
In your sensor for images are you using an if statement to pull the entire image tag * or are you trying to isolate the URL path in quotes? No matter how i change the expression i always end up with the Home Assistant favicon.

Trying to get the images from this RSS feed:
https://slickdeals.net/newsearch.php?mode=popdeals&searcharea=deals&searchin=first&rss=1

seems like this expression should fix the issue im having but its still not working:
“(.+?).thumb”

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'])
    images = re.findall(r"(.+?)\.thumb", entry['summary'])
    if images:
      entryValue['image'] = images[0]
    else:
      entryValue['image'] = "https://www.home-assistant.io/images/favicon-192x192-full.png"

any help would be great
Thanks

Im having trouble adding the list card to the frontend. It doesnt give me the option for the sensor I want it seems I can only put an input_select option and I dont have that.

Not sure what you mean here, what is “it” that is not giving you the option? This is custom card with no editor, so you just enter in your yaml as a manual card