Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jarkkosyrjala/8cfebd3ee4d8b8427fa0446760742760 to your computer and use it in GitHub Desktop.
Save jarkkosyrjala/8cfebd3ee4d8b8427fa0446760742760 to your computer and use it in GitHub Desktop.
Home Assistant Card Configuration displaying Today's and
type: custom:apexcharts-card
header:
show: true
title: ⚡️ Hinnat tänään ja huomenna
show_states: true
colorize_states: true
graph_span: 24h
all_series_config:
stroke_width: 2
type: column
transform: return x / 100;
unit: c/kWh
show:
legend_value: false
in_header: false
group_by:
duration: 1h
span:
start: day
experimental:
color_threshold: true
now:
show: true
color: red
series:
- entity: sensor.nordpool_kwh_fi_eur_3_095_024
name: Tänään
data_generator: |
const today = new Date();
today.setHours(0,0,0,0);
return entity.attributes.today.map((val, index) =>
[
new Date(today.getTime()+index*3600000).getTime(),
typeof val === "number" ? val*100 : 0
]
);
color_threshold:
- value: 0
color: '#80c6ff'
- value: 10
color: '#80ff60'
- value: 20
color: '#ffe600'
- value: 30
color: '#ff8000'
- value: 50
color: '#ff0000'
- value: 60
color: '#c60000'
- entity: sensor.nordpool_kwh_fi_eur_3_095_024
name: Huomenna
type: line
curve: stepline
data_generator: |
return entity.attributes.tomorrow.map((val, index) => {
const today = new Date()
today.setHours(0,0,0,0)
const value = typeof val === "number" ? val*100 : 0
return [new Date(today.getTime()+index*3600000).getTime(), value];
}) || [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment