OpenEnergyMonitor Community

kWh/d (realtime)


I’m trying to create a realtime kWh graph which accumulates on daily bases.

Power to kWh/d only create a Daily feed, but I want to see a growing graph according with kWh, then, on midnight it resets to 0.

Any idea?


1 Like

This is not possible “out of the box” but it can be done if you are willing to set up an input triggered from a cron job.

Feeds can be manipulated in multiple input process lists, if you are careful and clear about what you are doing.

Lets say you have an emonPi input “power1” for which you create a feed for called “daily_kwh_slope” that gets updated through a power to kwh process in power1’s processlist. So far very normal.

You then use an input api call like so (using your write apikey)


to create another input called “resets” in that inputs processing you can add a “log to feed” process and select your “daily_kwh_slope” feed.

You now have 2 inputs updating the same feed, the emonpi power1 input is regularly incrementing with power values and the “resets” input zeros it when ever it is called, now all you need is to call that api at midnight each day using a cron job, using either wget or curl.

One possible hurdle with this is phpfina (fixed interval) feeds, if you use phpfina, you will need so pretty complex timing to make sure the reset sticks, you are much better off using phptimeseries if you are attempting this and want an easier life.


Thanks for reply!!
I’m almost do it direct in database (create a job to reset it on DB - lol), you give me a better way :smiley:
I already have a node inputing data through api, I’ll try this way. :smiley:

Thanks again.

Thanks for the nice trick!

One small modification:
This gives me error: “:.contains no data via csv…”

Therefore it has to be:

Regards, Timo

Hmmm, mine worked with csv=0 using:
curl -s --data “node=resets&csv=0&apikey=$APIKEY” “


Thanks again, it really worked nice. Just need put it on cron at 00:00

Glad you both got it working, albeit slightly different results with the the CSV, I can’t explain offhand why that might be, I will take a look if I get a chance. But I suppose, strictly speaking, a single value cannot really be CSV (comma separated values) for it to be CSV I guess it should have at least two values and one comma.