Open gerione opened 1 year ago
Sorry for the necro, but I also hope this can be made a standard sensor in this project (and other similar ones) so we can just plop it into the energy dashboard as-is so the cost tracking is working as expected.
So a solution for anyone also stumbling upon this:
I made my own template sensor in my HA configuration.yaml
that takes the value and just divides it by 100.
Maybe not the most efficient but it works:
template:
- sensor:
- name: "Awattar AT Price €/kWh"
unique_id: awattar_at_price_custom
unit_of_measurement: "€/kWh"
icon: "mdi:currency-eur"
state: >
{%- if states('sensor.awattar_at_price') != 'unavailable' %}
{%- set awattar_cent = states('sensor.awattar_at_price') | float %}
{%- set value = awattar_cent / 100 | float %}
{{ value }}
{%- else %}
{{ 0 }}
{%- endif #%}
With the ct/kWh price it leads to wrong calculations. I got 3,69 kWh and 47,68 € instead of 0,4768 €. Somehow ct/kWh is not recognised in Home Assistant. Maybe a second sensor with €/kWh would be good.