šŸ“° Lovelace: RSS Feed Parser Plugin/List Card

Someone needs to update the documentation to explain to get the inclusion and exclusion keys from the imported attributes and NOT from the raw RSS feed/XML.

1 Like

Hi,
This seems to be a very nice addon. Thanks for this work.
I try to get some rss news from Forula one. The table in lovelace is empty and I do not know what I am doing wrong. Any support will be more than welcome :

  - platform: feedparser
    name: Formula One
    feed_url: 'https://feeds2.feedburner.com/f1fanatic'
    date_format: '%a, %d %b %Y %H:%M:%S %Z'
    scan_interval:
      hours: 3
    inclusions:
      - title
      - link
      - description
      - image
      - pubDate
    exclusions:
      - language
          cards:
          - type: custom:list-card
            entity: sensor.formula_one
            title: Formula One
            feed_attribute: entries
            columns:
              - title: ''
                type: image
                add_link: link   
              - title: Title
                field: title

Like a lot of folks, Iā€™m also having issues getting the feed images into the list card. The thing is, this was working just fine and suddenly stopped, and now displays the HA logo thumbnail along with the feed text. The thumbnail image still links to the article.

I reviewed topic 266, which in turn refers to 208, in which the poster modified feedparserā€™s sensor.py and list card code. I tried this as well, with the same results.

I have tried another feed in case the one Iā€™m using has changed, but that doesnā€™t seem to be the case.

Iā€™m not sure what broke this, if it was an HA update, or what.

Appreciate any help. The feeds looked so much better with the story imageā€¦

1 Like

Hey guys, Iā€™m hoping someone can help me with this because Iā€™m super close to getting it working! I want to have a card that displays a quote of the day. It would pick this quote randomly from a list that I create.

What Iā€™ve gotten to work so far is creating an RSS feed that has entries for each quote and who said it. Using feedparser, I can get it into Home Assistant. However, this is where I get stuck. The only thing that Iā€™ve managed to get into Lovelace is using list-card to display the feed, but list-card can only display the items in order and it has no ability to filter or select an item from the list of entries as far as I can tell. I can either display all the quotes, or just a certain number of entries, but they will always be in whatever order the feed has and always starting from entry 1.

Iā€™ve been trying various solutions where I generate a random number, then it grabs that entry, but none of them work. Using the template engine I can return a json formatted list of all the enttries, or just ā€œNoneā€. Iā€™ve been going through documentation trying to find some way of getting a particular ā€œquoteā€ and ā€œauthorā€ attribute out of the feedparser sensor, but to no avail. Iā€™m not a programmer, but Iā€™m generally code-literate insofar as I understand the principles of programming and the structure of some languages like python and java.

Any ideas?

Hello, I have a question about the feedparser. Namely, I would like to read the RSS feed of the food alerts. Unfortunately I canā€™t read everything. Could someone please help me?

yaml code:

sensor:
  platform: feedparser
  name: Lebensmittelwarnungen
  feed_url: 'https://www.lebensmittelwarnung.de/bvl-lmw-de/opensaga/feed/alle/hessen.rss'
  date_format: '%a, %d %b %Y %H:%M:%S %Z'
  scan_interval:
    hours: 3
  inclusions:
    - title
    - link
    - Grund der Warnung
    - image
  exclusions:
    - language

RSS-Feed

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="https://www.lebensmittelwarnung.de/bvl-lmw-de/opensaga/feed/alle/hessen.rss" rel="self" type="application/rss+xml" />
<title>Lebensmittelwarnung.de - Warnungen in Hessen</title>
<link>https://www.lebensmittelwarnung.de/bvl-lmw-de</link>
<description>In Hessen wird vor folgenden Produkten gewarnt.</description>
<language>de</language>
<pubDate>Mon, 13 Mar 2023 10:35:08 +0000</pubDate>
<lastBuildDate>Mon, 13 Mar 2023 10:35:08 +0000</lastBuildDate>

<image>
<title>Lebensmittelwarnung.de - Warnungen in Hessen</title>
<link>https://www.lebensmittelwarnung.de/bvl-lmw-de</link>
<url>https://www.lebensmittelwarnung.de/bvl-lmw-de/opensaga/res/media/bvlLogo.gif</url>
</image>


<item>
<title>Getrocknete Mu-Err Pilze (moc nhi kho)</title>
<link>https://www.lebensmittelwarnung.de/bvl-lmw-de/detail/lebensmittel/89647</link>
<description><![CDATA[<img src="https://www.lebensmittelwarnung.de/bvl-lmw-de/opensaga/attachment/98971bcc-a2bb-4004-828b-1e31b2cbf107/Produktabbildung .jpg" width="100" /><br/>
<b>Produktbezeichnung:</b>
Getrocknete Mu-Err Pilze (moc nhi kho)<br/>
<b>Typ:</b>
Lebensmittel<br/>
<b>Hersteller (Inverkehrbringer):</b>
Tinh Son Handel GmbH Leipzig<br/>
<b>Grund der Warnung:</b>
Mikrobiologische Verunreinigung mit Salmonellen<br/>
<b>Betroffene LƃĀ¤nder:</b>
Baden-WƃĀ¼rttemberg, Bayern, Berlin, Hamburg, Hessen, Niedersachsen, Rheinland-Pfalz, Sachsen, Schleswig-Holstein, ThƃĀ¼ringen<br/>
]]></description>
<content:encoded><![CDATA[<img src="https://www.lebensmittelwarnung.de/bvl-lmw-de/opensaga/attachment/98971bcc-a2bb-4004-828b-1e31b2cbf107/Produktabbildung .jpg" width="100" /><br/>
<b>Produktbezeichnung:</b>
Getrocknete Mu-Err Pilze (moc nhi kho)<br/>
<b>Typ:</b>
Lebensmittel<br/>
<b>Hersteller (Inverkehrbringer):</b>
Tinh Son Handel GmbH Leipzig<br/>
<b>Grund der Warnung:</b>
Mikrobiologische Verunreinigung mit Salmonellen<br/>
<b>Betroffene LƃĀ¤nder:</b>
Baden-WƃĀ¼rttemberg, Bayern, Berlin, Hamburg, Hessen, Niedersachsen, Rheinland-Pfalz, Sachsen, Schleswig-Holstein, ThƃĀ¼ringen<br/>
]]></content:encoded>
<pubDate>Fri, 10 Mar 2023 09:17:44 +0000</pubDate>
<guid>https://www.lebensmittelwarnung.de/bvl-lmw-de/detail/lebensmittel/89647</guid>
</item>

I still need the ā€œGrund der Warnungā€

Hello.
I donā€™t know if the integration is still supported, but until recently it worked very well. I recently updated HA to the latest version and I canā€™t restart the system. It shows me an error from integration:

Cannot quick reload all YAML configurations because the configuration is not valid: Platform error sensor.feedparser - Exception importing custom_components.feedparser.sensor

I have the code in the sensor.yaml file

Look at the GitHub for the feedparser custom component (link in the 1st post). You need to manually edit two lines of code until they update the repo. Itā€™s an easy fix, or you wait.

Hello, I found a solution on another forum and it works: go to \config\custom_components\feedparser directory.
We edit the sensor.py file.
We replace what is in lines 46 and 47 with this:

"""@asyncio.coroutine"""
async def async_setup_platform(
1 Like

is it possible to make the link clickable?
its pretty useless otherwise?

It is possible. You have to use add_link attribute to the vertical_card config in your Lovelace dashboard. See GitHub - iantrich/list-card: šŸ“° Display sensor list data in a table for more info

Here is a sample config that makes images clickable.

- type: vertical-stack
  cards:
    - type: custom:list-card
      entity: sensor.your_rss_feed_sensor
      title: Your RSS feed sensor
      feed_attribute: entries
      columns:
        - title: ""
          type: image
          add_link: link  # <-- this line does the trick
          field: image
        - title: Title
          field: title
          style:
            - white-space: wrap

Hope it helps

1 Like

Is there a way to see that feedparser tried to scan for new content?
Inside Logbook itā€™s not entirely clear what those entries areā€¦ was it a refresh attempt, was it the time when new content was found.
image

Is there a log to when feedparser TRIED to fetch new entries?

Currently, there is no logging set up for the sensor. Every record that you see in Logbook is related to the sensor update and the state stores the number of the RSS feed entries in the feed at the time it was parsed.

I have published another beta release that adds logging. Give the latest 0.2.0b3 beta release a shot. You can install it through HACS.

In order to record these log entries to the log, you have to enable debug logging for the sensor.

logger:
  default: warning
  logs:
    custom_components.feedparser: debug

This is how the logs look like:

Let me know if it works for you.

I successfully added a RSS newsfeed containing a large number of headlines (Rows);
Iā€™d like to only show one row in my dashboard but cycle through all rows (switching to next row every X seconds) Is there a way to achieve this?
Thanks!

I have solved this with NodeRed. I read the RSS feed of my local newspaper there and have a random record written to a sensor at regular intervals. Then I display this in the dashboard.

Thanks for the feedback, would you mind sharing more details about your NodeRed flow and how your list card is configured ? Thx

I second this, please update the documentation
Start with no include/exclude and work from that data not the RSS

Dear all,
Can anyone help me in creating an automatic scrolling text taken from RSS news (via feedparser sensor).
I would need a single line where a text automatically flows.
I had already created this thing but had to reinstall everything and lost the source code.
Thanks so much to anyone who will help me.

Hello all! Iā€™m sorry if someone already stated a fix but I went through this whole thread and did not see where there were directions to fix the images not displaying.

Below is a screenshot of what I am seeing.

Config Code

sensor:
- platform: feedparser
  name: NFL News
  feed_url: 'https://www.espn.com/espn/rss/nfl/news'
  inclusions:
    - title
    - description
    - image
    - link
    - pubDate

Card Code:

type: custom:list-card
entity: sensor.nfl_news
title: NFL News
feed_attribute: entries
row_limit: 10
columns:
  - title: ''
    type: image
    field: image
  - title: ''
    field: title
    add_link: link

Any help would be appreciated!

@tom_l aware this is 4 years ago but could you elaborate on this use case?
your example has helped me figure out how to filter a feedparser list in dev tools but iā€™m struggling with the syntax to get this into a useable template sensor with objects rather than a stringā€¦

EDIT: have arrived at a working solution below in case it can be of help to others.

I used the following in a template sensor:

{{ state_attr('sensor.example','entries')
              | selectattr('attribute', 'match', 'filter')
              | list
            }}

where ā€˜sensor.exampleā€™ is my feedparser sensor, ā€˜attributeā€™ is the field I want to search and ā€˜filterā€™ is the search term I wish to match.

Iā€™m trying to get the title, EventDates, and EventTimes tags from this feed Rowan County - Calendar - Library.
Doing it this way I can only get the title. How would I be able to get the eventdate and eventtime data from the feed? Thank you.

  - platform: feedparser
    name: 'Rowan Public Library'
    feed_url: 'https://www.rowancountync.gov/RSSFeed.aspx?ModID=58&CID=Library-29'
    date_format: '%a, %d %b %Y %H:%M:%S %Z'
    local_time: true
    scan_interval:
      hours: 1
    show_topn: 30
    inclusions:
      - title
      - calendarEvent:EventDates
      - calendarEvent:EventTimes
      - calendarEvent:Location
    exclusions:
      - language
      - pubDate
      - link
      - image