Home Assistant ยท price and CO2
No dedicated Home Assistant integration is required here
A normal REST sensor is enough to consume price, CO2 and best-window data. The public summary endpoint already returns the fields most automations actually need.
- no add-on and no HACS component required
- one endpoint for price, CO2 and useful time windows
- clear separation between base price, CO2 and total-price support
The API is already usable directly from Home Assistant, scripts and other automations. The missing piece was clear documentation, not a custom integration.
Recommended endpoint
For Home Assistant, /api/v1/home-assistant/summary is the simplest entry point. It returns not just raw values, but already computed windows for cheapest, greenest and combined use.
https://energypriceforecast.eu/api/v1/home-assistant/summary?country=de&hours=48&window_hours=4flat.current_price and flat.cheapest_window_*.flat.current_co2_g_kwh and flat.greenest_window_*.flat.combined_window_* for the price/CO2 compromise.REST sensor example
This example polls Germany every 15 minutes. For other markets, only the country parameter changes.
rest:
- resource: "https://energypriceforecast.eu/api/v1/home-assistant/summary?country=de&hours=48&window_hours=4"
scan_interval: 900
sensor:
- name: "EnergyPriceForecast current price"
value_template: "{{ value_json.flat.current_price }}"
unit_of_measurement: "EUR/kWh"
- name: "EnergyPriceForecast current CO2 intensity"
value_template: "{{ value_json.flat.current_co2_g_kwh }}"
unit_of_measurement: "gCO2/kWh"
- name: "EnergyPriceForecast cheapest window start"
value_template: "{{ value_json.flat.cheapest_window_start }}"
- name: "EnergyPriceForecast greenest window start"
value_template: "{{ value_json.flat.greenest_window_start }}"
After adding the block, reload or restart Home Assistant and verify the sensor values in Developer Tools.
Public API support matrix
Not every visible market is publicly enabled for every endpoint yet. This matrix makes the current support level explicit instead of relying on guesswork.
| Market | hourly-forecast |
home-assistant/summary |
co2-live |
retail-forecast |
|---|---|---|---|---|
| DE | yes | yes | yes | yes |
| NL | yes | yes | yes | yes |
| BE | yes | yes | yes | no |
| FR | yes | yes | yes | no |
| CZ | yes | yes | no | no |
| DK1 | yes | yes | yes | yes |
| DK2 | yes | yes | yes | yes |
dk1 or dk2. A generic dk request resolves to DK1.Important notes
Is this an official Home Assistant integration?
No. This is intentionally a simple REST-based path. It is easier to test, easier to reason about and already sufficient for many setups.
Are the API prices my exact household electricity price?
Not automatically. hourly-forecast and the Home Assistant summary start with market/base prices. The exact total price depends on country-specific grid fees, taxes, levies and supplier markup.
What happens for an unsupported country?
The public API now returns an explicit error instead of silently falling back to Germany. That is intentional so automations do not run on wrong data.