Hello everyone.
I created a “platform: template” sensor that reads power in W from a custom made power board:
sensor:
- platform: template
sensors:
casa_eletricidade_potencia_solar:
friendly_name_template: Produção solar
unique_id: 3
icon_template: mdi:white-balance-sunny
value_template: >-
{% if (states('sensor.active_power_1')|int) < 40 %}
{{0}}
{% else %}
{{ (states('sensor.active_power_1')|int) }}
{% endif %}
unit_of_measurement: "W"
Then, I created a “platform: integration” sensor that integrates that power to calculate energy in kWh.
- platform: integration
name: casa_eletricidade_energia_solar
source: sensor.casa_eletricidade_potencia_solar
unit_prefix: k
round: 10
method: left
My problem is that there is no unit for this energy sensor, despite others sensors, created exactly in the same way, do have unit.
As the image shows, the problem also happens for other sensors.
What am I doing wrong?
Thank you very much in advance.