RSS Feedreader Component Update Criteria

I’m trying to determine what the feedreader component looks at in a given RSS feed to determine that new information has been published and whether or not we can specify which item tag or channel tag to watch as criteria for a trigger.

Any ideas?

There are two things used to determine whether new content is available in the feed:

  1. Feedreader uses etag and last-modified date from the previous call to ask the server to only send a response if there is new data available. This feature must be supported by the server though.
  2. When data is retrieved from the server, Feedreader uses the published date of the feed entry; if that date and time exists and is after the last update from the feed an update is sent to the event bus.
    This is currently not configurable.

Ahh. Well, now I know why there would be a problem testing the configuration against one of my feeds if the published date of the Wordpress post is changed and not logged. I made an assumption that just by either changing the body (description) tag of the message, or by changing the date of the post, that an update would be sent to the bus.

But, it seems that to test it, I would need to simply increment the published date later and later until the result I want is evident.

Is there a way to know what the last date and time of the event bus was?

That date is not currently logged, or written onto the event bus.

However, the date is written into a file in your config directory: .homeassistant/feedreader.pickle.
This file basically consists of key-value-pairs where the feed’s URL is the key and the published date is the value.

You could read that file like this:

>>> import pickle
>>> file = open(".homeassistant/feedreader.pickle", 'rb')
>>> content = pickle.load(file)
>>> print(content)
{'http://www.rfs.nsw.gov.au/feeds/majorIncidents.xml': time.struct_time(tm_year=2018, tm_mon=9, tm_mday=28, tm_hour=8, tm_min=40, tm_sec=16, tm_wday=4, tm_yday=271, tm_isdst=0)}