Skip to content

Commit e463682

Browse files
committed
Dashboards: nordpool energy chart - use filtered plant sensors, update cost calc, fix graph span and formatting
- Switch to plant-filtered sensors for grid import and battery SOC - Replace simple cost template with expanded additional_cost_template - Add update_interval and correct graph_span calculation (divide by 4) - Normalize quoting and color string styles for consistency - Minor formatting tweaks (offset quoting, newline at EOF)
1 parent df8c960 commit e463682

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

Dashboards/nordpool_energy_chart/card_nordpool_energy_chart.yaml

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22
# Requires the custom:config-template-card, custom:apexcharts-card, custom:nordpool-card and custom:congif-template-card to be installed.
33

44
type: custom:config-template-card
5+
update_interval: 60s
56
variables:
6-
nordpool_sensor: '''sensor.nordpool'''
7-
grid_import_sensor: '''sensor.sigen_daily_grid_energy_import'''
8-
battery_soc_sensor: '''sensor.sigen_energy_storage_system_soc'''
9-
additional_cost_template: ''' *1 '''
7+
nordpool_sensor: "'sensor.nordpool'"
8+
grid_import_sensor: "'sensor.sigen_plant_filtered_daily_grid_import_energy'"
9+
battery_soc_sensor: "'sensor.sigen_plant_filtered_battery_charge'"
10+
additional_cost_template: "'*1.25 +(27.2 + 42.8 + 3.04 + 2.19 + 1.4) *1.25'"
1011
decimals_in_prices: 0
1112
decimals_in_energy: 1
1213
chart_price_cutoff_coerficient: 0.1
13-
price_y_axis_unit: '''öre'''
14-
energy_y_axis_unit: '''kWh'''
15-
price_overview_unit: '''öre/kWh'''
16-
chart_title: '''Electricity prices today'''
17-
total_purchease_price_text: '''Total purchease price'''
18-
grid_import_text: '''Grid Import today'''
19-
battery_soc_text: '''Battery charge'''
20-
lowest_price_text: '''Lowest future price'''
21-
highest_price_text: '''Highest future price'''
22-
price_now_text: '''Current price'''
23-
now_text: ''''''
14+
price_y_axis_unit: "'öre'"
15+
energy_y_axis_unit: "'kWh'"
16+
price_overview_unit: "'öre/kWh'"
17+
chart_title: "'Electricity prices today'"
18+
total_purchease_price_text: "'Total purchease price'"
19+
grid_import_text: "'Grid Import today'"
20+
battery_soc_text: "'Battery charge'"
21+
lowest_price_text: "'Lowest future price'"
22+
highest_price_text: "'Highest future price'"
23+
price_now_text: "'Current price'"
24+
now_text: "''"
2425
get_chart_cutoff: |
2526
(_min_price, _max_price, _coefficient) => {
2627
if (_min_price <= 0) {
@@ -76,8 +77,8 @@ entities:
7677
card:
7778
type: custom:apexcharts-card
7879
graph_span: >-
79-
${ states[nordpool_sensor].attributes.raw_today.length +
80-
states[nordpool_sensor].attributes.raw_tomorrow.length + 'h' }
80+
${ (states[nordpool_sensor].attributes.raw_today.length +
81+
states[nordpool_sensor].attributes.raw_tomorrow.length) / 4 + 'h' }
8182
yaxis:
8283
- id: y-price
8384
min: >-
@@ -140,7 +141,7 @@ card:
140141
- entity: ${nordpool_sensor}
141142
yaxis_id: y-price
142143
name: ${total_purchease_price_text}
143-
offset: '-30min'
144+
offset: "-30min"
144145
float_precision: ${decimals_in_prices}
145146
show:
146147
extremas: false
@@ -149,29 +150,29 @@ card:
149150
data_generator: ${get_total_prices(additional_cost_template)}
150151
color_threshold:
151152
- value: -1000
152-
color: '#00f738'
153+
color: "#00f738"
153154
- value: >-
154155
${get_low_bottom_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
155156
get_total_max_nordpool_price(nordpool_sensor,additional_cost_template)
156157
)}
157-
color: '#12A141'
158+
color: "#12A141"
158159
- value: >-
159160
${get_low_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
160161
get_total_max_nordpool_price(nordpool_sensor,additional_cost_template))}
161-
color: '#F3DC0C'
162+
color: "#F3DC0C"
162163
- value: >-
163164
${get_high_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
164165
get_total_max_nordpool_price(nordpool_sensor,
165166
additional_cost_template))}
166-
color: '#E76821'
167+
color: "#E76821"
167168
- value: >-
168169
${get_high_top_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
169170
get_total_max_nordpool_price(nordpool_sensor,additional_cost_template))}
170-
color: '#DC182F'
171+
color: "#DC182F"
171172
- entity: ${grid_import_sensor}
172173
yaxis_id: y-energy
173174
name: Grid import Chart
174-
color: '#FF4646'
175+
color: "#FF4646"
175176
curve: stepline
176177
float_precision: ${decimals_in_energy}
177178
show:
@@ -187,7 +188,7 @@ card:
187188
duration: 1h
188189
- entity: ${grid_import_sensor}
189190
name: ${grid_import_text}
190-
color: '#FF4646'
191+
color: "#FF4646"
191192
float_precision: ${decimals_in_energy}
192193
show:
193194
in_chart: false
@@ -196,7 +197,7 @@ card:
196197
- entity: ${battery_soc_sensor}
197198
yaxis_id: y-SOC
198199
name: ${battery_soc_text}
199-
color: '#7a50d9'
200+
color: "#7a50d9"
200201
float_precision: 0
201202
show:
202203
extremas: false
@@ -210,7 +211,7 @@ card:
210211
func: avg
211212
duration: 1h
212213
- entity: ${nordpool_sensor}
213-
color: '#7bff00'
214+
color: "#7bff00"
214215
float_precision: ${decimals_in_prices}
215216
name: ${lowest_price_text}
216217
unit: ${price_overview_unit}
@@ -233,27 +234,27 @@ card:
233234
data_generator: ${get_future_total_prices(additional_cost_template)}
234235
color_threshold:
235236
- value: -1000
236-
color: '#00f738'
237+
color: "#00f738"
237238
- value: >-
238239
${get_low_bottom_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
239240
get_total_max_nordpool_price(nordpool_sensor,additional_cost_template)
240241
)}
241-
color: '#12A141'
242+
color: "#12A141"
242243
- value: >-
243244
${get_low_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
244245
get_total_max_nordpool_price(nordpool_sensor,additional_cost_template))}
245-
color: '#F3DC0C'
246+
color: "#F3DC0C"
246247
- value: >-
247248
${get_high_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
248249
get_total_max_nordpool_price(nordpool_sensor,
249250
additional_cost_template))}
250-
color: '#E76821'
251+
color: "#E76821"
251252
- value: >-
252253
${get_high_top_threshold_nordpool_price(get_total_min_nordpool_price(nordpool_sensor,additional_cost_template),
253254
get_total_max_nordpool_price(nordpool_sensor,additional_cost_template))}
254-
color: '#DC182F'
255+
color: "#DC182F"
255256
- entity: ${nordpool_sensor}
256-
color: '#DC182F'
257+
color: "#DC182F"
257258
float_precision: ${decimals_in_prices}
258259
name: ${highest_price_text}
259260
unit: ${price_overview_unit}
@@ -265,4 +266,4 @@ card:
265266
duration: 2d
266267
data_generator: ${get_future_total_prices(additional_cost_template)}
267268
layout_options:
268-
grid_columns: full
269+
grid_columns: full

0 commit comments

Comments
 (0)