-
-
Notifications
You must be signed in to change notification settings - Fork 29
Price sensor
Definition of Price sensor
In addition to supporting the price integration Nordpool, Energi Data Service and Entso-e, the integration can also read price information from a template sensor or any integration providing a sensor corresponding to the following format.
template:
- sensor:
- name: "my_price_sensor"
state: 123.45
attributes:
prices_today: >
[
{
"time": "2023-12-30 00:00:00+01:00",
"price": 120.00
},
{
"time": "2023-12-30 01:00:00+01:00",
"price": 121.00
},
...
{
"time": "2023-12-30 23:00:00+01:00",
"price": 143.00
}
]
prices_tomorrow: >
[
{
"time": "2023-12-31 00:00:00+01:00",
"price": 120.00
},
{
"time": "2023-12-31 01:00:00+01:00",
"price": 121.00
},
...
{
"time": "2023-12-31 23:00:00+01:00",
"price": 143.00
}
]
state
shall be a float
object.
prices_today
shall be an array
of time/price dictionary
. If there is no valid prices today, it shall be an empty array []
or None
. An array with 12 or fewer elements is considered to be invalid. The elements in the array shall be sorted by time, with the earliest element first, and only include prices for today.
prices_tomorrow
shall be an array
of time/price dictionary
. If there is no valid prices tomorrow, it shall be an empty array []
or None
. An array with 12 or fewer elements is considered to be invalid. The elements in the array shall be sorted by time, with the earliest element first, and only include prices for tomorrow.
The last element in the prices_today
array shall have a time that is earlier than the time of the first element in the prices_tomorrow
array.
The time
element in the time/price dictionary
shall be a str
object, and shall represent the local time and include time zone information.
The price
element in the time/price dictionary
shall be a float
object.
The current version of this integration only supports one price value per hour. Future versions will also support one price value per 15 minutes.
Also, it is highly recommented to set the configuration variables unique_id
, unit_of_measurement
, availability
, see this example.