Fuel/Gas Prices integration

There is still no solution for the Dutch stations? Directlease has blocked my for months

Not yet, I could proxy the requests through another server, there is a massive list here full of proxies:

https://proxylist.geonode.com/api/proxy-list?limit=500&page=1&sort_by=lastChecked&sort_type=desc

Would be concerned about privacy taking this approach. I need to see if anything else uses the directlease data.

2024.6.0b2 has just been released which should fix gasbuddy

Seems like the update fixed the setup error! Thank you for making that update so quickly. I am running into another issue with the integration however. So the area is currently defined as a 10 mile radius from my home however no entities are being generated at all. I know there are multiple gas stations within that radius so I’m unsure why the entities aren’t being generated.

Do these gas stations appear on the GasBuddy app? I’ve created a quick setup and picked a random city in the states and I’m seeing a number of entities created:

If you PM me some coordinates near where you are I can try with your config.

Is there support for New Zealand?

Thanks

Not yet, although I have identified gaspy as a potential data source for NZ.

1 Like

Support for New Zealand now added.

Sorry, for which integration is this? is this with ha-fuelprices?

Thanks

Yes it is.

1 Like

Sorry, but what source do I select when setting this up?

Data Collection Source?

Thanks

If you leave it blank, it should automatically select based on what areas you have defined.

Damn, im still getting errors when attempting to configure this.

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 22:37:59 (3 occurrences)
Last logged: 23:21:23

Error setting up entry Fuel Prices for fuel_prices
Traceback (most recent call last):
  File "/config/custom_components/fuel_prices/__init__.py", line 67, in async_setup_entry
  File "/usr/local/lib/python3.12/site-packages/pyfuelprices/__init__.py", line 37, in update
    await asyncio.gather(*coros)
  File "/usr/local/lib/python3.12/site-packages/pyfuelprices/__init__.py", line 31, in update_src
    await s.update(areas=a, force=f)
  File "/usr/local/lib/python3.12/site-packages/pyfuelprices/sources/austria/spritpreisrechner.py", line 117, in update
    response_raw = json.loads(await self._send_request(url))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyfuelprices/sources/austria/spritpreisrechner.py", line 40, in _send_request
    async with self._client_session.get(
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 428, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/fuel_prices/__init__.py", line 73, in async_setup_entry
custom_components.fuel_prices.CannotConnect

What version are you using? The source of those errors seem to relate to code on different lines than what is reported.

Also, spritpreisrechner is a source for Austria so seems something is wrong with your configuration if you are expecting New Zealand.

Thats weird, I just freshly cloned the repository after you posted that its working for new zealand.

Maybe my long and lat are incorrect? But i’m pretty sure im using latest version unless i’ve done something wrong.

I did not specify a source as you suggested.

The zone it is using is my HA zone, so it cant be wrong. Im so confused haha.

It also seems to fail to display a version. 0.0.0

Please ensure you are using the releases via HACS and not cloning the repository as the releases contain correct version keys.

Ok damn ok sorry, got it.

I’ve added it via HACS, now seems to be working, however, does this create any entites?

Still nothing is showing on my Map

This should create entities representing fuel stations providing they are found within defined areas and available via data sources.

If this is trying to pull Austria for you rather than New Zealand, you might want to delete the config entry and setup again but manually select “PetrolSpy” as the data source for NZ (available sources are here GitHub - pantherale0/pyfuelprices: An expandable Python fuel prices library).

Its worth noting that if the lat/long is incorrect, it still won’t return expected results. You can use a tool like https://www.latlong.net/ or OpenStreetMaps to get the lat/long. The home area will have a set radius of 5 miles by default, if no stations are within this area you might need to expand this radius or choose another centre point.

Ok its weird, the Long/Lat cant be wrong as its using my HA location.

I’ve confirmed that the data source is set the PetrolSpy but still it does not seem to create any entities. Have also rebooted after configuration.