abend
ist aus dem englisch sprachigen Forum , wohl von einem Österreicher gepostet , da ich aber dem ganzen nicht so mächtig bin kann mir vielleicht hier wer weite helfen
es werden 2 Karten erstellt , eine für den heutigen Preis und eine für den morgigen Preis
type: custom:apexcharts-card
graph_span: 24h
experimental:
color_threshold: true
header:
title: Energy price today
show: true
show_states: true
span:
start: day
now:
show: true
label: now
color: darkblue
series:
- entity: sensor.epex_spot_at_net_price
type: column
extend_to: end
unit: ct/kWh
float_precision: 3
yaxis_id: preis
show:
in_header: before_now
extremas: true
header_color_threshold: true
color_threshold:
- value: 2
color: 00ed01
- value: 4
color: 3af901
- value: 6
color: 87fa00
- value: 8
color: cefb02
- value: 10
color: eeff00
- value: 12
color: ffde1a
- value: 14
color: ffa700
- value: 16
color: ff8d00
- value: 18
color: ff7400
- value: 20
color: ff4d00
- value: 22
color: ff4d00
- value: 24
color: ff0000
- value: 26
color: e60000
- value: 28
color: cc0000
- value: 30
color: b30000
- value: 32
color: '990000'
- value: 34
color: '800000'
- value: 36
color: '660000'
- value: 38
color: 4d0000
- value: 40
color: '330000'
data_generator: |
return entity.attributes.data.map((entry) => {
return [new Date(entry.start_time), entry.price_ct_per_kwh];
});
group_by:
func: avg
duration: 1h
yaxis:
- id: preis
decimals: 0
apex_config:
title:
text: ct/kWh
tickAmount: 5
apex_config:
legend:
show: false
tooltip:
x:
show: true
format: HH:00 - HH:59
dann den für morgen
type: conditional
conditions:
- entity: sensor.display_card
state: 'True'
card:
type: custom:apexcharts-card
graph_span: 24h
header:
title: Energy price tomorrow
show: true
show_states: false
span:
start: day
offset: +1day
series:
- entity: sensor.epex_spot_at_net_price
type: column
extend_to: end
unit: ct/kWh
float_precision: 3
yaxis_id: preis
group_by:
func: avg
duration: 1h
color: grey
show:
in_header: before_now
extremas: true
data_generator: |
return entity.attributes.data.map((entry) => {
return [new Date(entry.start_time), entry.price_ct_per_kwh];
});
yaxis:
- id: preis
decimals: 0
apex_config:
title:
text: ct/kWh
tickAmount: 5
apex_config:
legend:
show: false
tooltip:
x:
show: true
format: HH:00 - HH:59
so und dann soll ein Helfer die 2 Karte erst sichbar machen wenn die Preise da sind , genau das versteh ich nicht wo das hinkommen soll bzw was da angepasst werden muss
The code to show the card from 14:00 to 23:00 look like this:
- platform: template
sensors:
display_card:
friendly_name: Display card between 14 and midnight.
entity_id: sensor.time
value_template: >
{% set ct = now().hour + now().minute/60 + now().second/3600 %}
{{ 14 <= ct <= 23 }}