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

So this is what it looks like, there was some info on their site about how to format the url but mine looks like this
ā€œhttp://www.fuelwatch.wa.gov.au/fuelwatch/fuelWatchRSS?Product=1&Suburb=Duncraigā€
where product-1 is for unleaded fuel and the suburb closest to where i live

########################
# Fuel Watch RSS #
########################
sensor fuelwatch:
- platform: feedparser
name: Fuel Watch WA
feed_url: ā€˜http://www.fuelwatch.wa.gov.au/fuelwatch/fuelWatchRSS?Product=1&Suburb=Duncraigā€™
date_format: ā€˜%a, %b %d %I:%M %pā€™
inclusions:
- title
- description
- price
- link
- item
- brand
- date
- trading-name
- location
- address
exclusions:
- language

3 Likes

i keep getting this error: ERROR (Thread-6) [homeassistant.util.yaml] YAML file /home/homeassistant/.homeassistant/ui-lovelace.yaml contains duplicate key ā€œtitleā€. Check lines 0 and 348.

  - badges: []
cards:
  - type: custom:list-card
    entity: sensor.nieuws
    title: Nieuws GVA
    columns:
      - title: Link
        type: image
        add_link: link
        field: links
      - title: Title
        field: title
      - title: Summary
        field: summary
title: Nieuws

also mine doesnt display pictures either.

I would like to have a limit in the sensor configuration to be able to show the latest news event only.

Iā€™m currently using another custom component which does that but itā€™s limited to 1 specific hardcoded site.

https://github.com/thibmaek/custom-components/issues/13#issuecomment-484475957

I want to be able to to have such config to get this card using the ā€˜custom:useful-markdown-cardā€™ which provides a lot of flexibility, see details in the above github

You should be able to already do that using the zeroth index in the list

I donā€™t understand what you mean by ā€˜zeroth indexā€™.

The sensor has no attributes ie. plus and I think there is something wrong with the config as I dont get the picture and other elements

This is my config

  - platform: feedparser
    name: HLN
    feed_url: 'https://www.hln.be/nieuws/rss.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - id
      - summary
      - updated
      - media

this is the output
image

what I would like to see is something like this with attributes that are usable:

Iā€™m not a dev, just trying to understand the capabilities of your component and provide some feedback for more improvement.

I canā€™t test right now, but you should be able to do something like this

[sensor.hln.attributes[0].title]

in the useful-markdown-card

Tried does not work, I assume because of missing attributes in the sensor or not support by useful-markdown-card.

Attributes is a list as you see in your screenshot

this is what I get as error when used in the custom markdown card
[[ Template matching failed: sensor.hln.attributes[0].title ]]

That might be a limitation of the card. Feedparser is actually broken for me right now due to an upstream issue in Python 3.7 and havenā€™t taken the time to downgrade to 3.6, so canā€™t play around with this, unfortunately.

However, what should work for sure is my config-template-card and the regular markdown-card. Youā€™d do something like this:

type: 'custom:config-template-card'
variables:
  - states['sensor.hln'].attributes[0]
entities:
  - sensor.hln
card:
  type: markdown
  content: "${vars[0].title}"

Great job with both the sensor and the card. I would really like to use this for managing my favorite podcasts in home assistant. I am thinking of using the sensor against the rss-feed for the podcast, which contains all the info required, including the url to the media. Furthermore it would then be really cool if I could just click the row with the podcast I want to hear, and it would play on one of my media players configured in home assistant.

Have you considered implementing functionality for triggering hass services when one of the rows are clicked? I can imagine quite a few use cases where that would enable some cool features.

Regards
Henrik

You might be interested in my podcast-card instead

1 Like

Thanks for the suggestion iantrich. I have actually had a look at the podcast-card, which looks very nice. My understanding is that the podcastcard is limited to gPodder? Quite a few of the podcasts I am interested in are not available on gPodder.

Do you have any plans for supporting other sources for the podcast-card in the future?

Only other one that Iā€™m aware that is open is Plex that I hope to eventually add once I find the time.

Iā€™m going to give this a try when I get homeā€¦

I cant seem to parse out the data from a feed,

The feed is: https://www.ozbargain.com.au/deals/feed

My config is:

- platform: feedparser
  name: Ozbargain
  feed_url: 'https://www.ozbargain.com.au/deals/feed'
  inclusions:
    - title
    - link
    - category
    - pubDate
    - media

But all I get is:

the title and linkā€¦ and it doesnt show when using the card, as configured:

type: 'custom:list-card'
entity: sensor.ozbargain
title: Ozbargain
columns:
  - title: ''
    type: image
    add_link: link
    field: image
  - title: Title
    field: title
    style:
      - white-space: nowrap
  - title: Description
    field: description

(The card shows NO data)

testing the feed on an online parser returns a result that seems to me to indicate that the feed is valid and SHOULD workā€¦

Would appreciate any help in getting this going :slight_smile:

Thanks for making the component :slight_smile:
Can you advise how to get any data out of the sensor ā€¦

{{states['sensor.bbc_news_feed'].attributes[0]}}

Iā€™ve tried this in the template editor and while it doesnā€™t error it doesnā€™t display anything eitherā€¦

This is my sensor dataā€¦

I donā€™t really know jinja well, but the data is a json object, not a list. I remember going back and forth on how to store the data and looking back a list would make more sense. PR welcome :slight_smile:

Hi, nice parser!

Can you help me with the config? I cannot get the pubDate from this feed:
https://www.apkmirror.com/apk/google-inc/android-auto/feed/

And can you help me using regex ?
I want to find and replace ā€œGoogle Maps, Media & Messaging and by Google LLCā€ to itā€™ll strip that text.
Only thing I found was something like ā€œstring|regex_replace(find=ā€™ā€™, replace=ā€™ā€™, ignorecase=False)ā€ but I cannot get that to work, see https://www.home-assistant.io/docs/configuration/templating/#regular-expressions.

Thanks man!