Measure time for how long an outlet stays above 300 watts

Hi everyone,
I have been a happy user of Home Assistant for two years. I admit that I never learned, however, how to construct formulas in templates.

I want to measure how many cubic meters my GAS boiler uses. I don’t have a gas meter but would like to estimate it in another way. I know how many cubic meters of gas my boiler uses for one hour of ignition. My boiler is connected to an outlet, how much she is on I have consumption greater at 80w.

What I want to do is a sensor that counts me in hours or minutes for how long the boiler has been over 80w in a month. Let me explain better with an example:
Day 1 – HOURS: 08:00 → Boiler consumption >80watt until 08:10
Day 1 – HOURS 08:10 → Boiler consumption <80watts until 12:30 pm
Day 1 – 12:30 p.m. → Boiler consumption >80 watts until 1:00 p.m.

Day 2 – 3:00 p.m. → Boiler consumption >80watts until 3:45 p.m.

My sensor I want to create should add up the minutes in a month for which the boiler is >80 watts. In this example above it is for 85 minutes.

How can I create this sensor that measures my time for as long as the plug has consumption greater than 80 watts?

Thank you