TIME ON: Home Assistant with Esp8266 (Tasmota) with Energy monitor module PZEM-004

Help wanted! :metal::crazy_face:

My setup includes Home Assistant with Esp8266 (Tasmota) with Energy monitor module PZEM-004 wich sends messages via MQTT to HA.
PZEM-004 is attached to wood pellets loader.

My Christmas wish is:

Measure time of loader Power time and then convert to consumption entity (kg/min).

Any ideas how to use existing Tasmota functions combined with HA power ?

Tnx!!

If you want to convert from one measurement unit to another, you can do it in the value_template:, but I don’t understand what kg/min is, so I’m not sure this is really what you want to do.

I would like to transfer data (weight/time) to HA with existing data of energy (kWh).
How can write a sensor.yaml to measure a time (only when energy is >0)?

What is the relationship between weight/time and kWh? Do you have a formula?

For now I have a temporary solution:

  • platform: template
    sensors:
    pellets_kg_today:
    value_template: “{{ ( states(‘sensor.power1_energy_today’)|float / 0.0077 ) | round(1)}}”
    unit_of_measurement: “kg”

Factor 0.0077 is calculated on power of pellets loader motor and measured load weight per minute.

But I would like to use better sensor template, defined with “time of loader energy, when is greater then 0 kWh”.
I think it’s possible, but I can’t find the right way.