How to Reset Energy Usage and Runtime on TP-Link Kasa Smart Plugs (KP115/HS110)

20221212: Tapo Users, update from reader Roman below: The Tapo app on Android now has a software/firmware update that lets you reset the energy consumption from the app. Hopefully, iOS is the same.

20220914: Note: If you have an Apple device, you no longer have to use my laborious procedure documented below. The Watt for Smart Devices app can reset the energy and usage stats of both Kasa and Tapo devices.

WARNING: This method DOES NOT work the Tapo devices. They use an entirely different API. I wrote some code to try sending reset_energy_usage to a Tapo plug, but it rejected the command. If anyone knows the command to reset the energy usage of a Tapo, please leave a message below. Also, I might be able to find the correct command if someone can send me a firmware file for a Tapo plug with energy monitoring.

I recently acquired a few TP-Link Kasa KP115 smart plugs with energy metering. It was a bit disappointing to find that they barely show any data. There are no graphs, no voltage or current, just instantaneous power and summary energy stats and runtime:

I wanted to find the daily energy consumption of various appliances, so I needed a way to reset the energy counter to zero. Believe it or not, TP-Link doesn’t provide a way to reset the energy. TP-Link support says that you have to delete the plug from Kasa, factory reset, and then add it back to Kasa.

The most ridiculous part is, the smart plugs actually have a command to reset the energy without resetting the whole device! They’re just too lazy to add it to their app!

I found a github repo with a list of the commands available in the TP-Link protocol. It turns out that there’s a command to reset the energy monitor!

Erase All EMeter Statistics
{"emeter":{"erase_emeter_stat":null}}

The repo contains a Python3 script that can query the energy stats, but it doesn’t have an option to send the emeter reset command. Fortunately, it has a command line option to send an arbitrary JSON command to the plug. I tried sending the above to my KP115, and the energy meter was instantly reset to 0!

# python3 ./tplink-smartplug.py -t <ipaddr> -j {\"emeter\":{\"erase_emeter_stat\":{}}}

Although I don’t have one, the same command should also work on the older HS110 smart plug.

For your convenience, I have forked the github repo, and added a command to reset the emeter, so you don’t have to type the ugly JSON command.

Here’s how to reset your energy meter:

  1. Download and install Python 3.x: Python Downloads
  2. Download tplink_smartplug.py
  3. Next you need to know the IP address of the smart plug you want to reset. If you don’t know how to find it from your WiFi router, you can scan for it with an IP scanner, such as Fing. Look for a device named KP115 (or HS110).
  4. open up a command shell and type:
python3 ./tplink_smartplug.py -t <ipaddr> -c energy_reset

substituting the IP address of your smart plug for “<ipaddr>.”

Example:

# python3 ./tplink_smartplug.py -t 192.168.1.36 -c energy_reset
Sent:      {"emeter":{"erase_emeter_stat":{}}}
Received:  {"emeter":{"erase_emeter_stat":{"err_code":0}}}

The Python script returns “err_code: 0” if it’s successful. Next, open up your Kasa app, and check to see if the energy meter was reset successfully.

To erase runtime statistics, use runtime_reset instead of energy_reset.