Frank Energie - jonasbkarlsson/ev_smart_charging GitHub Wiki
To use the Frank Energie integration, the following template sensor can be used to create the price input.
template:
- sensor:
- name: "frank_energy_generic_pricing_format"
state: >
{{ states('sensor.current_electricity_price_all_in') }}
attributes:
prices_today: >
{% set prices = state_attr('sensor.current_electricity_price_all_in', 'prices') or [] %}
[
{% for item in prices if as_local(item.from | as_datetime).date() == now().date() %}
{
"time": "{{ item.from | as_local }}",
"price": {{ item.price }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
prices_tomorrow: >
{% set prices = state_attr('sensor.current_electricity_price_all_in', 'prices') or [] %}
[
{% for item in prices if as_local(item.from | as_datetime).date() == (now() + timedelta(days=1)).date() %}
{
"time": "{{ item.from | as_local }}",
"price": {{ item.price }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]