Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed sensor doesn't update #104

Open
Dynamix72 opened this issue Sep 20, 2023 · 15 comments
Open

Feed sensor doesn't update #104

Dynamix72 opened this issue Sep 20, 2023 · 15 comments

Comments

@Dynamix72
Copy link

Dynamix72 commented Sep 20, 2023

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
@ogajduse
Copy link
Collaborator

@Dynamix72 What version of the feedparser integration do you use?

@Dynamix72
Copy link
Author

version 0.2.0b4
Home Assistant 2023.9.2

@ogajduse
Copy link
Collaborator

I have observed the same behavior on my local setup. Thank you for reporting it. I will look into it.

@ogajduse
Copy link
Collaborator

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.

@Dynamix72
Copy link
Author

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.

@Failure404
Copy link

I am experiencing the very same problem. Of course I hope it'll be fixed :-)

@AndreVde
Copy link

AndreVde commented Nov 1, 2023

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.

@ogajduse
Copy link
Collaborator

ogajduse commented Nov 8, 2023

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.

@1mfaasj
Copy link

1mfaasj commented Nov 10, 2023

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?

@AndreVde
Copy link

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

IMG_0440

@lorenzodeveloper
Copy link

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

@ogajduse
Copy link
Collaborator

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!

@ogajduse
Copy link
Collaborator

@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?

@Dynamix72
Copy link
Author

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.

@pxFIN
Copy link

pxFIN commented Dec 3, 2023

I can also confirm beta 5 works great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants