Her er det jeg har fått fikset i første runde.
Ser at de fleste eksempler i den lange tråden om dette, kun vise sluttprisen pr døgn i header feltet.
Men jeg endret til å vise prisen akkurat nå.
type: custom:apexcharts-card
header:
show: true
title: Pris denne time
show_states: true
colorize_states: true
series:
- entity: sensor.nordpool_kwh_bergen_nok_3_095_025
show:
in_header: false
name: Snitt
type: line
curve: straight
float_precision: 4
stroke_width: 1
opacity: 0.4
color: green
data_generator: >
return [[start, entity.attributes.average*0.9],[end,
entity.attributes.average*0.9]];
- entity: sensor.nordpool_kwh_bergen_nok_3_095_025
show:
in_header: false
name: Snitt
type: line
curve: straight
float_precision: 4
stroke_width: 1
opacity: 0.4
color: green
data_generator: >
return [[start, entity.attributes.average*1.15],[end,
entity.attributes.average*1.15]];
- entity: sensor.nordpool_kwh_bergen_nok_3_095_025
show:
in_header: true
name: Snitt
type: column
curve: straight
float_precision: 4
stroke_width: 1
opacity: 0.4
color: green
data_generator: >
return [[moment.calendar,
entity.attributes.current_price],[moment.calendar,
entity.attributes.current_price]];
- entity: sensor.nordpool_kwh_bergen_nok_3_095_025
show:
in_header: false
name: Pris
type: line
curve: smooth
float_precision: 4
stroke_width: 1
opacity: 0.5
color: rgb(255,111,0)
data_generator: >
return entity.attributes.raw_today.map(p => [new Date(p.start), p.value])
.concat( entity.attributes.raw_tomorrow.map(p => [new Date(p.start),
p.value]))
- entity: sensor.nordpool_kwh_bergen_nok_3_095_025
show:
in_header: false
name: Snitt
type: line
curve: straight
float_precision: 4
stroke_width: 1
opacity: 0.4
color: red
data_generator: >
return [[start, entity.attributes.average*1.4],[end,
entity.attributes.average*1.4]];
- entity: sensor.nordpool_kwh_bergen_nok_3_095_025
show:
in_header: false
name: Snitt
type: line
curve: straight
float_precision: 4
stroke_width: 1
opacity: 0.4
color: gray
data_generator: >
return [[start, entity.attributes.average*0.6],[end,
entity.attributes.average*0.6]];
now:
show: true
graph_span: 2d
span:
start: day
locale: nb
apex_config:
chart:
height: 300px
zoom:
enabled: true
toolbar:
show: true
tools:
zoom: true
zoomin: false
zoomout: false
pan: false
reset: true
legend:
show: false
dataLabels:
enabled: false
xaxis:
type: datetime
labels:
datetimeFormatter:
month: ddd
day: ddd
yaxis:
forceNiceScale: false
min: 0