Closed istaveren closed 1 year ago
Using the ApexCharts Card you can plot the prices by using the prices and hours in the attributes of the sensors as shown below.
Example graph:
Example lovelace code:
type: custom:apexcharts-card
graph_span: 24h
span:
start: day
now:
show: true
label: Now
header:
show: true
title: Electriciteitsprijzen Vandaag (€/kwh)
series:
- entity: sensor.current_electricity_market_price
stroke_width: 2
float_precision: 3
type: column
opacity: 1
color: ''
data_generator: |
return entity.attributes.prices_today.map((record, index) => {
return [record.time, record.price];
});
I know I was using:
type: custom:apexcharts-card
graph_span: 48h
update_delay: 2s
span:
start: day
now:
show: true
label: Nu
header:
show: false
title: Day ahead prices
show_states: true
colorize_states: true
series:
- entity: sensor.current_electricity_market_price
type: column
name: Today
float_precision: 4
data_generator: |
return entity.attributes.prices_today.map((data, index) => {
return [data.time, data.price];
});
- entity: sensor.current_electricity_market_price
name: Tomorrow
type: column
float_precision: 4
data_generator: |
return entity.attributes.prices_tomorrow.map((data, index) => {
return [new Date(data.time).getTime(), data.price];
});
Was planning to create a merge request to add it to the readme ;-).
Would be nice if you can show the prices per hour in a graph.