📰 Lovelace: RSS Feed Parser Plugin/List Card

Fair enough. I wondered if that might be the answer.

Just so I’m clear is the use of feed_attribute: entries an imperfect work around that just happens not to work in my case?

Correct. The newest release of feedparser changed the entries from a dict to a list, and the list-card relies on the keys of the dict to perform include/exclude and styling. So if you have any of those things, which you do, it won’t work.

1 Like

Hi,

Hass Version: 0.96.4

I hope someone can help me, I have had this working for a while now with no issues but a couple of days ago I noticed it’s only showing the below on the states tab.

entries: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
friendly_name: BBC1 Feed
icon: mdi:rss

This is for xml feed “http://feeds.bbci.co.uk/news/uk/rss.xml

I’ve tried rolling back to previous versions and completely removing and reinstalling but nothing changes. I thought the BBC xml feed may have changed but I tried the feed mentioned on the github example (which works in chrome) but get the same results. If I debug it then strangely the xml returned is correct in the log file but it doesn’t seem to translate to the actual sensor.
Log looks like this:

2019-08-06 20:04:23 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.bbc1_feed, old_state=None, new_state=<state sensor.bbc1_feed=10; entries=[{'title': "Brexit: EU 'refusing to negotiate', says Gove", 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': "Brexit: EU 'refusing to negotiate', says Gove"}, 'summary': 'The EU says there is currently no basis for "meaningful discussions", but the UK rejects that view.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'The EU says there is currently no basis for "meaningful discussions", but the UK rejects that view.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-politics-49251257'}], 'link': 'https://www.bbc.co.uk/news/uk-politics-49251257', 'id': 'https://www.bbc.co.uk/news/uk-politics-49251257', 'guidislink': False, 'published': 'Tue, Aug 06 05:18 PM'}, {'title': 'Tate Modern fall: Boy, six, fractured spine, court hears', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Tate Modern fall: Boy, six, fractured spine, court hears'}, 'summary': 'A 17-year-old is accused of throwing the boy, who suffered a brain bleed, from a viewing platform.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'A 17-year-old is accused of throwing the boy, who suffered a brain bleed, from a viewing platform.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-england-london-49245646'}], 'link': 'https://www.bbc.co.uk/news/uk-england-london-49245646', 'id': 'https://www.bbc.co.uk/news/uk-england-london-49245646', 'guidislink': False, 'published': 'Tue, Aug 06 04:06 PM'}, {'title': 'Nora Quoirin: Family say teen missing in Malaysia was abducted', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Nora Quoirin: Family say teen missing in Malaysia was abducted'}, 'summary': 'Malaysian police searching for Nora Quoirin, 15, have extended their search to areas of tropical forest.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Malaysian police searching for Nora Quoirin, 15, have extended their search to areas of tropical forest.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-england-london-49247335'}], 'link': 'https://www.bbc.co.uk/news/uk-england-london-49247335', 'id': 'https://www.bbc.co.uk/news/uk-england-london-49247335', 'guidislink': False, 'published': 'Tue, Aug 06 02:50 PM'}, {'title': 'Whaley Bridge dam: Dozens of evacuated residents to return home', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Whaley Bridge dam: Dozens of evacuated residents to return home'}, 'summary': 'About 50 households near Whaley Bridge can return but hundreds of others are told they must wait.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'About 50 households near Whaley Bridge can return but hundreds of others are told they must wait.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-england-derbyshire-49254742'}], 'link': 'https://www.bbc.co.uk/news/uk-england-derbyshire-49254742', 'id': 'https://www.bbc.co.uk/news/uk-england-derbyshire-49254742', 'guidislink': False, 'published': 'Tue, Aug 06 05:58 PM'}, {'title': 'Birkby house fire: Shahid Mohammed guilty of murdering eight people', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Birkby house fire: Shahid Mohammed guilty of murdering eight people'}, 'summary': 'The five children died along with their mum, uncle and grandmother when the home was petrol bombed.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'The five children died along with their mum, uncle and grandmother when the home was petrol bombed.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-england-leeds-49192634'}], 'link': 'https://www.bbc.co.uk/news/uk-england-leeds-49192634', 'id': 'https://www.bbc.co.uk/news/uk-england-leeds-49192634', 'guidislink': False, 'published': 'Tue, Aug 06 04:51 PM'}, {'title': 'MPs describe threats, abuse and safety fears', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'MPs describe threats, abuse and safety fears'}, 'summary': 'They report being sent pictures of decapitated bodies and having dog mess smeared on their door.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'They report being sent pictures of decapitated bodies and having dog mess smeared on their door.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-politics-49247808'}], 'link': 'https://www.bbc.co.uk/news/uk-politics-49247808', 'id': 'https://www.bbc.co.uk/news/uk-politics-49247808', 'guidislink': False, 'published': 'Tue, Aug 06 04:00 PM'}, {'title': "Man dies 'trying to save his children from sea' near Porthmadog", 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': "Man dies 'trying to save his children from sea' near Porthmadog"}, 'summary': 'Eyewitnesses say his son was clinging to him as he was pulled from the water.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Eyewitnesses say his son was clinging to him as he was pulled from the water.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-wales-49252751'}], 'link': 'https://www.bbc.co.uk/news/uk-wales-49252751', 'id': 'https://www.bbc.co.uk/news/uk-wales-49252751', 'guidislink': False, 'published': 'Tue, Aug 06 03:54 PM'}, {'title': "London Bridge attack: Victim's partner calls for legal aid", 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': "London Bridge attack: Victim's partner calls for legal aid"}, 'summary': 'James Hodder, whose girlfriend Kirsty Boden was killed, says inquest families must have legal aid.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'James Hodder, whose girlfriend Kirsty Boden was killed, says inquest families must have legal aid.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-49251211'}], 'link': 'https://www.bbc.co.uk/news/uk-49251211', 'id': 'https://www.bbc.co.uk/news/uk-49251211', 'guidislink': False, 'published': 'Tue, Aug 06 04:59 PM'}, {'title': 'Seal pup on Norfolk Coast drowned after people pushed it into sea', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Seal pup on Norfolk Coast drowned after people pushed it into sea'}, 'summary': 'The RSPCA says people thought they were helping the seal pup by putting it back in the water.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'The RSPCA says people thought they were helping the seal pup by putting it back in the water.'}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-england-norfolk-49252385'}], 'link': 'https://www.bbc.co.uk/news/uk-england-norfolk-49252385', 'id': 'https://www.bbc.co.uk/news/uk-england-norfolk-49252385', 'guidislink': False, 'published': 'Tue, Aug 06 06:04 PM'}, {'title': 'Peterborough lottery winner quits job to pursue screenwriter goal', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': 'Peterborough lottery winner quits job to pursue screenwriter goal'}, 'summary': "Dean Weymes won £10,000 a month for the next 30 years on the National Lottery's Set For Life draw.", 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'http://feeds.bbci.co.uk/news/uk/rss.xml', 'value': "Dean Weymes won £10,000 a month for the next 30 years on the National Lottery's Set For Life draw."}, 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.bbc.co.uk/news/uk-england-cambridgeshire-49254292'}], 'link': 'https://www.bbc.co.uk/news/uk-england-cambridgeshire-49254292', 'id': 'https://www.bbc.co.uk/news/uk-england-cambridgeshire-49254292', 'guidislink': False, 'published': 'Tue, Aug 06 05:43 PM'}], friendly_name=BBC1 Feed, icon=mdi:rss @ 2019-08-06T20:04:23.696957+01:00>>

Any ideas?

Thanks

Simon

You must not have properly rolled back to the previous version. Maybe I’ll refactor so that the default is the dict and things don’t break and then add an option to return as a list for those that want it that way…

Same thing here but I have not had any time to check what is going on which is why I didn’t post anything here.

Seems like a good idea to me. Bu I would say that wouldn’t I? :smiling_imp:

OK, I didn’t roll back far enough. I deleted the files and copied v0.0.5, this one works as expected. From 0.0.6 I have the issue.

This time I also manually rolled back instead of using HACS.

Thanks

Simon

Someone want to test this out? I haven’t tested, just made the changes while at work:


Give an option to return as a list or dict. Default is the old way; dict

Well…
I have no idea if it was a fluke or not but I tried it (copied the sensor.py) and restarted hassio but it never came back. I removed the whole feedparser folder and had to shutdown the VM in Proxmox and restart (which worked). No time now to try again now but may do in a few hours…

It’s entirely possible that I have an error in there. I’ll test tonight. Thanks.

also for me there is this type of error

Blockquote
entries: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
friendly_name: HLN
icon: mdi:rss

Blockquote

How can I extract only the title from the feed using this configuration?


  - platform: feedparser
    name: ANSA
    feed_url: 'https://www.ansa.it/basilicata/notizie/basilicata_rss.xml'
    date_format: '%a, %b %d %I:%M %p'
#    show_topn: 10
    inclusions:
      - title



  - platform: template
    sensors:
      notizie_ansa_basilicata:
        friendly_name: "Notizie ansa basilicata"
        value_template: '{{ states.sensor.ansa.attributes.title }}'

thank you

Hi. If I check the config the following appears.
Integration feedparser not found when trying to verify its sensor platform.
with an error I can’t restart the server.
Thanks

I can confirm that this version of sensor.py crashes my Home Assistant UI (unable to access), but the Hass.io add-ons are still running so I can remove sensor.py.

Just wondering, how does one normally view the data in the objects created by Feedparser sensor? I created a Quote of the Day card that previously read the data in dictionary format, but I have no idea how to read it now since I only see [object] [object] the States view.

If you click on the sensor and then scroll to the top you can see how everything is laid out.

Tried it and it popped up a syntax error.

``
^

SyntaxError: invalid syntax

I finally understand what you mean. Click on the sensor (in Developer Tools >> States, not in State UI) to see the details.

1 Like

If anyone is looking for this with the current version, and you are seeing [object],[object] when you check states, here’s an example of how I’m getting the data out as a sensor template:

- platform: feedparser
  name: news_npr_audio
  feed_url: 'https://www.npr.org/rss/podcast.php?id=500005'
  inclusions:
    - title
    - link

- platform: template
  sensors:
    npr_news_mp3_link:
      friendly_name: 'NPR News mp3 link'
      value_template: >
        {{ states.sensor.news_npr_audio.attributes.entries[0].link }}
6 Likes

Earlier today, I received an e-mail in which ecobee announced it was discontinuing their e-mail notifications of interruptions of service and planned outages. The good news is they still have an RSS feed. I’ve configured the Feed Parser to display the latest message in a lovelace List Card, but I’ve not been able to prepend the message title – a variable string with a static key value. Is this even possible? I’ve only been able to display one key’s worth of content without using two columns.

The other issue is the messages for a particular issue can get fairly lengthy if it’s a protracted event. To address that situation, I’ve tried limiting the number of rows, hoping a scroll bar would appear on the right side of the card. I’m disappointed that neither seemed to work – the number of lines were not limited and there was no scroll bar.

Despite the cosmetic issues, kudos to Ian and the authors of Feed Parser for making some useful components. Both pieces integrated seamlessly with HACS.

Thanks in advance for any guidance.

I’m in the middle of a re-write of the list-card. Should have something much nicer when complete

1 Like

Ian, thanks for the prompt reply. What I currently have is usable. I’ll wait to see what the new version accommodates.

Thanks in advance.