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

I need a bit of Newbie help with this please:

  1. Using HA v2021.4.0
  2. Installed feedparser custom component v0.1.5 via HACS
  3. Installed list-card as a custom repo via HACS
  4. Added the sample code to my configuration.yaml and restarted HA okay
  5. Checked in Developer > States > sensor.engineering_feed and itā€™s full of RSS articles each with fields title, link and image
  6. I go to one of my Dashboards and add a Custom Card. In the code editor, I paste in the sample code, and I ā€˜simplifiedā€™ it for testing to be:
type: 'custom:list-card'
entity: sensor.engineering_feed
title: Engineering
columns:
  - title: Title
    field: title

I saved the Custom Card and all I get on my Dashboard is a Custom Card that has title ā€˜Engineeringā€™ and column title ā€˜Titleā€™ and absolutely no articles listed. Why are they not being pulled from the sensor? What am I missing?

I havenā€™t messed around with uilovelace.yaml or sensor.py or any other bits of code - I assume I donā€™t have to do that if Iā€™ve used HACS to install the two components and used the Custom Card code editor?

Apologies in advance for asking a dumb Newbie question.

You need to specify the feed_attribute: entries

1 Like

Thank you! I thought I had tried that already and saw no difference, but Iā€™ve just tried it again and itā€™s working now. I mustā€™ve screwed it up when I tried it before. Thanks for the help.

Actually Iā€™ve now found that my problem seems to be:

 - title: Description
   field: description

Whenever I include this field in the custom card, it fails to populate with any RSS articles. If I remove that title/field, then it works (the field is correctly defined in my configuration.yaml as shown in the example code).

Iā€™m also only getting the Home Assistant logo as the article images, but Iā€™m aware others have mentioned this in their posts - so Iā€™ll read those messages more carefully to figure out that problem.

Am I correct in thinking this custom component is just not pulling all of the designated ā€˜includedā€™ fields from the RSS feed?

Iā€™ve tried multiple feeds and added/removed the ā€˜inclusionsā€™ to no avail. When I use Developer Tools > States > sensor.engineering_feed hereā€™s what I see:

entries:
  - title: >-
      Where will Prince Philip's body be held and moved to before he is laid to
      rest?
    link: >-
      https://www.mirror.co.uk/news/uk-news/prince-philip-dukes-body-held-23886320
    image: 'https://www.home-assistant.io/images/favicon-192x192-full.png'
  - title: >-
      TV schedule change explained as Emmerdale, Corrie and EastEnders not on
      tonight
    link: >-
      https://www.mirror.co.uk/tv/tv-news/emmerdale-coronation-street-eastenders-not-23886423
    image: 'https://www.home-assistant.io/images/favicon-192x192-full.png'
  - title: >-
      Travelodge currently has family rooms in Cornwall from Ā£20.75pp for the
      summer
    link: >-
      https://www.mirror.co.uk/travel/uk-ireland/travelodge-rooms-cornwall-20pp-july-23879194
    image: 'https://www.home-assistant.io/images/favicon-192x192-full.png'

The ā€˜imageā€™ is always the HomeAssistant logo and the only fields pulled from the RSS are title, link and the home assistant image.

Does this custom component no longer work??

UPDATE:

Okay, I think Iā€™ve understood my problem: if your configuration.yaml includes any ā€˜inclusionā€™ fields which donā€™t exist in the RSS feed, then it simply fails to pull back any of the subsequent fields into the sensor.

So now my configuration.yaml looks like this and pulls everything back:

  - 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:
    exclusions:

and I can use them in the list-card now.

Sorry if Iā€™ve been spamming this thread a bit too much.

1 Like

im stucking at an related point, I got feed parser 0.1.5 installed on HassIO 2021.4.4 and I canā€™t get all info from my feed.
If I set title and summary I get my feed accordingly buuut I wanted to explore a bit further so added

  - platform: feedparser
    name: programm
    feed_url: 'https://www.texxas.de/tv/hauptsenderJetzt.xml'
    date_format: '%a, %b %d %I:%M %p'

but nothing also with

  - platform: feedparser
    name: programm
    feed_url: 'https://www.texxas.de/tv/hauptsenderJetzt.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
    exclusions:

anyone an idea how to fix this? if I download the xml directly I can see some fields but they donā€™t get picked up (for instance: there is a field ā€œdescriptionsā€ which doesnā€™t work, but with ā€œsummaryā€ I get the information provided in this field)ā€¦ so im totally lost, thought I got a bit deeper to it but nope

Hi I got this setup and working well, Iā€™m using it for a news feed, which updates every few minsā€¦ How can I get the rss feed (and card on the frontend) to update every 5 mins? is that at all possible?
Thanks

Any ideas why the card doesnā€™t pick up the entries from the sensor?

sensors.yaml

  • platform: feedparser
    name: rss Feed
    feed_url: ā€˜http://expressen.se/rss/nyheterā€™
    date_format: ā€˜%a, %b %d %I:%M %pā€™
    inclusions:
    exclusions:

Example of sensor content:
entries:

card:
type: ā€˜custom:list-cardā€™
entity: sensor.rss_feed
title: Engineering Feed
feed_attribute: entries
columns:

  • title: ā€˜ā€™
    type: image
    add_link: link
    field: image
  • title: Title
    field: title
    style: null
  • white-space: nowrap
  • title: Description
    field: description

Result:

I have an issue with this solution out of a sudden after upgrading to 2021.6.3 now.

Have not changed anything to the configuration or ui-lovelace files, also the sensor for the RSS feed is working and showing all the fields within the attributes (names unchanged as well). The list card is displayed (so also installed), title displayed but no feeds. Also tried with other sensors, but same result.

Any clue or anybody with the same issue?

@gunny I am having the same issue. I tried upgrading to 2021.6.5 and still see the same issue

I reviewed the developer tools - engineering feed entity and could see that I was no longer getting any ā€˜descriptionsā€™. I since removed the following lines from the ā€˜custom:list-cardā€™ and now I get the images and titles successfully.

Remove
style: null
white-space: nowrap
title: Description
field: description

1 Like

Thanks for your reply. I looked thru the list-card.js but have not found the lines you are mentioning. Can you give me a hint how to perform your fix?

Thx again!

What I am doing is a workaround to just get the images and titles as the descriptions seem to be missing from the attributes for the engineering feed. What I simply did was edit the card in my lovelace view to remove the descriptions.

Previous Card - No longer working
- type: custom:list-card
entity: sensor.engineering_feed
title: Engineering Feed
feed_attribute: entries
columns:
- title: ā€˜ā€™
type: image
add_link: link
field: image
- title: Title
field: title
style:
- white-space: nowrap
- title: Description
field: description

Changed To
- type: custom:list-card
entity: sensor.engineering_feed
title: Engineering Feed
feed_attribute: entries
columns:
- title: ā€˜ā€™
type: image
add_link: link
field: image
- title: Title
field: title

I hope the above helps to at least give you some information. But I guess this still needs to be fixed so we can get the description information back.

Thanks again. I have removed all style attributes and reduced the confi to itā€˜s bare minimum but still no result. I hope this gets fixed soon.

Thx for the support anyway.

Hello, Iā€™m new to HA, but have installed a few cards from HACS. list-card dosenā€™t pull up for me, so I tried the lovelace guide of installing it manually and still no dice. Does anyone have a tip on how to get list-card installed?

btw Feedparser is installed and working according to developer tools.

Thank you!

1 Like

Would like to know that as well!

Click the 3 dots menu in the top right corner of HACS, select custom repositories, add the github address for the list card and select ā€˜frontendā€™ as the category.

1 Like

Hi,

I canā€™t get the images to show anymore. Any ideas what is wrong:

Here is my config.yaml part:

- platform: feedparser
  name: Engineering Feed
  feed_url: 'https://www.is.fi/rss/tuoreimmat.xml'
  inclusions:

Here is my lovelace.ui part that i want to get to work:

type: custom:list-card
entity: sensor.engineering_feed
title: ''
feed_attribute: entries
row_limit: 6
columns:
  - field: image
    title: ' '
    type: image
    add_link: link
  - title: ' '
    field: title
    add_link: link

And this is how i can get it to work without images:

type: custom:list-card
entity: sensor.engineering_feed
title: ''
feed_attribute: entries
row_limit: 6
columns:
  - title: 'Uutisotsikko '
    field: title
    add_link: link
    

Any ideas how to get the pics vissible again? it used to work earlier this yearā€¦

Iā€™m getting an error (again) and no sensors are created/filled:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/dateutil/parser/_parser.py", line 655, in parse
    ret = self._build_naive(res, default)
  File "/usr/local/lib/python3.9/site-packages/dateutil/parser/_parser.py", line 1241, in _build_naive
    naive = default.replace(**repl)
ValueError: second must be in 0..59

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 633, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/feedparser/sensor.py", line 110, in update
    value = parser.parse(value)
  File "/usr/local/lib/python3.9/site-packages/dateutil/parser/_parser.py", line 1374, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/dateutil/parser/_parser.py", line 657, in parse
    six.raise_from(ParserError(e.args[0] + ": %s", timestr), e)
  File "<string>", line 3, in raise_from
dateutil.parser._parser.ParserError: second must be in 0..59: 2021-09-08T12:15:1631099700Z

Iā€™ve got the same error some days ago, then an update of feedparser arrived and it was working again for a few days. All of a sudden it stopped working :frowning:
Iā€™m on HA 2021.9.4 and feedparser 0.1.7. Any ideas?

Canā€™t get the image out of this RSS feed. What should i use to get the image (tried already with the image parameter but no luck). Titles only works perfect.

The following is the response after the feedparser.

entries:
  - title: >-
      Afgelopen week bijna 40 procent meer positieve coronatests, ook fors meer
      opnames
    title_detail:
      type: text/plain
      language: null
      base: https://www.nu.nl/rss/Algemeen
      value: >-
        Afgelopen week bijna 40 procent meer positieve coronatests, ook fors
        meer opnames
    links:
      - rel: alternate
        type: text/html
        href: >-
          https://www.nu.nl/coronavirus/6169374/afgelopen-week-bijna-40-procent-meer-positieve-coronatests-ook-fors-meer-opnames.html
      - length: '0'
        type: image/jpeg
        href: >-
          https://media.nu.nl/m/qlbxndiazeci_sqr256.jpg/afgelopen-week-bijna-40-procent-meer-positieve-coronatests-ook-fors-meer-opnames.jpg
        rel: enclosure
      - href: >-
          https://nu.nl/coronavirus/6169375/grootste-aantal-coronapatienten-opgenomen-op-verpleegafdelingen-sinds-december.html
        rel: related
        title: >-
          Grootste aantal coronapatiƫnten opgenomen op verpleegafdelingen sinds
          december
        type: text/html
      - href: >-
          https://nu.nl/coronavirus/6169359/ziekenhuizen-bieden-weer-minder-zorg-aan-door-aanhoudende-coronadrukte.html
        rel: related
        title: Ziekenhuizen bieden weer minder zorg aan door aanhoudende coronadrukte
        type: text/html
      - href: >-
          https://nu.nl/coronavirus/6169338/voor-het-eerst-in-deze-coronagolf-wordt-coronapatient-naar-duitsland-verplaatst.html
        rel: related
        title: >-
          Voor het eerst in deze coronagolf wordt coronapatiƫnt naar Duitsland
          verplaatst
        type: text/html
    link: >-
      https://www.nu.nl/coronavirus/6169374/afgelopen-week-bijna-40-procent-meer-positieve-coronatests-ook-fors-meer-opnames.html
    summary: >-
      De afgelopen week testten opnieuw een recordaantal mensen positief op het
      coronavirus. In de weekupdate meldt het RIVM 153.957 positieve tests, een
      stijging van bijna 40 procent ten opzichte van een week eerder. Ook het
      aantal ziekenhuisopnames blijkt fors te zijn gestegen.
    summary_detail:
      type: text/html
      language: null
      base: https://www.nu.nl/rss/Algemeen
      value: >-
        De afgelopen week testten opnieuw een recordaantal mensen positief op
        het coronavirus. In de weekupdate meldt het RIVM 153.957 positieve
        tests, een stijging van bijna 40 procent ten opzichte van een week
        eerder. Ook het aantal ziekenhuisopnames blijkt fors te zijn gestegen.
    published: Tue, Nov 23 03:07 PM
    id: https://www.nu.nl/-/6169374/
    guidislink: false
    tags:
      - term: Algemeen
        scheme: null
        label: null
      - term: Coronavirus
        scheme: null
        label: null
    authors:
      - name: NU.nl
    author: NU.nl
    author_detail:
      name: NU.nl
    rights: 'copyright photo: ANP'
    rights_detail:
      type: text/plain
      language: null
      base: https://www.nu.nl/rss/Algemeen
      value: 'copyright photo: ANP'
----

friendly_name: Engineering Feed
icon: mdi:rss
1 Like