Yes, sorry, just realised that myself. Feedreader is a core component, but Feedparser is a custom compoent.
So, no other RSS options, apparently…
Well there is feedreader.
But from what I understand, Feedreader only puts things on the event bus for automation purposes, such as when a feed is updated, and doesn’t expose the actual feed article or associated images for display on a Lovelace dashboard.
I’m surprised that something that has been around for as long as RSS has, that there is no core component in for this in HA, and that there is only one custom component offering that would allow one to post feeds to the dashboard.
Regardless, I appreciate everyone that took the time to weigh in.
Re-reading the thread, we started here.
Why do you say this, is it a general lack of response on github, or something else?
I have to say that for something as simple as rss feeds, people seem to have made them pretty convoluted over the years.
Looks like a general lack of response on both GitHub and the developer’s HA community support forum.
Last developer post on the forum appears to be from early March; GitHub issues extend back to 2019, with one similar to mine submitted in September of this year. Last issue action logged was also from March.
To be fair, I’m not that adept at navigating GitHub, but there are like 30+ forks to this custom component, which to my understanding means 30+ variants. Not quite sure how to determine which, if any, I should be attempting to use…
I would start with the one in HACS.
If you click on the forks you can see what action they have had, it’ll say something like “This repo is 2 commits ahead and 25 commits behind the original.” You can probably guess that the fork was created a while ago and the forker wanted to fix some particular thing.
Is this your issue? Cant pars rss feed · Issue #65 · custom-components/feedparser · GitHub. If so, I wonder if this may help. GitHub - custom-components/gpodder: 🎧 gPodder Integration for Podcast Feed Monitoring
Disappointed! The gpodder integration is by the same author as feedparser, and doesn’t work either. Again, no answers in github issues.
No, I think it was more like #56 on the GitHub list - no article images. I have one active feed that works, which also retrieves article images, and that’s only because I found and used someone else’s custom code in the forum to replace the .py file in FeedParser’s custom component folder.
If I try to implement a second feed, I get the article, but no images. Have tried other links as well to verify, so it’s not the other RSS feeds that are having issues…
I’m trying to use the flex-table-card as an alternative. I can get the RSS news headline summaries but not the images so far.
Code looks like this. I feel that I’m not too far away.
type: custom:flex-table-card
title: The BBC
entities:
include: sensor.the_bbc
columns:
- name: Summary
data: entries
modify: x.summary
- name: Logo
data: entries
modify: >-
'<img src="' + x.media_thumbnail.href + '"style="width: ="45" height =
"35"">'
I’m interested in your progress. Any luck getting images in, and if so, have you been able to implement more than one feed?
Howdy! This is a work in progress for me, but it’s consistently displaying images using the core feedreader integration.
configuration.yaml:
feedreader:
urls:
- https://citizenfreepress.com/feed/
- https://www.thegatewaypundit.com/feed/
scan_interval:
minutes: 1
maximum_entries: 20
create five helpers per RSS feed (four input text helpers with max chars set to 255, one datetime input helper):
news_item_title_tgp
news_item_description_tgp
news_item_link_tgp
news_item_image_tgp
news_item_date_tgp
one automation per feed:
alias: rss_tgp
description: The Gateway Pundit
trigger:
- platform: event
event_type: feedreader
event_data:
feed_url: https://www.thegatewaypundit.com/feed/
condition: []
action:
- service: input_text.set_value
data:
value: "{{ trigger.event.data.title }}"
target:
entity_id: input_text.news_item_title_tgp
enabled: true
- service: input_text.set_value
data:
value: "{{ trigger.event.data.description }}"
target:
entity_id: input_text.news_item_description_tgp
enabled: true
- service: input_text.set_value
data:
value: "{{ trigger.event.data.link }}"
target:
entity_id: input_text.news_item_link_tgp
enabled: true
- service: input_text.set_value
data:
value: "{{ trigger.event.data.media_content.0.url }}" <<<<<<<<image URL stored here
target:
entity_id: input_text.news_item_image_tgp
enabled: true
- service: input_datetime.set_datetime
data:
value: "{{ trigger.event.data.published }}"
target:
entity_id: input_datetime.news_item_date_tgp
enabled: true
mode: single
With everything captured, render the contents on a markdown card:
# The Gateway Pundit
---
**{{ states('input_text.news_item_title_tgp') }}**
{{ as_datetime(states('input_datetime.news_item_date_tgp')).strftime('%B %d, %Y %H:%M:%S') }} - [Read More]({{ states('input_text.news_item_link_tgp') }})
![Alt text]({{ states('input_text.news_item_image_tgp') }}) <<<<<<Render the image from the URL
S/O to SmartHomeJunkie, his walkthrough video was a great starting point. I figured out the image part by applying the same logic along with the changed variables
tab in the traces
feature of the automation.
HTH!
Hi,
I try also to send news by telegram.
But I have issue with this automation :
- id: news
alias: News
description: News
trigger:
- platform: event
event_type: feedreader
event_data:
feed_url: https://www.lemonde.fr/rss/une.xml
condition: []
action:
- service: input_text.set_value
data:
value: "{{ trigger.event.data.title }}"
target:
entity_id: input_text.news_title
enabled: true
- service: input_text.set_value
data:
value: "{{ trigger.event.data.description }}"
target:
entity_id: input_text.news
enabled: true
- service: input_text.set_value
data:
value: "{{ trigger.event.data.link }}"
target:
entity_id: input_text.news_link
enabled: true
- service: input_datetime.set_datetime
data:
value: "{{ trigger.event.data.date }}"
target:
entity_id: input_datetime.news_date
enabled: true
- service: notify.lilp_bot
data:
title: Batterie faible
message: News "{{ trigger.event.data.title }}"
I have this message in Step details :
Error: Error rendering data template: UndefinedError: ‘dict object’ has no attribute ‘event’
And in Trace TimeLine :
Triggered manually at 2 novembre 2023 à 10:44:28
Appeler le service “Saisie de texte: Définir” sur News Title
Stopped because an error was encountered at 2 novembre 2023 à 10:44:28 (runtime: 0.02 seconds)
Thanks for your help.
Hi, there, TheTXPopulist,
I was wondering if this is still working for you? I’ve given up on getting images into Feedparser, and followed along with SmartHomeJunkie’s post on how to use FeedReader, but was disappointed that images weren’t part of the offering.
As far as I can tell, I followed your code to the letter, but I only seem to get the date in.
I’m about to ditch the whole idea that RSS is fully implemented in Home Assistant. Any ideas?
@DBB1 I had issues with HA deleting sections of code as it did not like it. I did not notice right away and had the same result.
using the following service lines and not putting the mode line of code allowed it to show more this way:
action:
- service: input_text.set_value
data:
value: “{{ trigger.event.data.title }}”
target:
entity_id: input_text.news_item_title_tgp
enabled: true - service: input_text.set_value
data:
value: “{{ trigger.event.data.description }}”
target:
entity_id: input_text.news_item_description_tgp
enabled: true - service: input_text.set_value
data:
value: “{{ trigger.event.data.link }}”
target:
entity_id: input_text.news_item_link_tgp
enabled: true - service: input_datetime.set_datetime
data:
value: “{{ trigger.event.data.published }}”
target:
entity_id: input_datetime.news_item_date_tgp
enabled: true
But unfortunately it no picture as the picture lines of code are causing the issue.
Thank you so much! I did follow the instructional video on feedreader and was wondering if i could add image also this code semmed to work just gotta wait for feed to update to see if it worked as expected.
I hade same problem. It only works after triggered by raa feed update on their end. Unfortunately cant test it just gotta wait till they post something
Thanks all for this detailed thread, I got really far on this!
The only issue I have is with the description field.
Here is my automation, and it returns values (based on the Traces section):
action:
- service: input_text.set_value
metadata: {}
data:
value: "{{ trigger.event.data.title }}"
target:
entity_id: input_text.tdw_title
- service: input_text.set_value
metadata: {}
data:
value: "{{ trigger.event.data.description }}"
target:
entity_id: input_text.tdw_content
- service: input_text.set_value
metadata: {}
data:
value: "{{ trigger.event.data.link }}"
target:
entity_id: input_text.tdw_link
- service: input_text.set_value
metadata: {}
data:
value: "{{ trigger.event.data.media_content.0.url }}"
target:
entity_id: input_text.tdw_image
enabled: false
- service: input_datetime.set_datetime
metadata: {}
data:
value: "{{ trigger.event.datetime }}"
target:
entity_id: input_datetime.tdw_time
mode: single
I then try and render it in Markdown as follows:
# News Feed
---
**{{ states('input_text.tdw_title') }}**
{{ states('input_text.tdw_content') }}
{{ as_datetime(states('input_datetime.tdw_time')).strftime('%B %d, %Y %H:%M:%S') }} - [Read More]({{ states('input_text.tdw_link') }})
The title renders nicely, but the content only shows “unknown” - I have no idea what I’m doing wrong!
In a related note, I disabled the media section there, because whatever I did I couldn’t get pictures to be loaded. Does this depend on the specific RSS feed?
Yes, very dependent on the feed. Although sites should abide by the RSS standard for field names, it is very seldom they do.
In the above think of “data” as the thing (the object) that is being sent by the RSS feed. In the programming world, it is what we call the payload. Home assistant, specifically feed parser, takes the object and structures data as a ‘dictionary’. Dictionaries are comprised of Key:value pairs.
By referencing the .description key of the dictionary called data, Home assistant, specifically the markdown card on the dashboard, will render the value associated with the .description key you’ve referenced. Behind the scenes it’s binding that description to an entity called tdw_content.
What happens if that key doesn’t exist? Or if HA can’t parse it properly? It will render something to the tune of unknown.
Take a look at the trace and make sure you have a description key, and/or look for something else consistent/reliable to reference from this particular RSS feed. Feel free to post a trace output as well!
Hello,
Were you able to make it to rotate the 20 news feeds every x seconds? or it will just show the latest item?