type: custom:apexcharts-card
apex_config:
chart:
height: 350px
toolbar:
show: true
offsetY: -27
tools:
selection: true
download: false
zoom: false
zoomin: true
zoomout: true
pan: true
reset: true
zoom:
enabled: true
tooltip:
fixed:
enabled: true
position: topRight
all_series_config:
unit: " kr."
experimental:
color_threshold: true
header:
title: Elpriser pr. time_SL
show: true
standard_format: true
show_states: true
colorize_states: true
now:
show: true
label: Nu
show:
last_updated: true
graph_span: 36h
span:
start: hour
offset: "-6h"
yaxis:
- min: 0
apex_config:
tickAmount: 5
series:
- entity: sensor.stromligning_current_price_vat
type: column
name: Inkl. afgifter
data_generator: >
var data = entity.attributes.prices.map((start, index) => {
return [new Date(start["start"]).getTime(), entity.attributes.prices[index]["price"]];
});
if (hass.states['binary_sensor.stromligning_tomorrow_available_vat'].state
== "on") {
var tomorrow = hass.states['binary_sensor.stromligning_tomorrow_available_vat'].attributes.prices.map((start, index) => {
return [new Date(start["start"]).getTime(), hass.states['binary_sensor.stromligning_tomorrow_available_vat'].attributes.prices[index]["price"]];
});
data = data.concat(tomorrow)
} return data;
float_precision: 2
color_threshold:
- value: 0
color: green
- value: 1.5
color: orange
- value: 2.5
color: red
- value: 4
color: darkred
show:
in_header: raw
extremas: time
legend_value: false
- entity: sensor.stromligning_current_price_vat
name: Excl. afgifter
type: line
color: 03a9f4
stroke_width: 4
float_precision: 2
extend_to: false
show:
in_header: false
extremas: true
legend_value: false
data_generator: >
var tax =
parseFloat(hass.states['sensor.stromligning_electricity_tax_vat'].state)
|| 0; var data = entity.attributes.prices.map((start, index) => {
return [new Date(start["start"]).getTime(), entity.attributes.prices[index]["price"] - tax];
});
if (hass.states['binary_sensor.stromligning_tomorrow_available_vat'].state
== "on") {
var tomorrow = hass.states['binary_sensor.stromligning_tomorrow_available_vat'].attributes.prices.map((start, index) => {
return [new Date(start["start"]).getTime(), hass.states['binary_sensor.stromligning_tomorrow_available_vat'].attributes.prices[index]["price"] - tax];
});
data = data.concat(tomorrow)
} return data;