Here is an Apexcart configuration that uses the attributes data from the various sensors updated by EMHASS publishing API.
type: custom:apexcharts-card
experimental:
color_threshold: true
graph_span: 16h
span:
start: minute
now:
show: true
label: now
color: red
yaxis:
- id: first
decimals: 2
apex_config:
forceNiceScale: true
- id: second
opposite: true
min: -4000
max: 7000
decimals: 0
apex_config:
forceNiceScale: true
header:
show: true
title: Energy flow
show_states: true
colorize_states: true
series:
- entity: sensor.amber_30min_forecasts_general_price
yaxis_id: first
curve: stepline
float_precision: 2
show:
in_header: after_now
stroke_width: 1
name: price kWh
data_generator: |
return entity.attributes.Forecasts.map((entry) => {
return [new Date(entry.start_time), entry.advanced_price_predicted];
});
- entity: sensor.amber_30min_forecasts_feed_in_price
yaxis_id: first
curve: stepline
float_precision: 2
show:
in_header: after_now
stroke_width: 1
name: FiT kWh
data_generator: |
return entity.attributes.Forecasts.map((entry) => {
return [new Date(entry.start_time), -entry.advanced_price_predicted];
});
- entity: sensor.p_batt_forecast
yaxis_id: second
curve: stepline
type: area
show:
in_header: before_now
stroke_width: 1
opacity: 0.2
color: rgb(0,255,0)
name: Batt Forecast
data_generator: |
return entity.attributes.battery_scheduled_power.map((entry) => {
return [new Date(entry.date), entry.p_batt_forecast];
});
- entity: sensor.p_deferrable0
yaxis_id: second
curve: stepline
stroke_width: 1
name: Pool
show:
in_header: before_now
data_generator: |
return entity.attributes.deferrables_schedule.map((entry) => {
return [new Date(entry.date), entry.p_deferrable0];
});
- entity: sensor.p_deferrable1
yaxis_id: second
curve: stepline
stroke_width: 1
name: Car
color: white
show:
in_header: before_now
data_generator: |
return entity.attributes.deferrables_schedule.map((entry) => {
return [new Date(entry.date), entry.p_deferrable1];
});
- entity: sensor.p_pv_forecast
yaxis_id: second
curve: stepline
show:
in_header: before_now
stroke_width: 1
name: PV Forecast
color: rgb(255,215,0)
data_generator: |
return entity.attributes.forecasts.map((entry) => {
return [new Date(entry.date), entry.p_pv_forecast];
});
- entity: sensor.p_load_forecast
yaxis_id: second
curve: stepline
show:
in_header: before_now
stroke_width: 1
name: Load Forecast
color: rgb(255,0,0)
data_generator: |
return entity.attributes.forecasts.map((entry) => {
return [new Date(entry.date), entry.p_load_forecast];
});
- entity: sensor.p_grid_forecast
yaxis_id: second
curve: stepline
opacity: 0.1
color: rgb(0,255,255)
type: area
show:
in_header: before_now
stroke_width: 1
name: Grid Forecast
data_generator: |
return entity.attributes.forecasts.map((entry) => {
return [new Date(entry.date), entry.p_grid_forecast];
});
And here is itâs output:
You can see that the chart starts at time NOW which is updated every 60 seconds in my case with the publish_data API call. It then plots the attribute entities (e.g p_batt_forecast:) along the X axis using the âDate:â entity in attribute. Its also publishing my tariff forecast sensors which will be different to yours.
You can see that my EV (white line) needs a bit of charging today as we drove down to Gerringong yesterday (4 hour drive there and back from Sydney).
Also it looks like cloud is predicted as the yellow line is sinking after 10:00 (although its sunny right now).
But the price for electricity (orange line) remains low throughout the day at below 5 cents per kWh due to the Australian NEM being powered by 1/3 of all homes having solar panels up and down the 5,000 km coast line from Port Douglas in Queensland to Port Lincoln in South Australia and extending to Tasmania (NEM National Energy Market). Western Australian grid is isolated from the east.
But also note that the feed-in tariff is negative at up to -3 cents per kWh for most of the day as well so I donât want any of my solar production to leak out onto the grid therefore the pool pump (purple line) will stay on most of the day and the battery charging (green line and area) will soak up the limited solar energy (limited due to predicted cloud).
Useful to get all that from one graph.
A second graph I use is this:
Forecasr battery SOC compared to tariffs.
Clearly shows the profit mode of the battery.
But not much money to be made with maximum feed-in tariff tonight at just over 14 cents.
Its the spikes we look forward to when the temperature hits 40 deg and everybody turns their HVAC on and the feed-in tariff hits $18 for 3 hours (due to dirty coal generators and gas peaker stations cutting in). We make some coin then.
But I suspect $18 feed-in tariffs will become more uncommon as more and more people install home batteries ( over 271,000 home batteries installed in Australia now) and big commercial battery installations continue to grow.