Hi,
I nearly spent all day trying to figure this out:
I got a mqtt sensor that pushes a value every 5 minutes.
All I want is a way to add these values up, until I set it to zero.
I tried many different approaches, Utility meter, etc.
My nearest approach is a Template sensor with this config:
- platform: template
sensors:
kwh_sumup:
friendly_name: "Sum kwH"
unit_of_measurement: 'kwH'
value_template: "{{ states('sensor.kwh_sumup') | float + states('sensor.FerrarisWheelspins') | float }}"
But my problem is: when the Sensor Value of the MQTT sensor gets a “5” the kwh_sumup template sensor adds the 5 two times and so on.
Does anyone have a suggestion?