Correct way to calculate historical data

i’m new at homeassistant and at the moment i am migrating all my stuff from openhab to home assistant.But i have some Problems with some function. I have no idea how to implement it. for example i’m using a HM-ES-TX-WM for my powermeter. this device is continuous sending an increasing number. i’m pushing this values to a influxdb.
Now i would calculate how much kWh consumption i have today (00:00 > now) or yesterday or this week.

How can i calculate this values to an item?
in openhab i’m using rules for this tasks

1 Like

Have a look at how I did this for a rain sensor.

Sounds the same issue - continuous running total … you want to see over a time interval (like since midnight)

Hope this helps

Phil

1 Like

this sounds interesting. i give this hack a try this evening.

Thanks a lot.

1 Like