An early Christmas present for those on Octopus Agile, a dashboard graph of future predicted Octopus Agile prices that I find quite useful.
This has been shared before but it was buried in another discussion topic so as I had been improving the graph today I thought I’d share what I have created.

The graph shows 3 things:
- Today and Tomorrow’s confirmed Agile prices from the Octopus Energy integration
- Octopus Agile price prediction for the next week
- Octopus “Greenness forecast”
The price prediction is obvious, the Greenness forecast needs a bit of explanation, its a daily forecast of how green the grid will be overnight that day, the higher the score the greener the grid and most most likely the cheaper the Agile prices. Note that it is only a single score per night, not more granular than that
https://octopus.energy/smart/greener-days/
Setup details:
- Add the following to your HA configuration.yaml:
sensor:
# Predicted Agile prices
- platform: rest
name: Octopus Agile Predict
unique_id: octopus_agile_predict
resource: https://prices.fly.dev/api/A
scan_interval: 3600
value_template: "{{ value_json[0]['name']}}"
json_attributes_path: "$[0]"
json_attributes:
- "created_at"
- "prices"
The Agile price prediction is provided by https://prices.fly.dev/ - simply change the trailing ‘A’ in the “resource” URL above to match the region code you are in https://energy-stats.uk/dno-region-codes-explained/
The price prediction is sensor.octopus_agile_predict and is automatically retrieved hourly.
- Enable the Greenness sensor in the Octopus Integration
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/entities/greenness_forecast/
The sensor is named sensor.octopus_energy{{ACCOUNT_ID}}greenness_forecast_current_index and is automatically populated by the integration.
- Add the following Apex chart configuration to a dashboard, setting AAAA to your Octopus account id, XXXX and YYYY to your meter serial and MPAN:
- type: custom:apexcharts-card
experimental:
color_threshold: true
apex_config:
chart:
height: 300px
xaxis:
labels:
format: ddd, dd
header:
title: Agile Price Forecast
show: true
show_states: true
colorize_states: true
graph_span: 7d
now:
show: true
label: Now
yaxis:
- id: price
decimals: 0
min: -5
max: 80
apex_config:
tickAmount: 10
- id: greenness
opposite: true
decimals: 0
align_to: 20
apex_config:
step_size: 20
reversed: true
stacked: false
span:
start: day
series:
- entity: sensor.octopus_energy_AAAA_greenness_forecast_current_index
name: Greenness Forecast
show:
in_header: false
legend_value: false
stroke_width: 3
color_threshold:
- value: 0
color: green
- value: 50
color: orange
- value: 80
color: red
yaxis_id: greenness
data_generator: |
return entity.attributes.forecast.slice(0, 7).map((entry) => {
return [new Date(entry.start), entry.greenness_score];
});
- entity: >-
sensor.octopus_energy_electricity_XXXX_YYYY_current_rate
name: Actual Agile Import (current rate)
transform: return x * 100;
show:
in_chart: false
unit: p/kWh
- entity: >-
event.octopus_energy_electricity_XXXX_YYYY_current_day_rates
yaxis_id: price
name: Actual Import (today)
color: grey
opacity: 1
stroke_width: 2
extend_to: now
type: column
unit: p/kWh
data_generator: |
return entity.attributes.rates.map((entry) => {
return [new Date(entry.start), entry.value_inc_vat*100];
});
offset: '-15min'
show:
in_header: false
legend_value: false
offset_in_name: false
- entity: >-
event.octopus_energy_electricity_XXXX_YYYY_next_day_rates
yaxis_id: price
name: Actual Import (tomorrow)
color: grey
opacity: 0.3
stroke_width: 2
type: column
unit: p/kWh
data_generator: |
return entity.attributes.rates.map((entry) => {
return [new Date(entry.start), entry.value_inc_vat*100];
});
offset: '-15min'
show:
in_header: false
legend_value: false
offset_in_name: false
- entity: sensor.octopus_agile_predict
yaxis_id: price
name: Predicted Agile
color: red
opacity: 1
stroke_width: 1
extend_to: now
unit: p/kWh
data_generator: |
return entity.attributes.prices.map((entry) => {
return [new Date(entry.date_time), entry.agile_pred];
});
offset: '-15min'
show:
in_header: false
legend_value: false
offset_in_name: false
I have another Christmas present to share, but that’ll have to wait for another day
























