Tälleen nuo näytti tulleen, lisää spot-price pakettiin SHF Electricity price now alleOlisiko Temez iso rypistys lisätä "SHF Electricity price now":lle atribuutteihin vielä nämä ?
Today min notax
Today avg notax
Today max notax
Tomorrow min notax
Tomorrow avg notax
Tomorrow max notax
En kyllä onnistunut ottamaan tuosta perus sensoristakaan PriceNoTax arvoa.
No puolen vuoden tauon jälkeen vähän kesäterässä. Taitaa vaatia data atribuuttia ja jotain koodia, joka parsii sen siitä.![]()
YAML:
- sensor:
- name: SHF Electricity price now NoTax
unique_id: shf_electricity_price_now_no_tax
unit_of_measurement: "€/kWh"
device_class: monetary
state: '{{ state_attr("sensor.shf_electricity_price", "data")[states("sensor.shf_idx")|int+now().hour]["PriceNoTax"] }}'
attributes:
today_prices_notax: '{{ (state_attr("sensor.shf_electricity_price", "data"))[states("sensor.shf_idx")|int:states("sensor.shf_idx")|int+24] | map(attribute="PriceNoTax") | list }}'
tomorrow_prices_notax: '{{ (state_attr("sensor.shf_electricity_price", "data"))[states("sensor.shf_idx")|int+24:] | map(attribute="PriceNoTax") | list }}'
today_min_notax: '{{ state_attr("sensor.shf_electricity_price_now", "today_prices") | min }}'
today_avg_notax: '{{ state_attr("sensor.shf_electricity_price_now", "today_prices") | average | round(4) }}'
today_max_notax: '{{ state_attr("sensor.shf_electricity_price_now", "today_prices") | max }}'
tomorrow_min_notax: '{{ state_attr("sensor.shf_electricity_price_now", "tomorrow_prices") | min | default("unknown") }}'
tomorrow_avg_notax: '{{ state_attr("sensor.shf_electricity_price_now", "tomorrow_prices") | average("unknown") }}'
tomorrow_max_notax: '{{ state_attr("sensor.shf_electricity_price_now", "tomorrow_prices") | max | default("unknown") }}'