Hello,
Everyday after 13.00 the data from Nordpool is updated. I can find the median value for today and tomorrow using this code, but I would like to calculate the median from 13.00 today until 13.00 tomorrow.
erty_development:
friendly_name: erty
unit_of_measurement: "kr/kWh"
value_template: >
{%- set today=states.sensor.el_spotpris.attributes.raw_today| sort(attribute='value') -%}
{%- set median= (today[11].value+today[12].value)/2 -%}
{{ median }}
I would like to combine today nordpool attributes from 13.00 untill tomorrows at 13.00 then sort them to find the median.
I’m using this to optimize how I run my heat pump during night and day.