I have the following API output:
[
{
"start": "2024-12-01T00:00:00.000+01:00",
"end": "2024-12-01T01:00:00.000+01:00",
"price": 0.3183,
"price_origin": "market"
},
{
"start": "2024-12-01T01:00:00.000+01:00",
"end": "2024-12-01T02:00:00.000+01:00",
"price": 0.3067,
"price_origin": "market"
},
{
"start": "2024-12-01T02:00:00.000+01:00",
"end": "2024-12-01T03:00:00.000+01:00",
"price": 0.3044,
"price_origin": "market"
}
]
Howto import the data into an sensor attribute data
?
Below is not working.
Please point me in the right direction.
rest:
#
# https://www.energyforecast.de/
#
#
# curl -X 'GET' \
# 'https://www.energyforecast.de/api/v1/predictions/next_96_hours?fixed_cost_cent=16.774&vat=19&token=api-token' \
# -H 'accept: application/json'
#
- resource: https://www.energyforecast.de/api/v1/predictions/next_96_hours?fixed_cost_cent=16.774&vat=19&token=api-token
method: GET
scan_interval: 60
sensor:
- unique_id: energyforecast
name: "Energyforecast Electricity spot price"
value_template: "{{ 1.0 }}"
json_attributes_path: "$"
json_attributes:
- data
unit_of_measurement: EUR
device_class: monetary
state_class: total
icon: mdi:cash