Skip to content

Instantly share code, notes, and snippets.

@diplix
Last active January 5, 2022 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diplix/ce1b47c8dacb0df22468fc63e7e54c2d to your computer and use it in GitHub Desktop.
Save diplix/ce1b47c8dacb0df22468fc63e7e54c2d to your computer and use it in GitHub Desktop.
works with apex-charts for home assistant: https://github.com/RomRider/apexcharts-card // dwd_weather custom component: https://github.com/FL550/dwd_weather // sensor.regenradar_dbz is a rest sensor, scraping data from https://morgenwirdes.de/
type: custom:apexcharts-card
experimental:
color_threshold: true
graph_span: 3d
update_interval: 1h
span:
start: day
offset: '-6h'
now:
show: true
color_list:
- red
- orange
- blue
- lightblue
yaxis:
- id: first
apex_config:
tickAmount: 4
decimalsInFloat: 0
min: '|-3|'
max: '|+3|'
- id: second
opposite: true
apex_config:
tickAmount: 4
min: 0
max: 100
show: false
- id: clouds
opposite: true
apex_config:
tickAmount: 4
reversed: true
min: 0
max: 100
show: false
- id: menge
opposite: true
apex_config:
tickAmount: 4
reversed: false
min: 0
max: 10
show: false
- id: wind
opposite: true
apex_config:
tickAmount: 4
reversed: false
min: 0
max: 130
show: false
- id: sonne
opposite: true
apex_config:
tickAmount: 4
reversed: true
min: 0
max: 3600
show: false
apex_config:
grid:
show: false
chart:
height: 300px
animations:
enabled: false
yaxis:
tickAmount: 6
tooltip:
enabled: true
x:
show: false
format: HH:MM
marker:
show: true
fixed:
enabled: true
position: topright
onDatasetHover:
highlightDataSeries: true
header:
title: 3 Tage-Vorhersage
show: true
show_states: true
colorize_states: true
series:
- entity: sensor.temperature_berlin_tegel
yaxis_id: first
name: DWD
curve: smooth
stroke_width: 2
type: line
color: red
extend_to_end: false
unit: °C
show:
in_header: false
legend_value: true
offset_in_name: false
group_by:
func: last
duration: 1h
- entity: sensor.temperatur_hof
curve: smooth
yaxis_id: first
stroke_width: 2
extend_to_end: false
name: Hof
color: magenta
show:
in_header: false
legend_value: true
group_by:
func: last
duration: 1h
- entity: sensor.sun_duration_berlin_tegel
yaxis_id: sonne
name: Sonne
curve: smooth
stroke_width: 0.1
type: area
color: '#ffff99'
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
group_by:
func: last
duration: 1h
- entity: sensor.sun_irradiance_berlin_tegel
yaxis_id: sonne
name: Sonnenstrahlung
curve: smooth
stroke_width: 0
type: area
color: '#ffff99'
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
group_by:
func: last
duration: 1h
- entity: sensor.cloud_coverage_berlin_tegel
yaxis_id: second
name: Wolken
curve: smooth
stroke_width: 0
type: area
color: '#333'
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
offset_in_name: false
group_by:
func: last
duration: 1h
- entity: sensor.fog_probability_berlin_tegel
yaxis_id: second
name: Nebel
curve: smooth
stroke_width: 0
type: area
color: '#778899'
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
offset_in_name: false
group_by:
func: last
duration: 1h
- entity: sensor.precipitation_probability_berlin_tegel
yaxis_id: second
name: Regen
curve: smooth
stroke_width: 0
type: area
color: blue
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
offset_in_name: false
group_by:
func: last
duration: 1h
- entity: sensor.precipitation_berlin_tegel
yaxis_id: menge
name: Regenmenge
curve: smooth
stroke_width: 0
type: area
color: aqua
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
offset_in_name: false
group_by:
func: last
duration: 1h
- entity: sensor.wind_speed_berlin_tegel
yaxis_id: wind
name: Wind
curve: smooth
stroke_width: 2
type: line
color: grey
extend_to_end: false
unit: ''
show:
in_header: false
legend_value: true
offset_in_name: false
group_by:
func: last
duration: 1h
- entity: sensor.sun_duration_berlin_tegel
yaxis_id: sonne
stroke_width: 0
name: Sonne
type: area
color: '#ffff99'
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
group_by:
func: sum
duration: 1h
- entity: sensor.sun_irradiance_berlin_tegel
yaxis_id: sonne
stroke_width: 0
name: Sonnestrahlung
type: area
color: '#ffff99'
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
group_by:
func: sum
duration: 1h
- entity: sensor.cloud_coverage_berlin_tegel
yaxis_id: second
stroke_width: 0
name: Wolken
type: area
color: '#333'
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
extremas: false
- entity: sensor.fog_probability_berlin_tegel
yaxis_id: second
stroke_width: 0
name: Nebel
type: area
color: '#778899'
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
extremas: false
- entity: sensor.temperature_berlin_tegel
yaxis_id: first
name: DWD
curve: smooth
stroke_width: 2
type: line
color: red
color_threshold:
- value: 0
color: '#c71585'
- value: 0
color: red
extend_to_end: false
unit: °C
show:
in_header: false
legend_value: false
offset_in_name: false
group_by:
func: last
duration: 1h
data_generator: |
return entity.attributes.data.map((entry) => {
return [new Date(entry.datetime).getTime(), entry.value];
});
- entity: sensor.precipitation_probability_berlin_tegel
yaxis_id: second
stroke_width: 0
name: Regen
type: area
color: blue
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
group_by:
func: sum
duration: 1h
- entity: sensor.precipitation_berlin_tegel
yaxis_id: menge
stroke_width: 0
name: Regenmenge
type: area
color: aqua
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
group_by:
func: sum
duration: 1h
- entity: sensor.regenradar_dbz
yaxis_id: menge
stroke_width: 0
name: Regenmenge Radar
unit: ''
type: area
color: white
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.timestamp*1000-0).getTime(), item.mm];
});
show:
in_header: false
legend_value: false
extremas: false
group_by:
func: sum
duration: 1h
- entity: sensor.wind_speed_berlin_tegel
yaxis_id: wind
stroke_width: 2
name: Wind
type: line
color: grey
data_generator: |
return entity.attributes.data.map(
(item) => {
return [new Date(item.datetime).getTime(), item.value];
});
show:
in_header: false
legend_value: false
group_by:
func: last
duration: 1h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment