Hello,
I have a template sensor from which I derive derivative sensor.
- platform: template
sensors:
zaehler_strom:
friendly_name: "Stromzähler"
unit_of_measurement: "kWh"
value_template: "{{ (28803.0 + (states('sensor.roh_strom')|float - 28164453.0) / 1000.0 ) | round(3) }}"
- platform: derivative
source: sensor.zaehler_strom
name: "Stromverbrauch"
unit_time: "h"
unit_prefix: "m"
unit: "W"
round: 0
During each restart there is a small timeframe when the template sensor gives unreasonable states bc it is not initialized. After initialization, it has a valid range. This initialization creates a huge “change” of the template sensor, thus giving a big spike in the derivative sensor which annoys me.
Can this be avoided somehow?
Regards
Ralf