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

Manually update prices #8

Closed
3 tasks done
MaasOne opened this issue Feb 7, 2024 · 2 comments · Fixed by #10
Closed
3 tasks done

Manually update prices #8

MaasOne opened this issue Feb 7, 2024 · 2 comments · Fixed by #10
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MaasOne
Copy link

MaasOne commented Feb 7, 2024

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

The prices are only updated once a day.
Since a price change one time per day is intended by law in a lot of countries, in Germany a gas station can change its prices whenever they want. So at least in Germany the prices are changing significantly over the day for every gas station. It's a short-term market.
Also for once-a-day-countries the update time is important. Actually the update time is the time when the integration was configured. Not the time when the price can be changed by law. So, also for these countries at least an update time per day configuration would be great.

Describe the solution you'd like

Please integrate the possibility to update the prices manually.
Either by giving the opportunity to update an entity with the service "homeassistant.update_entity" or with some other kind of input_button or service or so to trigger a complete update.

Describe alternatives you've considered

Additionally or as replacement you could give the option of amount of hours between updates and the "initial" time of update.

Additional context

None additional context.

@pantherale0
Copy link
Owner

Hi,

I need to be careful enabling this as some providers seem to block IP addresses if an update is requested too often (https://community.home-assistant.io/t/fuel-prices-integration/658716/54?u=11harveyj), currently I have no idea what service limits are in place for some providers.

One provider in the UK will only allow you to request the data once every 24 hours for example, the rest will timeout.

The update interval can be configured down to a lowest of two hours (although the latest beta admittedly allows down to every 1 minute currently which will be far too often as you run a higher risk getting blocked I think).

@pantherale0 pantherale0 added enhancement New feature or request help wanted Extra attention is needed labels Feb 10, 2024
@MaasOne
Copy link
Author

MaasOne commented Feb 13, 2024

Yes, updating every entity by itself would cause a lot of traffic and requests.
So a regular update of all entities at the same time within a day would be great.
Either by manual update of the user or by configuration.

For German "Tankerkoenig" I can tell you that a call every 3 hours is not a problem.

I'm actually updating every entity at once with homeassistant.reload_config_entry service with help of a specific static entity (device_tracker).
This is just a workaround and shouldn't be intentionally.

I guess you need to test this out for every provider. Minimum every 1 hour would be great. At least every 3 hours should be provided where it's possible.

You don't need to implement a regulation below "every hour". It would be enough to write down in the documentation, which provider gives you an IP block at which interval.
The rest is in the responsibility of the user. Of course you're also indirectly in responsibility with your software, but you can limit it to 1 time per hour. And that seems definitely to be enough for an API and at the same time for the need of these information.

@pantherale0 pantherale0 self-assigned this Mar 1, 2024
@pantherale0 pantherale0 linked a pull request Mar 1, 2024 that will close this issue
pantherale0 added a commit that referenced this issue Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants