📰 Lovelace: RSS Feed Parser Plugin/List Card

Hello Everyone!

After many years of benefiting from your awesome creations, I’ve finally been able to return a little something.

This is a component to take RSS feeds and put them within a sensor as a list to be displayed with my list-card

8 Likes

How does this compare with the existing Feedreader component?

1 Like

It has a sensor, were as the current one is more of a watcher to alert you when it changes.

As @cooljimy84 pointed out, the Feedreader watches for new entries on a feed and then creates an event in the HA event bus that can be used for automations and what not. This is just a sensor that returns a list that you can then use to display on your front-end. I’m working on a Lovelace card now to display a feed in a table (or any list)

Does this only work with lovelace then ? (just noticed)

No, this is just a sensor. I can’t imagine it being all the useful without lovelace to make it look pretty, but not a requirement

So as a sensor on the old interface it would just be a text wall ?

Yes

vs in lovelace

Wowzer…

1 Like

Hey, I’m having some issues getting the list-card to show any entries. Do you have any ideas of what is wrong? I’m using the default config entries you listed on your Github.

For the sensor, the config.yaml portion is below:

  - platform: feedparser
    name: Engineering Feed
    feed_url: 'https://www.sciencedaily.com/rss/matter_energy/engineering.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - link
      - description
      - image
      - language
      - pubDate
    exclusions:
      - language

and looks like it loads the RSS feed into the sensor just fine.

For the Lovelace configuration, as of yesterday I saved the list-card.js in the config/www folder and used your default config in the uilovelace.yaml:

  - url: /local/list-card.js?v=0.0.6
    type: js   
      - type: custom:list-card
        entity: sensor.engineering_feed
        title: Engineering Feed
        columns:
          - title: ''
            type: image
            add_link: link
            field: image
          - title: Title
            field: title
            style:
              - white-space: nowrap
          - title: Description
            field: description

The card shows up in Lovelace but no data is shown besides the column titles. I tried another RSS feed and had the same issues, so I tried your default but still have the same issue.

I’m using the latest Chrome on Windows and tried clearing the browser cache, but the issue still persists. I will dig in my HA logs later but a brief scan doesn’t show any issues related to the sensor. Any thoughts?

Check your dev console for errors. If you look at those sensor values, you only have two fields available: ‘title’ and ‘link’ yet you are referencing ‘image’ and ‘description’ which do not exist.

That fixed it, thanks for your help.

1 Like

Hey! Thx for this component.

Followed your instructions but I’m getting this error message:

Thu Sep 20 2018 11:28:06 GMT+0200 (CEST)

Error loading custom_components.sensor.feedparser. Make sure all dependencies are installed

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 94, in get_component module = importlib.import_module(path) File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 673, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/home/homeassistant/.homeassistant/custom_components/sensor/feedparser.py", line 13, in <module> import feedparser ImportError: No module named 'feedparser'

Problem is feedparser module is installed…
Any idea of what could be wrong?

Thx.

This is normal for the first startup after adding a Custom component that require a external lib, it is usually solved by restarting Home Assistant.

No luck. I’ve already restarted home assistant and rebooted the pi several times…Still getting this message.
Thx for answering.

Try pip install feedparser as the hass user

Yep. That was it actually… Module feedparser wasn’t installed as the hass user… Thx a lot!

I was getting the same thing (I’ll try removing the image field as suggested by @iantrich)

Interesting that your feedparser component has image in the inclusions group, but isn’t pulling it through. Looking at the feel_url your using (I’ve used the same), the image field contains a group of more fields … @iantrich could this be the problem why the image field isn’t being read?

Quite possibly. If you’re up to it, you could take a look at my code to see if I missed something. Otherwise I should hopefully find some time this weekend to play around with that :slight_smile:

I’ve actually really wanted to get into Python, having only done the absolute basics.

I’ll give it a go :slight_smile:

1 Like