I wish to add a new sensor, that has the current spot price and the raw_today and raw_tomorrow data so it can be read by predbat.
Is something this complex possible with a template?
AI claims it can be done with a sensor.yaml file, but with no sucess.
"2025-07-01T00:00:00+02:00": 6.2239578
"2025-07-01T01:00:00+02:00": 5.8034949000000005
...
unit_of_measurement: Kč/kWh
icon: mdi:cash-minus
friendly_name: Current Buy Electricity Price```
```New sensor structure sensor.nordpool_kwh_dk1_eur_3_10_025:
state_class: total
average: 0.172875
off_peak_1: 0.1255
off_peak_2: 0.40049999999999997
peak: 0.12858333333333333
min: 0.053
max: 0.595
mean: 0.12
unit: kWh
currency: EUR
country: Denmark
region: DK1
low_price: true
price_percent_to_average: 0.6073752711496746
today:
- 0.139
- 0.119
- 0.111
- 0.11
- 0.113
- 0.121
- 0.141
- 0.15
- 0.143
- 0.114
- 0.105
- 0.087
- 0.056
- 0.053
- 0.072
- 0.098
- 0.113
- 0.128
- 0.19
- 0.384
- 0.595
- 0.509
- 0.313
- 0.185
tomorrow: []
tomorrow_valid: false
raw_today:
- start: "2025-07-01T00:00:00+02:00"
end: "2025-07-01T01:00:00+02:00"
value: 0.139
- start: "2025-07-01T01:00:00+02:00"
end: "2025-07-01T02:00:00+02:00"
value: 0.119
...
raw_tomorrow: []
current_price: 0.105
additional_costs_current_hour: 0
price_in_cents: false
unit_of_measurement: EUR/kWh
device_class: monetary
icon: mdi:flash
friendly_name: nordpool_kwh_dk1_eur_3_10_025```
Full sensor files:
https://gist.github.com/ziat007/286999e2d0ccd3dd4360756176419578
Predbat data reader script:
https://gist.github.com/ziat007/35d7e1ebe9db26d6b27019b0d4e57a50