Fuel/Gas Prices integration

Thats not great, I think the only options around this is to either email them, use a proxy or another source needs to be used.

I added some additional protections to prevent overloading the API with random update intervals of 1 day + 1-240mins + 1-60secs but as they are implementing some IP blocks, there is little I can do myself.

Will update the docs and update handler for directlease though to handle this a bit more gracefully.

I get this exact problem “Please wait, starting…” I have uininstalled/removed folder, reinstalled via HACS custom respository, rebooted. Still the same problem. Any ideas? Thanks.

I have tried release 2024.1.0 and latest beta version (2024.2.0b1) - same problem with both.

Not sure if these log entries are related…

Can you create an issue on GitHub with the full debug logs please?

I think when you get a ban it permanent… Still now Im blocked.

Yes, I think you will need to email them, perhaps ask why the mobile app isn’t working properly and they would be more inclined to investigate.

Struggling to get this to work
I have added it to HACS< downloaded - Restarted
in the logs it says

File "/config/custom_components/fuel_prices/__init__.py", line 73, in async_setup_entry
    raise CannotConnect from err
custom_components.fuel_prices.CannotConnect

Well I thought I followed the instructions, maybe not. I get this error when trying to add the integration.
It just gets stuck on trying to add the integration for the first time:

Logger: homeassistant.util.package
Source: util/package.py:123
First occurred: 18:28:46 (2 occurrences)
Last logged: 18:30:33

Unable to install package reverse-geocode==1.4.1: error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [34 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel whl_basename = backend.build_wheel(metadata_directory, config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-qbiklxe1/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 1020, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-qbiklxe1/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 1073, in build_wheel with _project(config_settings) as project: File "/usr/local/lib/python3.12/contextlib.py", line 137, in __enter__ return next(self.gen) ^^^^^^^^^^^^^^ File "/tmp/pip-build-env-qbiklxe1/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 947, in _project yield Project(source_dir, build_dir, meson_args, editable_verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-qbiklxe1/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 662, in __init__ self._meson = _get_meson_command(pyproject_config.get('meson')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-qbiklxe1/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 982, in _get_meson_command meson_version = subprocess.run(cmd + ['--version'], check=False, text=True, capture_output=True).stdout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/subprocess.py", line 548, in run with Popen(*popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.12/subprocess.py", line 1953, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: 'meson' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
Unable to install package reverse-geocode==1.4.1: error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [34 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel whl_basename = backend.build_wheel(metadata_directory, config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-np3ush57/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 1020, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-np3ush57/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 1073, in build_wheel with _project(config_settings) as project: File "/usr/local/lib/python3.12/contextlib.py", line 137, in __enter__ return next(self.gen) ^^^^^^^^^^^^^^ File "/tmp/pip-build-env-np3ush57/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 947, in _project yield Project(source_dir, build_dir, meson_args, editable_verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-np3ush57/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 662, in __init__ self._meson = _get_meson_command(pyproject_config.get('meson')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-np3ush57/overlay/lib/python3.12/site-packages/mesonpy/__init__.py", line 982, in _get_meson_command meson_version = subprocess.run(cmd + ['--version'], check=False, text=True, capture_output=True).stdout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/subprocess.py", line 548, in run with Popen(*popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.12/subprocess.py", line 1953, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: 'meson' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.

After I hard refresh the page and try to install it again, I get this:

Logger: homeassistant.config_entries
Source: config_entries.py:2757
First occurred: 18:31:00 (1 occurrences)
Last logged: 18:31:00

Error occurred loading flow for integration fuel_prices: No module named 'pyfuelprices'

This has been reported for raspberry pi’s at least. Currently they aren’t supported by this integration.

What device do you have?

Oh, yeah using an Rpi, thats unfortunate.

Hi, I just attempted installation but after setup, the integration fails to start with the following error.

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 00:47:02 (2 occurrences)
Last logged: 00:47:15

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
    await fuel_prices.update()
  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)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DirectLeaseTankServiceParser.update() got an unexpected keyword argument 'force'

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
    raise CannotConnect from err
custom_components.fuel_prices.CannotConnect

hello there, added via HACS, but when I go to “Configuration” → “Integrations” click “+” and search for “Fuel Prices” and add it, the wheels spin for ages waiting to start then eventually it fails with “Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble”

What logs should supply to assist with trouble shooting?

Should I do any preset region changes prior to tying to add it?

I’m in Australia and would like to use “Fuel Watch”

found logs and I also have this issue… ok shame

Hi,

Looks like I need to update the module to fix this one.

I’ll take a look. Thanks :slight_smile:

1 Like

Above issues with RPI / DirectLease data source should be resolved in the latest beta.

Hello!
I still get the same error as @deanfourie with Spritpreisrechner from Austria :frowning: even after switching to the newly published beta.
If I change the coordinates to UK (for testing), everything works properly.

Hi,

Please try latest beta (2024.6.0b1), should be fixed :slight_smile:

Cheers ! Works like a charm now :grin:

1 Like

ah nice 2024.6.0b1 works for me too on the Pi, just a shame “Fuel Watch” is for Western Australia only.

Hi. I’ve been unable to get this integration working. I keep getting failed to setup errors. I’ve updated to 2024.6.0b1 but it still doesnt seem to work for me. I’ve included the error from my logs below.

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 11:18:29 AM (3 occurrences)
Last logged: 11:43:35 AM

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
    await fuel_prices.update()
  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)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GasBuddyUSASource.update() got an unexpected keyword argument 'force'

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
    raise CannotConnect from err
custom_components.fuel_prices.CannotConnect

There is always one I forget lol. Apologies, will fix this today and release a new beta.