Reset KWH aeonlabs HEM

Hello,

No question here but a solution. I was looking for the solution to reset the KWH accumulated by my HEM2 in order to sync with my electricity bill.
It took me a while to find. It is of course super trivial :slight_smile:

Here is the code:

-- This scene reset the KWH to 0
-- once reset, no way back!

local meterID = 12
local kwh = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", meterID)

luup.call_action("urn:micasaverde-com:serviceId:EnergyMetering1", "ResetKWH", {}, meterID)

Just replace the 12 by the right value for your main HEM device.

I hope it helps a few. If so, drop a note here :slight_smile:

very good to reset the kWh on HEM beginning of bill cycle - thanks.
Viorel

This is very good.
I have put this in place following my bill cycle. but noticed as it reset the sum kWh to 0, there is no way i know what the last kWh amount i have used.

wonder what approach you all used to get this?

Does anyone know how to set the KWh number to sync HEM with my main counter?
Tried setting this value in Advanced tab but it resets it to its own number after couple of secs.