Integrations
Integrating with Home Assistant or evcc needs nothing installed. Both are ready to go: all it takes is the right URL, which the software you already run knows how to read.
evcc
evcc can read forecast data straight from a URL. Add these lines to evcc.yaml and plan charging up to seven days ahead.
tariffs:
currency: EUR
grid:
type: custom
forecast:
source: http
uri: https://api.spotforecast.eu/v1/integrations/evcc?zone=CZ
headers:
Authorization: Bearer YOUR_KEYPrices are EUR/kWh, which is what evcc expects. Replace YOUR_KEY with your own key.
Home Assistant
Use a REST sensor rather than a custom component. A standard integration would limit you to today and tomorrow, which throws away a large part of the forecast horizon.
# configuration.yaml
recorder:
exclude:
entities:
- sensor.spot_price_now
rest:
- resource: https://api.spotforecast.eu/v1/integrations/home-assistant?zone=CZ
headers:
X-API-Key: YOUR_KEY
scan_interval: 1800
sensor:
- name: "Spot price now"
value_template: "{{ value_json.current_price }}"
unit_of_measurement: "ct/kWh"
state_class: measurement
json_attributes:
- prices
- as_of_utc
- unitPrices are ct/kWh, the unit the energy dashboard uses. Replace YOUR_KEY with your own key.
The sensor carries a week of prices in its attributes, which is more than Home Assistant keeps in history. The recorder block tells it not to try; the price history is ours to serve anyway. If you already have a recorder block, add the exclusion to that one rather than a second block.