Hi! In this week’s video, we’ll explore how to seamlessly display RSS feeds in Home Assistant. Stay tuned to discover the power of integrating news updates directly into your smart home dashboard and on your Ulanzi Matrix Clock. Let’s dive in!
โญโญโญ NOTE: โญโญโญ
This article accompanies a YouTube video. I wrote it for people who would rather read than watch a video. To keep doing this, I want to ask you to check out the video, leave a comment under the video, give the video a thumbs up, and subscribe to my YouTube channel. This means that the video is offered more often to new visitors so that they also stay informed of the latest Home Assistant tutorials.
Thank you for your support!
Ed
Introduction
A couple of weeks ago, I created this video that explains how to show sensor values and notifications on a Ulanzi Desktop Clock using my Blueprints. Some of you asked me if I could explain how to show RSS feed items on this display. So, I decided to dive into the RSS feed possibilities of Home Assistant and will explain in this tutorial how you can show RSS feed items on your dashboard. And at the end of the video, I will show you how you can display the latest RSS Feed item on the Ulanzi Desktop Clock as well!
Steps to set up the RSS feeds reader
So, what is needed to make this work? We are going to make use of the feedreader integration in Home Assistant. To activate the feed reader in Home Assistant, we have to edit our configuration.yaml. Activating the feed reader integration through the configuration.yaml is the current status of Home Assistant. It might be that the feed reader can be activated through the UI in the future. If that is the case, then you do not have to add the following code to the configuration.yaml, but for now we have to do this.
To enable the feedreader integration, you have to install Studio Code Server first.
How to install Studio Code Server in Home Assistant
- You can install Studio Code Server by going to Settings->Add-ons.
- Click on Add-on store.
- Search for Studio Code Server and install studio code server.
- Make sure that Show in sidebar is selected and start the add-on.
Now, let’s click on the Studio Code Server link to open the editor. You see all the files on your Home Assistant server here.
Activate the RSS Feeds reader in Home Assistant
Open the configuration.yaml file.
As you can see I’ve added the following code here.
- I start with the line feedreader which activates the feedreader integration in Home Assistant.
- Then, I add all the urls of the RSS feeds that I want to monitor.
- After that, I determine the scan interval. I’ve set it to 1 minute for this tutorial, which is a bit often, but you can set it to whatever time interval fits you best.
- And I define the maximum number of entries to fetch from the RSS feed. I must say that I am not sure why the last option exists, because I could only show the newest entry from the feed. If anyone of you knows how to show multiple entries using the native Home Assistant integration, please let me know in the comments. I am aware of the fact that there is a HACS integration for this, but this integration seems to have some bugs at the time when I created this video.
Save the configuration.yaml and restart Home Assistant by going to the developer tools. Click on Check Configuration and when everything is okay, click RESTART.
Create the Helpers for our news feed items
Now we are going to create some helpers to store the data from the news feeds. For this tutorial, I need to create the following helpers:
- A Text Helper for the Title.
- A Text Helper for the Description.
- A Text Helper for the Link
- and a DateTime Helper for the Date and Time.
Go to Settings -> Devices and Services.
- Click on the Helpers Tab.
- Click Create Helper.
- Select the Text Helper
- and name this Helper: Newsitem Title.
- You can also select an icon here. I select the newspaper icon.
- Make sure the maximum value is 255
- and save the Helper.
- Do the same for the Description and Link Helper.
- For the Date Helper, we are going to create a date and/or time helper.
- Give this Helper the name NewsItem Date
- and select an icon that you like.
- Make sure you select the Date and Time radio button
- and click CREATE.
Our helpers are now created.
Creating the Automation to trigger a new RSS Feed item.
The next step is to create the automations that fill the helpers. The automation looks like this. You trigger the event type feedreader and enter the RSS feed URL in the Event data field. In the actions, you set each helper with the corresponding value of the RSS feed item.
You can create the automations yourself, but I created a BluePrint with some extra validations for this to easily create these automations. If you sponsor me, you can download this Blueprint including all the code that I’ve created for this tutorial in return. The download link is in the description below the video.
How the Blueprint for the RSS Feeds works
When you downloaded the Blueprint, you have to copy it to your Home Assistant server. The easiest way to do this is by using Studio Code Server.
Install the Blueprint
- Open Studio Code Server
- Open the folder blueprints and open the automation folder within that folder.
- If you do not have a smarthomejunkie folder within the automations folder, please create a folder named smarthomejunkie by clicking on the new folder icon.
- Now drag and drop the display RSS feed blueprint into the smarthomejunkie folder.
- Now go to the developer tools and click the YAML tab. Click on automations to make sure that automations that are created with this blueprint are being refreshed. This is not needed when you uploaded the blueprint for the first time, but I might update the blueprint in the next couple of weeks so that you can upgrade it. In that case, you have to refresh the automations.
Create the automation
Now the blueprint is loaded into Home Assitant, you can start creating the automations.
- Go to Settings > Automations and Scenes.
- Click Create Automation.
- Select the Display RSS feed blueprint.
- Enter the RSS feed URL that you want to follow. This is one of the same URLs that you’ve entered in the configuration.yaml.
- Now select the Title Helper that you created before.
- Select the Description helper.
- Select the Link Helper.
- And, select the Date helper.
- Click Save.
Give the automation a meaningful name and click save again. You can repeat these steps for all the RSS feeds that you want to follow. So, in the end, you will have one automation for each RSS feed. The fastest way to do this is by just duplicating the first automation and entering a different RSS feed in the RSS field of the blueprint. You can duplicate an automation by clicking on the three dots in the upper right corner of the automation and selecting Duplicate.
Great! Home Assistant is now monitoring your RSS feeds. As soon as a new News item is published, the helpers will be filled with the data from these RSS feeds.
Show an RSS feed item on your Home Assistant dashboard
Now we have to make sure that you can view the RSS feed item on your dashboard!
- Open one of your dashboards.
- Click on the three dots in the upper right corner and select Edit Dashboard.
- Click Add Card.
- Search for the Markdown card and select it.
- Give the card a title, for instance: Latest news item.
- Remove the example code and replace it with this code. This code is also in the package that you can download via the download link in the description.
- So, what am I doing here?
- In this first line, I show the title helper in Bold by using two asterisks around the code.
- In the second line, I show the description helper in italics by using one asterisk around the code.
- And in the third line, I first show the time when the news item was retrieved. This can be done in multiple ways, but I wanted to show how you can format the time to your liking. What I am doing here is formatting the time to a format that I like. The helper format is Year-Month-Day and I want to show Day-Month-Year in my case.
- Next to that, I show a link to the article so that I can click it in Home Assistant and will be led to the article itself. The square brackets show the text “Open Link” and the link helper is put between parentheses to make sure that the text “Open link” is clickable.
- Now click Save.
This is awesome! The latest news items from different RSS feeds are now shown on your dashboard and refresh automatically as soon as a new news item is available!
Show the latest RSS Feed News item on your Ulanzi clock.
But there’s much more possible! Now that the helpers are filled with data from your RSS feeds, you can use these helpers to show the data on different devices. If you’ve seen THIS video and bought the Ulanzi clock and my Blueprints, it’s really easy to show the latest RSS feed item on the Ulanzi clock. We want the clock to show a news item as soon as the Newsitem title helper changes.
Note, you need to install the latest version of the Awtrix Blueprints that I created for this video. The link to those Blueprints is in the description of the video.
- Make sure you’ve created a toggle helper for the news app, just like how I explain this in the Awtrix video.
- Go To Settings > Automations and Scenes.
- Select the Awtrix Create Sensor App and select the NewsItem Title Helper.
- Make sure you enter a duration and lifetime. I used 60 seconds for both.
- And toggle the Switch to app on value change switch to on.
- Save the automation.
Brilliant! The latest news item will now be shown on your Ulanzi display as well!
Conclusion
And this is how you can integrate an RSS feed into Home Assistant! If my videos save you time, please consider sponsoring me just like these awesome people do. They play a vital role in ensuring that I can continue to do this. You can find the links to sponsor me in the description of the video. Thanks for watching and don’t forget to give this video a thumbs up and subscribe to my channel if you didn’t already! I’ll see you in my next video! Bye Bye!
Home Assistant, RSS, RSS Feed, feed, automation, dashboard