feedparser
feedparser copied to clipboard
Feed sensor doesn't update
I use the feedparser to get the news. But de feed is only parsed after a reboot of Home Assistant. Even with the scan_interval parameter, the feed is not updated. Any idea's
# -----------------------
# RSS feeder sensor
# -----------------------
- platform: feedparser
name: Nu.nl
feed_url: 'https://www.nu.nl/rss/Algemeen'
scan_interval:
hours: 1
show_topn: 10
exclusions:
- tags
- title_detail
- summary_detail
- authors
- author
- author_detail
- rights
- rights_detail
- id
- guidislink
@Dynamix72 What version of the feedparser integration do you use?
version 0.2.0b4 Home Assistant 2023.9.2
I have observed the same behavior on my local setup. Thank you for reporting it. I will look into it.
So far I have found out that sensor entries get updated correctly every time. However, if the number of items (entries) in the RSS feed does not change, even though the RSS feed itself was updated, Home Assistant does not update the extra_state_attributes
.
I will continue the investigation in the upcoming days.
So far I have found out that sensor entries get updated correctly every time. However, if the number of items (entries) in the RSS feed does not change, even though the RSS feed itself was updated, Home Assistant does not update the
extra_state_attributes
.I will continue the investigation in the upcoming days.
Ok thanks for the research so far. Hope you will find a solution.
I am experiencing the very same problem. Of course I hope it'll be fixed :-)
Same problem here (version 0.2.0b4). One thing I noticed is when i press the update status button in the developer tools page. The sensor updates after 30 about seconds. So the sensor updates after a reboot, and when the update status button is pressed.
I am sorry, but I do not see myself fixing it in the upcoming weeks. If there is any developer who would like to investigate further or eventually reach out to HA developers about how to properly implement the entity state update, please feel free to do that. The latest non-beta version should be still functional. I will not release the beta until this issue is resolved.
Same problem here (version 0.2.0b4). One thing I noticed is when i press the update status button in the developer tools page. The sensor updates after 30 about seconds. So the sensor updates after a reboot, and when the update status button is pressed.
Where can I find the status button?
Same problem here (version 0.2.0b4). One thing I noticed is when i press the update status button in the developer tools page. The sensor updates after 30 about seconds. So the sensor updates after a reboot, and when the update status button is pressed.
Where can I find the status button?
Developer-tools -> states -> search for entity -> click on entity -> button becomes visible
Hey @ogajduse ,
you can set self._attr_force_update = True
in the init method of the SensorEntity to force the update even if the native value is not changing.
https://developers.home-assistant.io/docs/core/entity/
I've added it and it seems to work, as I see that the entries are updated in my companion app and looking at the state itself in dev tools.
My wallpanel is not updating the list card tho, but it might be another problem, maybe due to some cache setting in chromium. Best regards,
Lorenzo
Hey @lorenzodeveloper! Thanks for going through the docs! That one must have slipped out of my sight. And it indeed does what we need! I have merged it in #110.
The list card is not updating the entity with every update, so I have to manually reload the page to actually see the update in the Lovelace.
Thank you again!
@Dynamix72 @AndreVde @Failure404 I have published a new beta version https://github.com/custom-components/feedparser/releases/tag/0.2.0b5. Can you please try if it fixes the issue?
The new version works great!! The sensor is now updating every hour. If you refresh manualy the page, then the new feed is also visable in list-card.
I can also confirm beta 5 works great