Hi
I can currently get my energy usage from MQTT and show daily, weekly and monthly sensors for gas and electricity but they reset each new day/week/month. I’d like to be able to create a sensor that shows the last 30 days of usage. Does anyone have any ideas on how I could do this?
My current thinking is to have 31 entities, one for each day and just before the day resets update the relevant entity for the day. Then I can have one sensor that adds up all 31 entities. Does anyone else have any ideas?
Did you find a way to do this? I am looking to create something similar (in my case use of solar energy on rolling last 14 days)
I could see a “dumb method” with an automation every day at 23:59 to add day one and drop day 32, but that would mean a lot of coding for something so basic.
In the meantime, I’ll try if the statistics integration could work: