A Home Assistant custom integration for fetching fuel prices in Western Australia from FuelWatch.
- ๐ Fetches FuelWatch only when prices can change (06:00 and 14:30 AWST), not on a fixed poll
- ๐ Statistical summaries (min, max, avg, price spread)
- ๐ช Station count and cheapest station details
- ๐ฏ Top 3 cheapest stations tracking
- ๐ Today/tomorrow price forecasting
- ๐ข Multiple fuel types per location
- ๐จ Device grouping for clean organization
- ๐ State class support for long-term analytics
- ๐ฏ Contextual icons and proper units
The integration supports all official FuelWatch fuel types:
ulp_91- Unleaded Petrol (91 RON)premium_95- Premium Unleaded (95 RON)diesel- Diesellpg- LPG (Autogas)premium_98- Premium Unleaded (98 RON)e85- E85 Ethanolbrand_diesel- Brand Diesel
This integration is distributed as a HACS custom repository:
- Open HACS in Home Assistant
- Click the three dots (โฎ) in the top right and select Custom repositories
- Add
https://github.com/sniereffo/fuelwatchwawith type Integration - Search for "FuelWatch WA" in HACS and install it
- Restart Home Assistant
- Go to Settings โ Devices & Services โ Add Integration
- Search for "FuelWatch WA" and follow the setup wizard
Updates are published as GitHub releases and will appear in Home Assistant's update list automatically.
- Download or clone this repository
- Copy the
custom_components/fuelwatchwafolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings โ Devices & Services โ Add Integration
- Search for "FuelWatch WA" and follow the setup wizard
During setup, you'll be asked to provide:
- Suburb: Select from dropdown or enter custom location (e.g., "Perth", "Fremantle")
- Fuel Types: Multi-select dropdown with friendly names (e.g., Diesel, Premium 98)
- Include surrounding suburbs: On by default, prices cover stations in surrounding suburbs too. Turn off to only include stations physically in the selected suburb (useful to pin a single station, e.g. Costco Casuarina). Can be changed later on existing entries via Configure.
The integration automatically fetches both today's and tomorrow's prices in each update.
Note: Today's prices are available 24/7. Tomorrow's prices are available after 2:30pm daily.
Update schedule: FuelWatch prices only change twice a day, so the integration fetches at 6:00am (today's prices take effect) and 2:30pm (tomorrow's prices are published), Perth time, plus a few minutes of random jitter. If tomorrow's prices aren't published yet it retries every 10 minutes until 4pm, then hourly. To refresh on demand, call the homeassistant.update_entity action on any FuelWatch sensor (for one-off use โ don't put it on a timer, or you recreate the polling this schedule avoids).
For each configured fuel type, the integration creates 13 sensors (8 current data + 5 analytics) grouped under a logical device.
sensor.{location}_{fuel_type}_{sensor_name}
Examples:
sensor.perth_diesel_minimum_pricesensor.caversham_premium_98_cheapest_brandsensor.south_perth_ulp_91_station_count
All sensors for a fuel type are grouped under a device named:
{Location} {Fuel Type}
Example: "Caversham Diesel" device contains all 13 diesel sensors.
minimum_price- Lowest price in area (icon: โฌ๏ธ, unit: ยข/L)average_price- Average price (icon: ๐, unit: ยข/L)maximum_price- Highest price (icon: โฌ๏ธ, unit: ยข/L)price_spread- Difference between min and max (icon: ฮ, unit: ยข/L)station_count- Number of stations reporting (icon: โฝ, unit: stations)
cheapest_price- Cheapest price (icon: ๐ฒ, unit: ยข/L)cheapest_brand- Brand name (icon: โฝ)cheapest_address- Station address (icon: ๐)
Each fuel type also includes 5 analytics sensors that provide historical trend analysis:
- 7-Day Average Price - Rolling 7-day mean price (icon: ๐, unit: ยข/L)
- Attributes:
minimum,maximum,data_points,period_days
- Attributes:
- 30-Day Average Price - Monthly trend tracking (icon: ๐, unit: ยข/L)
- Attributes:
minimum,maximum,data_points,period_days
- Attributes:
- Price Trend - Direction indicator:
increasing,decreasing, orstable(icon: ๐/๐/โก๏ธ)- Attributes:
price_change,percent_change,period_days
- Attributes:
- Price Volatility - Standard deviation measure (icon: ๐, unit: ยข/L)
- Attributes:
stability(very_stable/stable/moderate/volatile),data_points
- Attributes:
- Weekly Change % - Percentage price change over 7 days (icon: %, unit: %)
- Attributes:
price_change,trend,period_days
- Attributes:
Note: Analytics sensors require historical data from Home Assistant Recorder. They update hourly and need at least 2 days of data to function.
All sensors include these attributes:
location- Configured locationfuel_type- Fuel type keytop_3- List of 3 cheapest stations for todayfetched_at- ISO timestamp of last fetchtomorrow- Complete price summary for tomorrow (available after 2:30pm):min_price,max_price,avg_price,price_spreadcheapest_price,cheapest_brand,cheapest_addressstation_count
price_change- Price difference (tomorrow vs today cheapest price)
Import years of historical FuelWatch data to power your analytics sensors.
1. Download Historical Data
python scripts/download_historical.py \
--location Perth \
--fuel-type diesel \
--start-date 2023-01-01 \
--end-date 2024-12-31 \
--output /config/historical_data/perth_diesel.csv2. Import into Home Assistant
Use the Developer Tools โ Services:
service: fuelwatchwa.import_historical_data
data:
csv_path: /config/historical_data/perth_diesel.csv
entity_id: sensor.perth_diesel_minimum_price
source: FuelWatch HistoricalBenefits:
- Import data from 2001 onwards (if available)
- Powers analytics sensors with long-term trends
- One-time import, persistent in Recorder database
- See complete documentation in
scripts/README.md
All price sensors have state_class: measurement for automatic long-term statistics. The default SQLite recorder will track sensor states. Configure retention in configuration.yaml:
recorder:
purge_keep_days: 90
include:
entity_globs:
- sensor.*_diesel_*
- sensor.*_premium_98_*
- sensor.*_ulp_91_*Price sensors use state_class: measurement (values in ยข/L, as FuelWatch publishes them) and are compatible with:
- Long-term statistics (automatic with Recorder)
- InfluxDB integration
- History graphs
- Statistics cards
For long-term analytics and Grafana dashboards:
influxdb:
host: your-influxdb-host
port: 8086
database: homeassistant
include:
entity_globs:
- sensor.fuelwatch_*See examples/dashboards/fuelwatchwa-dashboard.yaml for a complete dashboard example.
- Single location per integration instance (add multiple instances for multiple locations)
- No region/grouped area support
- Check that the suburb/location name is spelled the way FuelWatch knows it
- Check Home Assistant logs for the underlying API error
- If the suburb has no petrol station of its own, enable Include surrounding suburbs (Settings โ Devices & Services โ Configure)
- Some locations may not have all fuel types available
- Tomorrow's data is not published until about 2:30pm
- FuelWatch may be temporarily unavailable
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Run the tests (see CONTRIBUTING.md) and test in a live Home Assistant instance
- Submit a pull request
MIT License - see LICENSE file for details
- Originally created by Damian Rosair (@drosair) โ this is a maintained fork
- Earlier versions were built on the fuelwatcher Python library by Daniel Michaels (since v0.7.0 the integration queries the FuelWatch feed directly)
- Data sourced from FuelWatch WA Government
This is an unofficial integration. Not affiliated with or endorsed by FuelWatch or the Government of Western Australia.