Yes, here is some code that does that and more. Every line that starts with " - type: markdown" is a new window with new info. Just change “sensor.nordpool” to your own one
type: vertical-stack
cards:
- type: markdown
alignment: justify
title: null
content: |-
Nu: {{ '%.2f' | format((state_attr('sensor.nordpool',
'current_price')|float / 0.05) | round() * 0.05) }}
Average: {{ '%.2f' | format((state_attr('sensor.nordpool',
'average')|float / 0.05) | round() * 0.05) }}
Median: {{ '%.2f' | format((state_attr('sensor.nordpool',
'mean')|float / 0.05) | round() * 0.05) }}
Max: {{ '%.2f' | format((state_attr('sensor.nordpool',
'max')|float / 0.05) | round() * 0.05) }}
Min: {{ '%.2f' | format((state_attr('sensor.nordpool',
'min')|float / 0.05) | round() * 0.05) }}
{% if (now().strftime('%T')) > '13:01:00' %}
Imorgon:
Average: {{state_attr('sensor.nordpool',
'tomorrow')|average|round(1)}}
Min: {{state_attr('sensor.nordpool',
'tomorrow')|min|round(1)}}
Max: {{state_attr('sensor.nordpool',
'tomorrow')|max|round(1)}}
{%- else %}
Elpriserna för imorgon är inte tillgängliga förrän kl.13
{% endif -%}
- type: markdown
alignment: justify
content: >-
{% set priceList = state_attr('sensor.nordpool', 'today')[00:23] %} {% set
dateList = state_attr('sensor.nordpool', 'raw_today')[00:23] %} {% set
minPrice = min(priceList) %} {% set minIndex = priceList.index(minPrice)
%} {% set minDateTimeStr= dateList[minIndex].start | string %} {% set
minDateTime= strptime(minDateTimeStr[0:19], '%Y-%m-%d %H:%M:%S') %}
Billigaste priset idag är {{ minPrice }} Öre/kWh och startar kl {{
minDateTime.hour }}:00
- type: markdown
alignment: justify
content: "{% set iterativesum = namespace(iter=[]) %}\n {% set lowestiter = namespace(kr=2) %}\n {% set timelowest = namespace(hr=2) %}\n {% set highestiter = namespace(kr=0) %}\n {% set timehighest = namespace(hr=0) %}\n {% set num_hours = 4 | int %}\n {% set nordpoolentity = 'sensor.nordpool' %}\n {% set timemapper = { \n 0: '00:00', 1 : '01:00', 2 : '02:00', 3 : '03:00',\n 4 : '04:00', 5 : '05:00', 6 : '06:00', 7 : '07:00',\n 8 : '08:00', 9 : '09:00', 10 : '10:00', 11 : '11:00',\n 12 : '12:00', 13 : '13:00', 14 : '14:00', 15 : '15:00',\n 16 : '16:00', 17 : '17:00', 18 : '18:00', 19 : '19:00',\n 20 : '20:00', 21 : '21:00', 22 : '22:00', 23 : '23:00',\n 24 : '00:00', 25 : '01:00', 26 : '02:00', 27 : '03:00',\n 28 : '04:00', 29 : '05:00', 30 : '06:00', 31 : '07:00',\n 32 : '08:00', 33 : '09:00', 34 : '10:00', 35 : '11:00',\n 36 : '12:00', 37 : '13:00', 38 : '14:00', 39 : '15:00',\n 40 : '16:00', 41 : '17:00', 42 : '18:00', 43 : '19:00',\n 44 : '20:00', 45 : '21:00', 46 : '22:00', 47 : '23:00',\n 48 : '0:00', } %}\n {% set prices = namespace(price=[]) %}\n {% set prices.price = prices.price + state_attr(nordpoolentity, 'today') %}\n {%- if state_attr(nordpoolentity,'tomorrow') | length == 1 -%}\n Morgondagens priser ej släppta\n {% else %}\n {% set prices.price = prices.price + state_attr(nordpoolentity,\t'tomorrow') %}\n {% endif %}\n {%- for n in range(prices.price|length -num_hours +1) -%}\n {%- set tempsum= namespace(temp=0) -%}\n {%- for i in range(num_hours) -%}\n {%- set tempsum.temp = tempsum.temp + prices.price[n+i] -%}\n {% endfor -%}\n {% set iterativesum.iter = iterativesum.iter + [tempsum.temp] -%}\n {% endfor -%}\n {% for iter in iterativesum.iter -%}\n {%- if loop.index > now().hour -%}\n {%- if iter < lowestiter.kr | float -%}\n {%- set lowestiter.kr = iter | float -%}\n {%- set timelowest.hr = loop.index -1 -%}\n {%- endif -%}\n {%- if iter > highestiter.kr | float -%}\n {%- set highestiter.kr = iter | float -%}\n {%- set timehighest.hr = loop.index -1 -%}\n {%- endif -%}\n {%- endif -%}\n {% endfor -%}\n De billigaste fyra ({{num_hours}}) timmarna startar {% if (timelowest.hr < 24) %}idag{% else %}imorgon{% endif %} kl {{timemapper[timelowest.hr]}}, då snittpriset är {{\"%.2f\"|format(lowestiter.kr/num_hours)}} Öre/kWh. "
- type: markdown
alignment: justify
content: "{% set iterativesum = namespace(iter=[]) %}\n {% set lowestiter = namespace(kr=2) %}\n {% set timelowest = namespace(hr=2) %}\n {% set highestiter = namespace(kr=0) %}\n {% set timehighest = namespace(hr=0) %}\n {% set num_hours = 4 | int %}\n {% set nordpoolentity = 'sensor.nordpool' %}\n {% set timemapper = { \n 0: '00:00', 1 : '01:00', 2 : '02:00', 3 : '03:00',\n 4 : '04:00', 5 : '05:00', 6 : '06:00', 7 : '07:00',\n 8 : '08:00', 9 : '09:00', 10 : '10:00', 11 : '11:00',\n 12 : '12:00', 13 : '13:00', 14 : '14:00', 15 : '15:00',\n 16 : '16:00', 17 : '17:00', 18 : '18:00', 19 : '19:00',\n 20 : '20:00', 21 : '21:00', 22 : '22:00', 23 : '23:00',\n 24 : '00:00', 25 : '01:00', 26 : '02:00', 27 : '03:00',\n 28 : '04:00', 29 : '05:00', 30 : '06:00', 31 : '07:00',\n 32 : '08:00', 33 : '09:00', 34 : '10:00', 35 : '11:00',\n 36 : '12:00', 37 : '13:00', 38 : '14:00', 39 : '15:00',\n 40 : '16:00', 41 : '17:00', 42 : '18:00', 43 : '19:00',\n 44 : '20:00', 45 : '21:00', 46 : '22:00', 47 : '23:00',\n 48 : '0:00', } %}\n {% set prices = namespace(price=[]) %}\n {% set prices.price = prices.price + state_attr(nordpoolentity, 'today') %}\n {%- if state_attr(nordpoolentity,'tomorrow') | length == 1 -%}\n Morgondagens priser ej släppta\n {% else %}\n {% set prices.price = prices.price + state_attr(nordpoolentity,\t'tomorrow') %}\n {% endif %}\n {%- for n in range(prices.price|length -num_hours +1) -%}\n {%- set tempsum= namespace(temp=0) -%}\n {%- for i in range(num_hours) -%}\n {%- set tempsum.temp = tempsum.temp + prices.price[n+i] -%}\n {% endfor -%}\n {% set iterativesum.iter = iterativesum.iter + [tempsum.temp] -%}\n {% endfor -%}\n {% for iter in iterativesum.iter -%}\n {%- if loop.index > now().hour -%}\n {%- if iter < lowestiter.kr | float -%}\n {%- set lowestiter.kr = iter | float -%}\n {%- set timelowest.hr = loop.index -1 -%}\n {%- endif -%}\n {%- if iter > highestiter.kr | float -%}\n {%- set highestiter.kr = iter | float -%}\n {%- set timehighest.hr = loop.index -1 -%}\n {%- endif -%}\n {%- endif -%}\n {% endfor -%}\n De dyraste fyra ({{num_hours}}) timmarna startar {% if (timehighest.hr < 24) %}idag{% else %}imorgon{% endif %} kl {{timemapper[timehighest.hr]}}, då snittpriset är {{\"%.2f\"|format(highestiter.kr/num_hours)}} Öre/kWh"
- type: markdown
alignment: justify
content: >-
{% set priceList = state_attr('sensor.nordpool', 'tomorrow')[00:23] %} {%
set dateList = state_attr('sensor.nordpool', 'raw_tomorrow')[00:23] %} {%
set minPrice = min(priceList) %} {% set minIndex =
priceList.index(minPrice) %} {% set minDateTimeStr=
dateList[minIndex].start | string %} {% set minDateTime =
strptime(minDateTimeStr[0:19], '%Y-%m-%d %H:%M:%S') %} Billigaste priset
imorgon är {{ minPrice }} Öre/kWh och startar kl {{ minDateTime.hour }}:00