I do have an efergy sensor which is not working, every time it restarts the sensor switches the daily with monthly value making it unusable.
Beside fixing the efergy component, I wish to unsderstand how to calculate a weekly/monthly energy consuption having a daily value sensor.
The sensor each day at 2am starts again from zero and starts accumulatew the energy consumption value for the day, then again at 2am goes back to zero.
Wish to know how to “accumulate” the daily value to have a sensor, or something showing a weekly, biweekly, (weekdays, weekends) monthly value
You can have a look an EmonPI (send W data from the individual sensors to EmonPI, then get back accumulated kwh data as other sensors).
As an alternative, here is my WIP project Basically I’ve set sensors for daily, weekly, monthly and yearly which are adding the current values to previous balances which are actualized at 30 seconds. I’ve then setup an automation that renews the monthly figures. There is still a lot of work to be done (not difficult but I got lazy after setting the new month automation) such as to create automation for starting a new day, new week, new year, etc. create an easy to use mechanism to link current existing sensors to the mqtt ones; split the sensors between real time reporting sensors (measured through wall power switches) and nominal consumption sensors (such as the ones from the light bulbs for which it doesn’t make sense to have an actual counter), etc.
You could build an automation that triggers when the sensor value is set to 0 (zero). And store the previous value (which will be the day total) in a template sensor. If you record long enough history, you could use some statistical sensor to compute totals.