Sign inSign up

jasonacox/powermonitor

By jasonacox

Updated almost 7 years ago

This script will will poll WiFi Smart Plugs for state and energy usage (Watts)

Image
1

2.9K

jasonacox/powermonitor repository overview

Powermonitor

Monitor power usage through WiFi Smart Plug. This script will will poll the Smart Plugs for state and energy usage (Watts)

Setup

  1. Download the Smart Life - Smart Living app for iPhone or Android. Pair with your smart plug (this is important as you cannot monitor a plug that has not been paired).
  2. Device ID - Inside the app, select the plug you wish to monitor, select the three dot top right and "Device Info". The page should display "Device ID" which the script will use to poll the plug.
  3. IP Address - You will need to determine what IP address your network assigned to the Smart Plug - this is more difficult but tooks like arp-scan can help identify devices on your network. WiFi Routers often have a list of devices connected as well. Look for devices with a name like "ESP_xxxxxx".

Run

Make sure to replace with device ID and IP. The key is only used to control the device so you can omit that or a random value will work.

# run powermonitor container - replace with device ID and IP 
docker run -e PLUGID='01234567891234567890' -e PLUGIP="10.0.1.x" -e PLUGKEY="0123456789abcdef" jasonacox/powermonitor

Source

Github: * https://github.com/jasonacox/powermonitor

Example Output

$ docker run -e PLUGID='01234567891234567890' -e PLUGIP="10.0.1.99" e PLUGKEY="0123456789abcdef" jasonacox/powermonitor

Polling Device 01234567891234567890 at 10.0.1.99 with key 0123456789abcdef
Dictionary {'devId': '01234567891234567890', 'dps': {'1': True, '2': 0, '4': 69, '5': 12, '6': 1181}}
Switch On: True
Power (W): 1.200000
Current (mA): 69.000000
Voltage (V): 118.100000
Projected usage (kWh):  Day: 0.028800  Week: 0.201600  Month: 0.873600

Example Products

Tag summary

Content type

Image

Digest

Size

336.5 MB

Last updated

almost 7 years ago

docker pull jasonacox/powermonitor