diff --git a/README.md b/README.md index a3b05b8..d5f37a0 100644 --- a/README.md +++ b/README.md @@ -27,22 +27,24 @@ A full list of commands is provided in [tplink-smarthome-commands.txt](tplink-sm Provide the target IP using `-t` and a command to send using either `-c` or `-j`. Commands for the `-c` flag: -| Command | Description | -|-----------|--------------------------------------| -| on | Turns on the plug | -| off | Turns off the plug | -| info | Returns device info | -| cloudinfo | Returns cloud connectivity info | -| wlanscan | Scan for nearby access points | -| time | Returns the system time | -| schedule | Lists configured schedule rules | -| countdown | Lists configured countdown rules | -| antitheft | Lists configured antitheft rules | -| reboot | Reboot the device | -| reset | Reset the device to factory settings | -| energy | Return realtime voltage/current/power| -| ledon | Turn on the LED indicator | -| ledoff | Turn off the LED indicator | +| Command | Description | +|---------------|--------------------------------------| +| on | Turns on the plug | +| off | Turns off the plug | +| info | Returns device info | +| cloudinfo | Returns cloud connectivity info | +| wlanscan | Scan for nearby access points | +| time | Returns the system time | +| schedule | Lists configured schedule rules | +| countdown | Lists configured countdown rules | +| antitheft | Lists configured antitheft rules | +| reboot | Reboot the device | +| reset | Reset the device to factory settings | +| energy | Return realtime voltage/current/power| +| energy_reset | Reset energy meters | +| runtime_reset | erase runtime statistics | +| ledon | Turn on the LED indicator | +| ledoff | Turn off the LED indicator | More advanced commands such as creating or editing rules can be issued using the `-j` flag by providing the full JSON string for the command. Please consult [tplink-smarthome-commands.txt](tplink-smarthome-commands.txt) for a comprehensive list of commands. diff --git a/tplink_smartplug.py b/tplink_smartplug.py index 909de69..4bdc8e4 100755 --- a/tplink_smartplug.py +++ b/tplink_smartplug.py @@ -61,7 +61,9 @@ commands = {'info' : '{"system":{"get_sysinfo":{}}}', 'antitheft': '{"anti_theft":{"get_rules":{}}}', 'reboot' : '{"system":{"reboot":{"delay":1}}}', 'reset' : '{"system":{"reset":{"delay":1}}}', - 'energy' : '{"emeter":{"get_realtime":{}}}' + 'energy' : '{"emeter":{"get_realtime":{}}}', + 'energy_reset' : '{"emeter":{"erase_emeter_stat":{}}}', + 'runtime_reset' : '{"schedule":{"erase_runtime_stat":{}}}' } # Encryption and Decryption of TP-Link Smart Home Protocol