Smartthings plug as energy meter

I know the ST outlet measures power but is there a custom device handler that can be used so it measures energy usage, if indeed it is actually capable of doing so?

You want to measure the power consumption for a period of time?

Yeah, I modified mine to sum up power x time into an energy meter. I can share it a bit later when I get to a PC.


UPDATE: I got to a Mac. LOL

Find it here:

It’s essentially keeping track of last power update time and value and on any new update, it times the time since last update with the last value and adds it to an energy attribute, assuming power did not change much since. It is not perfect, but better than nothing. Normally, energy metering should be performed within the device, for maximum precision…


Great work!… I’ve “planned” to do this exact tinkering for quite a while, but … well… it was just a good intention.


That’s perfect, thanks for this!!


Just a quick question, added this handler. What would i need to alter so it just showed consumption in Kwh instead of wh. Sorry for being pedantic!

Divide by 1000? The reason I used Wh is precision. Where it gets added to the energy, you need a / 1000.