https://github.com/firstof9/ha-gasbuddy
Component to integrate with GasBuddy fuel price tracker.
https://github.com/firstof9/ha-gasbuddy
hacktoberfest home-assistant home-automation integration
Last synced: 20 days ago
JSON representation
Component to integrate with GasBuddy fuel price tracker.
- Host: GitHub
- URL: https://github.com/firstof9/ha-gasbuddy
- Owner: firstof9
- License: mit
- Created: 2023-12-07T20:53:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-04T20:04:45.000Z (9 months ago)
- Last Synced: 2025-10-04T04:37:04.873Z (8 months ago)
- Topics: hacktoberfest, home-assistant, home-automation, integration
- Language: Python
- Homepage:
- Size: 264 KB
- Stars: 41
- Watchers: 4
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# GasBuddy
[![GitHub Release][releases-shield]][releases]
[![GitHub Activity][commits-shield]][commits]
[![License][license-shield]](LICENSE)
[![hacs][hacsbadge]][hacs]
![Project Maintenance][maintenance-shield]
[![BuyMeCoffee][buymecoffeebadge]][buymecoffee]
[![Discord][discord-shield]][discord]
[![Community Forum][forum-shield]][forum]
_Integration to track fuel prices from [GasBuddy][GasBuddy]._
**This integration will set up the following platforms.**
Platform | Description
-- | --
`sensor` | Show info, prices, and EV charging details from a GasBuddy listed station.
## Installation via HACS (recommended)
[](https://my.home-assistant.io/redirect/hacs_repository/?owner=firstof9&repository=ha-gasbuddy)
1. Follow the link [here](https://hacs.xyz/docs/faq/custom_repositories/)
2. Use the custom repo link [https://github.com/firstof9/ha-gasbuddy][ha-gasbuddy]
3. Select the category type `integration`
4. Then once it's there (still in HACS) click the INSTALL button
5. Restart Home Assistant
6. Once restarted, in the HA UI go to `Configuration` (the ⚙️ in the lower left) -> `Devices and Services` click `+ Add Integration` and search for `GasBuddy`
## Manual (non-HACS)
Instructions
You probably do not want to do this! Use the HACS method above unless you know what you are doing and have a good reason as to why you are installing manually
1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`).
2. If you do not have a `custom_components` directory (folder) there, you need to create it.
3. In the `custom_components` directory (folder) create a new folder called `gasbuddy`.
4. Download _all_ the files from the `custom_components/gasbuddy/` directory (folder) in this repository.
5. Place the files you downloaded in the new directory (folder) you created.
6. Restart Home Assistant
7. Once restarted, in the HA UI go to `Configuration` (the ⚙️ in the lower left) -> `Devices and Services` click `+ Add Integration` and search for `GasBuddy`
## Remedying Connection/timeout issues with FlareSolverr (Optional)
Since May 2025, GasBuddy implemented Cloudflare which may lead to blocking of requests to GasBuddy, and cause timeout and log errors. This would lead to the occasional missed data update to obtain the latest gas prices, along with log errors.
To circumvent this, FlareSolverr can be used to bypass Cloudflare protection. FlareSolverr can be installed via [FlareSolverr standalone installation](https://github.com/FlareSolverr/FlareSolverr) or as an [FlareSolverr Home Assistant add-on](https://github.com/alexbelgium/hassio-addons/tree/master/flaresolverr). Once your FlareSolverr instance is up and running, you can re-configure your existing GasBuddy entries by clicking the 3 dots of EACH gas station entry, and entering your FlareSolverr URL, ie. `http://ip:port/v1`

Future changes to your FlareSolverr instance can be edited the same way.
## Configuration
Configuration is done via the Home Assistant UI. When adding the integration, you will be presented with several search options:
* **Manual**: Enter the GasBuddy Station ID directly.
* **Search by Home**: Uses your Home Assistant zone coordinates to find nearby stations.
* **Search by Postal Code**: Enter a specific Zip or Postal Code to find stations in that area.
You can configure the following options by clicking **Configure** on the integration card:
* **Polling interval**: Polling frequency in seconds.
* **Show per liter/gallon in unit of measure**: Standardizes price representation.
* **Show stations on map**: Enables rendering of stations on the Map panel.
* **Enable EV charging sensors**: Toggles dedicated EV charging sensors (`sensor.gas_station_ev_stations_nearby`, `sensor.gas_station_closest_ev_station`, `sensor.gas_station_closest_ev_distance`) which fetch and display nearby EV station coordinates, addresses, connector counts, connection types, charging power (kW), and speed details.
## Services
The following services are available:
Service | Description | Arguments
:--- | :--- | :---
`lookup_gps` | Lookup prices using GPS coordinates from a list of entities (e.g., `device_tracker` or `person`). | `entity_id` (Required), `limit` (Optional, 1-99), `solver` (Optional)
`lookup_zip` | Lookup prices via ZIP/Postal code. | `zipcode` (Required), `limit` (Optional, 1-99), `solver` (Optional)
`ev_lookup_gps` | Lookup nearby EV stations using GPS coordinates from a list of entities. | `entity_id` (Required), `limit` (Optional), `radius` (Optional), `solver` (Optional)
`ev_lookup_zip` | Lookup nearby EV stations via ZIP/Postal code. | `zipcode` (Required), `limit` (Optional), `radius` (Optional), `solver` (Optional)
`clear_cache` | Clear the cache for specific device(s). | `device_id` (Required)
## Contributions are welcome!
If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md)
***
[GasBuddy]: https://gasbuddy.com/
[ha-gasbuddy]: https://github.com/firstof9/ha-gasbuddy
[buymecoffee]: https://www.buymeacoffee.com/firstof9
[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge
[commits-shield]: https://img.shields.io/github/commit-activity/y/firstof9/ha-gasbuddy.svg?style=for-the-badge
[commits]: https://github.com/firstof9/ha-gasbuddy/commits/main
[hacs]: https://github.com/custom-components/hacs
[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge
[discord]: https://discord.gg/Qa5fW2R
[discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge
[exampleimg]: example.png
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge
[forum]: https://community.home-assistant.io/
[license-shield]: https://img.shields.io/github/license/firstof9/ha-gasbuddy.svg?style=for-the-badge
[maintenance-shield]: https://img.shields.io/badge/maintainer-Chris%20Nowak%20%40firstof9-blue.svg?style=for-the-badge
[releases-shield]: https://img.shields.io/github/release/firstof9/ha-gasbuddy.svg?style=for-the-badge
[releases]: https://github.com/firstof9/ha-gasbuddy/releases