RSS feed custom component for Home Assistant which can be used in conjunction with the custom Lovelace list-card
Hey dude! Help me out for a couple of 🍻 or a ☕!
- Open HACS Settings and add this repository (https://github.com/custom-components/feedparser/) as a Custom Repository (use Integration as the category).
- The
feedparser
page should automatically load (or find it in the HACS Store) - Click
Install
Alternatively, click on the button below to add the repository:
Example configuration.yaml:
sensor:
- platform: feedparser
name: Engineering Feed
feed_url: 'https://www.sciencedaily.com/rss/matter_energy/engineering.xml'
date_format: '%a, %d %b %Y %H:%M:%S %Z'
scan_interval:
hours: 3
inclusions:
- title
- link
- description
- image
- published
exclusions:
- language
# Configuration of the second sensor tracking a different RSS feed
- platform: feedparser
name: Algemeen
feed_url: https://www.nu.nl/rss/Algemeen
local_time: true
show_topn: 1
If you wish the integration to look for enclosures in the feed entries, add image
to inclusions
list. Do not use enclosure
.
The integration tries to get the link to an image for the given feed item and stores it under the attribute named image
. If it fails to find it, it assigns the Home Assistant logo to it instead.
Note that the original pubDate
field is available under published
attribute for the given feed entry. Other date-type values that can be available are updated
, created
and expired
. Please refer to the documentation of the original feedparser library.
Configuration variables:
key | description |
---|---|
platform (Required) | The platform name |
name (Required) | Name your feed |
feed_url (Required) | The RSS feed URL |
date_format (Optional) | strftime date format for date strings Default %a, %b %d %I:%M %p |
local_time (Optional) | Whether to convert date into local time Default false |
show_topn (Optional) | fetch how many entres from rss source,if not set then fetch all |
inclusions (Optional) | List of fields to include from populating the list |
exclusions (Optional) | List of fields to exclude from populating the list |
scan_interval (Optional) | Update interval in hours |
Note: Will return all fields if no inclusions or exclusions are specified
Due to how custom_components
are loaded, it is normal to see a ModuleNotFoundError
error on first boot after adding this, to resolve it, restart Home-Assistant.