Strompreise zu sehen und den Benzinpreis im Blick zu behalten, war das Ziel einer kleinen Fingerübung mit HomeAssistant.
Das Theme ist https://community.home-assistant.io/t/graphite-theme/796390
Benzinpreis
Ich habe zwei Datenquellen. Für die Benzinpreise ist das „Tankerkoenig“ https://www.home-assistant.io/integrations/tankerkoenig/ welches seine Daten aus https://www.tankerkoenig.de bezieht. Für die API muss man sich lediglich mit einer E-Mail Adresse registrieren.
Ich habe mir einfach drei zufällige Tankstellen in Freiburg ausgesucht und als Sensoren angelegt. Von denen beziehe ich die Daten für Diesel, Super und Super E10. Ob das repräsentative Daten sind, weiß ich nicht, sicherlich könnte man auch im Hintergrund mehrere Sensordaten zu einem Durchschnitt verarbeiten – wenn jemand ein Beispiel dafür hat, gerne melden.
Die Daten fließen einmal die bereits im HomeAssistant enthaltene „Statistikdiagramm“ Karte.
Wenn die Tanke zu ist, fließen auch keine Daten. Ich bin mal gespannt wie sich hier Preise über den Tag entwickeln – dazu gibt es sicher auch schon Daten.
Im Code sieht das so aus:
chart_type: line
period: hour
type: statistics-graph
entities:
– sensor.aral_engesserstrasse_13_super
– sensor.esso_sundgauallee_25_diesel
– >-
sensor.freie_tankstelle_union_tankhof_heinrich_von_stephan_str_10_12_super_e10
stat_types:
– mean
title: Benzin Preise
days_to_show: 30
Hier sollen sich die Daten der letzten 30 Tage sammeln, dann würde es genauso aussehen wie die Strompreise.
Die zweite Anzeige ist, die so aussieht wie eine Tankstellenanzeige – ich wollte ursprünglich die ganze Seite so aussehn lassen, als ob es das Foto einer Tanke wäre – nennt sich „Andy Segment Displaycard Card“: https://github.com/maglerod/andy-segment-display-card
Die habe ich so konfiguriert, das es den Dot-matrix mode verwendet. Nun kann man zwei Größen haben. Setzt man „Size (px)“ auf 0 so wie vorgegeben, dann sind die Anzeigen recht groß.
Setzt man sie auf 1, dann sind sie kleiner.
Das finde ich sieht besser aus.
Das ganze als html:
type: custom:andy-segment-display-card
render_style: matrix
size_px: 1
italic: false
center_text: false
fixed_segments_animations: true
show_title: true
title_inline: false
title_reserve_px: 0
background_color: „#232323“
text_color: „#FF9300“
title_color: „#FF9300“
matrix_dot_off_color: „#000000“
matrix_dot_on_color: „“
show_unused: false
unused_color: „#2A2F2C“
max_chars: 11
char_gap_px: 5
color_intervals: []
matrix_cols: 5
matrix_rows: 7
matrix_gap: 2
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.aral_engesserstrasse_13_diesel
title: Diesel (Aral Engesserstraße)
title_icon: mdi:gas-station
title_icon_align: left
title_icon_gap: 6
title_text_color: „“
title_icon_color: „“
decimals: null
auto_decimals: null
leading_zero: false
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
rows:
– slides:
– animate_single: false
timer_mode: remaining
entity: sensor.aral_engesserstrasse_13_diesel
title: Diesel (Aral Engesserstraße)
title_icon: mdi:gas-station
title_icon_align: left
title_icon_gap: 6
title_text_color: „“
title_icon_color: „“
decimals: null
auto_decimals: null
leading_zero: false
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
is_default: true
– is_default: false
slides:
– animate_single: false
timer_mode: remaining
entity: >-
sensor.freie_tankstelle_union_tankhof_heinrich_von_stephan_str_10_12_super_e10
title: Super E10 (Union Tankhof Heinrich von Stephan)
title_icon: mdi:gas-station
title_icon_align: left
title_icon_gap: 6
title_text_color: „“
title_icon_color: „“
decimals: null
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
– is_default: false
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.bft_rankackerweg_2_super
title: Super (BFT Rankackerweg)
title_icon: mdi:fuel
title_icon_align: left
title_icon_gap: 6
title_text_color: „“
title_icon_color: „“
decimals: null
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
Strompreise
Für die Strompreise habe ich unterschiedliche Quellen:
Für die habe ich mir auch so ein schönes Dot-Matrix Display eingerichtet und auch Statistik Displays. Es kann sein, dass die am Anfang noch nicht voll sind, weil die Daten erst eingelesen werden müssen.
Was könnte man jetzt noch machen? Daten von der Terminbörse einfügen um so die dortigen Preise für Gas und Rohöl einfließen zu lassen. Gibt es irgendeine Möglichkeit das zu tun? Etwa in dem man den Preis einer Aktie oder Comodity als Sensor definiert.
Übersicht als yml
views:
– type: sections
max_columns: 4
title: Energiepreise
path: energiepreise
icon: mdi:barrel-outline
theme: Graphite
dense_section_placement: true
background:
opacity: 30
alignment: center
size: cover
repeat: repeat
attachment: fixed
sections:
– type: grid
cards:
– type: heading
heading: Strompreise
heading_style: title
icon: mdi:lightning-bolt-circle
– type: custom:andy-segment-display-card
render_style: matrix
size_px: 1
italic: false
center_text: false
fixed_segments_animations: true
show_title: true
title_inline: false
title_reserve_px: 0
background_color: ‚#000000‘
text_color: ‚#00F900‘
title_color: ‚#FFFFFF‘
matrix_dot_off_color: ‚#221B1B‘
matrix_dot_on_color: “
show_unused: true
unused_color: ‚#7A7A7A‘
max_chars: 14
char_gap_px: 6
color_intervals: []
matrix_cols: 5
matrix_rows: 7
matrix_gap: 2
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.green_planet_energy_aktueller_preis
title: €/kWh Endkundenpreis Green Planet Energy
title_icon: mdi:meter-gas
title_icon_align: left
title_icon_gap: 6
title_text_color: “
title_icon_color: “
decimals: null
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
rows:
– slides:
– animate_single: false
timer_mode: remaining
entity: sensor.green_planet_energy_aktueller_preis
title: €/kWh Endkundenpreis Green Planet Energy
title_icon: mdi:meter-gas
title_icon_align: left
title_icon_gap: 6
title_text_color: “
title_icon_color: “
decimals: null
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
is_default: true
– type: custom:andy-segment-display-card
render_style: matrix
size_px: 14
italic: false
center_text: false
fixed_segments_animations: true
show_title: true
title_inline: true
title_reserve_px: -1
background_color: ‚#0B0F0C‘
text_color: ‚#FF40FF‘
title_color: ‚#FF40FF‘
matrix_dot_off_color: ‚#221B1B‘
matrix_dot_on_color: “
show_unused: false
unused_color: ‚#232323‘
max_chars: 11
char_gap_px: 6
color_intervals: []
matrix_cols: 5
matrix_rows: 7
matrix_gap: 2
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.nord_pool_ger_aktueller_preis
title: EUR/kWh DE
title_icon: mdi:transmission-tower
title_icon_align: left
title_icon_gap: 6
title_text_color: ‚#ffffff‘
title_icon_color: ‚#ffffff‘
decimals: 4
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
rows:
– slides:
– animate_single: false
timer_mode: remaining
entity: sensor.nord_pool_ger_aktueller_preis
title: EUR/kWh DE
title_icon: mdi:transmission-tower
title_icon_align: left
title_icon_gap: 6
title_text_color: ‚#ffffff‘
title_icon_color: ‚#ffffff‘
decimals: 4
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
is_default: true
– is_default: false
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.electricity_maps_co2_intensitat
title: CO2 gCO?eq/kWh
title_icon: mdi:molecule-co2
title_icon_align: left
title_icon_gap: 6
title_text_color: ‚#ffffff‘
title_icon_color: ‚#ffffff‘
decimals: 0
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
– is_default: false
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.electricity_maps_anteil_fossiler_energietrager
title: CO2 Intensität in %
title_icon: mdi:gas-burner
title_icon_align: left
title_icon_gap: 6
title_text_color: ‚#ffffff‘
title_icon_color: ‚#ffffff‘
decimals: null
auto_decimals: 0
leading_zero: false
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
– chart_type: line
period: hour
type: statistics-graph
entities:
– sensor.nord_pool_ger_aktueller_preis
stat_types:
– mean
title: Aktueller Großhandelspreis Strom
logarithmic_scale: false
– type: history-graph
entities:
– entity: sensor.green_planet_energy_aktueller_preis
– entity: sensor.nord_pool_ger_aktueller_preis
title: Strompreis über Tag
hours_to_show: 48
– type: grid
cards:
– type: heading
heading: Ölpreise
heading_style: title
icon: mdi:barrel
– type: custom:andy-segment-display-card
render_style: matrix
size_px: 1
italic: false
center_text: false
fixed_segments_animations: true
show_title: true
title_inline: false
title_reserve_px: 0
background_color: ‚#232323‘
text_color: ‚#FF9300‘
title_color: ‚#FF9300‘
matrix_dot_off_color: ‚#000000‘
matrix_dot_on_color: “
show_unused: false
unused_color: ‚#2A2F2C‘
max_chars: 11
char_gap_px: 5
color_intervals: []
matrix_cols: 5
matrix_rows: 7
matrix_gap: 2
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.aral_engesserstrasse_13_diesel
title: Diesel (Aral Engesserstraße)
title_icon: mdi:gas-station
title_icon_align: left
title_icon_gap: 6
title_text_color: “
title_icon_color: “
decimals: null
auto_decimals: null
leading_zero: false
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
rows:
– slides:
– animate_single: false
timer_mode: remaining
entity: sensor.aral_engesserstrasse_13_diesel
title: Diesel (Aral Engesserstraße)
title_icon: mdi:gas-station
title_icon_align: left
title_icon_gap: 6
title_text_color: “
title_icon_color: “
decimals: null
auto_decimals: null
leading_zero: false
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
is_default: true
– is_default: false
slides:
– animate_single: false
timer_mode: remaining
entity: >-
sensor.freie_tankstelle_union_tankhof_heinrich_von_stephan_str_10_12_super_e10
title: Super E10 (Union Tankhof Heinrich von Stephan)
title_icon: mdi:gas-station
title_icon_align: left
title_icon_gap: 6
title_text_color: “
title_icon_color: “
decimals: null
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
– is_default: false
slides:
– animate_single: false
timer_mode: remaining
entity: sensor.bft_rankackerweg_2_super
title: Super (BFT Rankackerweg)
title_icon: mdi:fuel
title_icon_align: left
title_icon_gap: 6
title_text_color: “
title_icon_color: “
decimals: null
auto_decimals: null
leading_zero: true
show_unit: false
color_intervals: []
value_template:
matrix_progress: false
progress_min: 0
progress_max: 100
progress_color_mode: active
stay_s: 3
out_s: 0.5
in_s: 0.5
fade: true
show_style: run_left
hide_style: run_right
hide_prev_first: true
– chart_type: line
period: hour
type: statistics-graph
entities:
– sensor.aral_engesserstrasse_13_super
– sensor.esso_sundgauallee_25_diesel
– >-
sensor.freie_tankstelle_union_tankhof_heinrich_von_stephan_str_10_12_super_e10
stat_types:
– mean
title: Benzin Preise
days_to_show: 30
– cards:
– type: heading
heading_style: title
heading: Energiepreis Entwicklung Monitor
icon: mdi:chart-areaspline
– title: Verlauf
type: history-graph
hours_to_show: 721
entities:
– sensor.aral_engesserstrasse_13_super
– sensor.esso_sundgauallee_25_diesel
– >-
sensor.freie_tankstelle_union_tankhof_heinrich_von_stephan_str_10_12_super_e10
– sensor.green_planet_energy_aktueller_preis
– sensor.nord_pool_ger_aktueller_preis
header:
card:
type: markdown
content: |-
# Energiepreise
Übersicht über Benzin-, Diesel- und Strompreise.
layout: responsive
badges_position: bottom
badges_wrap: wrap
cards: []
Gefällt mir: Gefällt mir Wird geladen …
Ähnliche Beiträge
Du muss angemeldet sein, um einen Kommentar zu veröffentlichen.