Hello,
i measure the electric power surplus with this template code
- name: ueberschuss
unique_id: TEST1000
device_class: power
state_class: measurement
unit_of_measurement: W
state: >
{% if states("sensor.tasmota_sm_16_7_0")|float > 0 %}
0
{% else %}
{{ states('sensor.tasmota_sm_16_7_0') | float * (-1) }}
{% endif %}
after this i divided it by 1000 to get the unit kW with this code
- name: ueberschuss_kW
state: "{{ states('sensor.ueberschuss') | float / 1000 }}"
unique_id: TEST55
device_class: power
state_class: measurement
unit_of_measurement: kW
and finally i integrate the result with this code to get the energy
- platform: integration
name: ueberschuss_kW_int
source: sensor.ueberschuss_kW
unique_id: TEST999
The results are stored i a counter of all time and for days. I thought it works but i noticed something strange yesterday.
I looked at the load curve and on the integration, a little after 9:00 the integration jumps from 0 to over 1,5 kWh from a little amount of electric power surplus.
Did i anything wrong with my sensors or is this a bug ?
Best regards
Kai