{"id":50805524,"url":"https://github.com/firstof9/gasbuddy-card","last_synced_at":"2026-06-13T00:33:14.946Z","repository":{"id":360036794,"uuid":"1248455561","full_name":"firstof9/gasbuddy-card","owner":"firstof9","description":"Home Assistant custom Lovelace card for the GasBuddy integration displaying gas prices and EV charging station data.","archived":false,"fork":false,"pushed_at":"2026-06-09T23:05:40.000Z","size":929,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-10T00:18:16.753Z","etag":null,"topics":["custom-card","ev-charging","gasbuddy","hacs","home-assistant","homeassistant","lit","lovelace","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstof9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T17:03:16.000Z","updated_at":"2026-06-09T23:04:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/firstof9/gasbuddy-card","commit_stats":null,"previous_names":["firstof9/gasbuddy-card"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/firstof9/gasbuddy-card","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstof9%2Fgasbuddy-card","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstof9%2Fgasbuddy-card/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstof9%2Fgasbuddy-card/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstof9%2Fgasbuddy-card/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstof9","download_url":"https://codeload.github.com/firstof9/gasbuddy-card/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstof9%2Fgasbuddy-card/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34268187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-card","ev-charging","gasbuddy","hacs","home-assistant","homeassistant","lit","lovelace","typescript"],"created_at":"2026-06-13T00:33:11.371Z","updated_at":"2026-06-13T00:33:14.939Z","avatar_url":"https://github.com/firstof9.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GasBuddy Card\n\n[![GitHub Release](https://img.shields.io/github/v/release/firstof9/gasbuddy-card?style=for-the-badge)](https://github.com/firstof9/gasbuddy-card/releases)\n[![GitHub Downloads](https://img.shields.io/github/downloads/firstof9/gasbuddy-card/total?style=for-the-badge)](https://github.com/firstof9/gasbuddy-card/releases)\n[![CI](https://img.shields.io/github/actions/workflow/status/firstof9/gasbuddy-card/lint.yml?branch=main\u0026label=CI\u0026style=for-the-badge)](https://github.com/firstof9/gasbuddy-card/actions/workflows/lint.yml)\n[![HACS Badge](https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge)](https://github.com/hacs/integration)\n[![License](https://img.shields.io/github/license/firstof9/gasbuddy-card?style=for-the-badge)](https://github.com/firstof9/gasbuddy-card/blob/main/LICENSE)\n\nA modern, premium Home Assistant custom Lovelace card for displaying gas prices and EV charging station data fetched from the [GasBuddy custom integration](https://github.com/firstof9/ha-gasbuddy).\n\n## Features\n\n- **Fuel Prices \u0026 EV Chargers:** Displays comprehensive gas station fuel prices and a dedicated EV view showing available chargers and connector types.\n- **Price Trend Graph:** Optional background sparkline behind each fuel grade, sourced from Home Assistant's recorder history so you can see whether prices are trending up or down.\n- **Station Address:** Automatically discovers and displays the station address and coordinates.\n- **EV Payment Options:** Shows accepted payment methods for EV charging using recognizable credit and debit card logos.\n- **Last Confirmed Status:** Clearly shows the time elapsed since the last price or charger status confirmation.\n- **Version Tracking:** Outputs the active card version into your browser's console for easy debugging.\n- **Visual Editor:** Full UI configuration through the Lovelace card editor.\n\n## Screenshots\n\n### Gas Prices View\n![Gas Prices State](screenshots/gas_station.png)\n\n### EV Chargers View\n![EV Chargers State](screenshots/ev_only_station.png)\n\n### Visual Configuration\n![Configuration Editor](screenshots/card_editor.png)\n\n## Requirements\n\nThis card requires the **[GasBuddy custom integration](https://github.com/firstof9/ha-gasbuddy)** to be installed and configured in Home Assistant.\n\n## Installation\n\n### HACS (Recommended)\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=firstof9\u0026repository=gasbuddy-card\u0026category=plugin)\n\n1. Open HACS.\n2. Click on \"Frontend\".\n3. Click on the three dots in the top right corner and select \"Custom repositories\".\n4. Add `https://github.com/firstof9/gasbuddy-card` with category \"Dashboard\".\n5. Search for \"GasBuddy Card\" and click \"Download\".\n\n### Manual\n\n1. Download `gasbuddy-card.js` from the latest release (it's a single self-contained bundle).\n2. Copy it to your `config/www/` directory.\n3. Add the following to your `configuration.yaml` or through the UI:\n   ```yaml\n   resources:\n     - url: /local/gasbuddy-card.js\n       type: module\n   ```\n\n## Usage\n\nThe card uses your GasBuddy device ID (from the integration device registry) to automatically discover and display the station name, coordinates, fuel prices, and EV charger states.\n\n```yaml\ntype: custom:gasbuddy-card\ndevice_id: 32_character_device_registry_id_from_hacs_gasbuddy\ndefault_mode: gas             # Optional: 'gas' or 'ev' (defaults to 'gas')\ntitle: \"My Local Station\"     # Optional: Custom card title override\nshow_trend: true              # Optional: render a background price-history sparkline behind each fuel grade (defaults to false)\ntrend_hours: 168              # Optional: how many hours of history to plot (defaults to 168 = 7 days; clamped 1-720)\n```\n\n### Price trend graph\n\nWhen `show_trend: true` the card fetches recent state history for each\nvisible fuel-grade sensor and renders a thin sparkline as the background\nof each price tile. The default window is **7 days (168 hours)**; the\nvisual editor exposes a number field that accepts 1–720 hours (30 days).\n\nNotes:\n\n- History is fetched at most once every 10 minutes per card instance, so\n  enabling it does not put meaningful load on the recorder.\n- The sparkline uses Home Assistant's accent color and stays purely\n  decorative — current price text always renders on top.\n- If a sensor has fewer than two recorded values in the requested window\n  (e.g. it was just added), the card simply omits its sparkline.\n- Requires the Home Assistant `recorder` integration to be enabled for\n  the configured GasBuddy sensors. (`recorder` is on by default in HA.)\n\n## Advanced configuration\n\nIf you need to override individual sensors discovered automatically by the device ID, you can supply their entity IDs explicitly. The card supports a wide variety of specific sensor overrides.\n\n### Supported Overrides\n\n#### Fuel Price Entities\nYou can override any of these by appending `_entity` (e.g., `regular_gas_entity`):\n- `regular_gas`, `midgrade_gas`, `premium_gas`, `diesel`\n- `regular_gas_cash`, `midgrade_gas_cash`, `premium_gas_cash`, `diesel_cash`\n- `e85`, `e85_cash`, `e15`, `e15_cash`\n- `last_updated`\n\n#### EV Sensor Entities\nYou can override any of these by appending `_entity` (e.g., `ev_dc_fast_entity`):\n- **Chargers:** `ev_level1`, `ev_level2`, `ev_dc_fast`\n- **Connectors:** `ev_j1772`, `ev_j1772_power`, `ev_ccs`, `ev_ccs_power`, `ev_chademo`, `ev_chademo_power`, `ev_nacs`, `ev_nacs_power`\n- **Metadata:** `ev_network`, `ev_pricing`, `ev_access_hours`, `ev_status`, `ev_cards_accepted`, `ev_date_last_confirmed`\n\n```yaml\ntype: custom:gasbuddy-card\ndevice_id: 32_character_device_registry_id\nregular_gas_entity: sensor.other_regular_gas_sensor\nev_dc_fast_entity: sensor.other_ev_dc_fast_chargers\nev_cards_accepted_entity: sensor.other_ev_payment_methods\n```\n\n### Full Configuration Options\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `type` | string | **Required** | Must be `custom:gasbuddy-card`. |\n| `device_id` | string | **Required** | The device registry ID of the GasBuddy station. |\n| `title` | string | Optional | Custom title header of the card. |\n| `default_mode` | `\"gas\"` \\| `\"ev\"` | `\"gas\"` | Which tab the card opens on when both gas and EV data are present. |\n| `compact` | boolean | `false` | Enable a dense, space-saving list layout optimized for mobile screens (iPhone) and dashboard sidebars. |\n| `show_trend` | boolean | `false` | Render a background price-history sparkline behind each fuel grade. |\n| `trend_hours` | number | `168` | Hours of history to plot when `show_trend` is on. Range 1–720. |\n| `show_trend_indicator` | boolean | `false` | Show an inline ▲ / ▼ / ≈ + percent change beside each price. |\n| `trend_indicator_baseline_hours` | number | `24` | Hours back to compare the current price against. Range 1–720. |\n| `tap_action` | [Action](#price-tile-actions) | `{ action: 'more-info' }` | What happens when a price tile is tapped or activated via keyboard. |\n| `hold_action` | [Action](#price-tile-actions) | `{ action: 'none' }` | What happens when a price tile is held for ~½ second. |\n| `\u003cfuel_type\u003e_entity` | string | Auto-discovered | Manual override for specific fuel price sensors. |\n| `\u003cev_sensor\u003e_entity` | string | Auto-discovered | Manual override for specific EV charger status/connector sensors. |\n\n### Price tile actions\n\nEach fuel price tile is interactive. By default, tapping a tile opens\nHome Assistant's standard more-info dialog for that grade's sensor —\nthe same dialog you get clicking the entity anywhere else in Lovelace.\n\nYou can override the tap / hold behavior using HA's standard action\nconfig schema (the same one used by entity cards, button cards, etc.):\n\n```yaml\ntype: custom:gasbuddy-card\ndevice_id: 32_character_device_registry_id\n\n# Open a navigation path instead of more-info on tap\ntap_action:\n  action: navigate\n  navigation_path: /lovelace/fuel-stations\n\n# Long-press to call a service (e.g. send the price to a notify target)\nhold_action:\n  action: call-service\n  service: notify.mobile_app_my_phone\n  service_data:\n    message: \"Check the price card!\"\n```\n\nSupported actions: `more-info`, `navigate`, `url`, `call-service`,\n`none`. Setting both to `none` removes the focus outline and keyboard\nhandling — the tile becomes purely informational.\n\n## Development\n\nThe card is written in TypeScript with [Lit](https://lit.dev) and bundled with [Rollup](https://rollupjs.org). Source lives in `src/`; running `npm run build` produces `gasbuddy-card.js` at the repo root (gitignored).\n\n```bash\nnpm install        # install dev deps + lit\nnpm run typecheck  # tsc --noEmit (no JS emit, just type checking)\nnpm test           # run vitest unit tests\nnpm run build      # produce gasbuddy-card.js from src/\nnpm run build:watch  # rebuild on every save while iterating\n```\n\nCI runs `typecheck`, `build`, and `test` on every PR. The built bundle is uploaded as a workflow artifact (`gasbuddy-card-bundle`) on every successful build so reviewers can download a PR's compiled output without having to build locally. End users get the bundle from [GitHub Releases](https://github.com/firstof9/gasbuddy-card/releases), which the `release.yml` workflow builds and attaches automatically when a release is published.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstof9%2Fgasbuddy-card","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstof9%2Fgasbuddy-card","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstof9%2Fgasbuddy-card/lists"}