2
0
mirror of https://github.com/softScheck/tplink-smartplug synced 2026-01-11 23:38:46 +01:00

Added energy reset and runtime reset (#103)

* Add energy reset

* add engery_reset and runtime_reset commands
This commit is contained in:
chou2008
2024-10-08 10:50:11 -04:00
committed by GitHub
parent 3246a8d6ad
commit 21c14b3381
2 changed files with 21 additions and 17 deletions

View File

@@ -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: Provide the target IP using `-t` and a command to send using either `-c` or `-j`. Commands for the `-c` flag:
| Command | Description | | Command | Description |
|-----------|--------------------------------------| |---------------|--------------------------------------|
| on | Turns on the plug | | on | Turns on the plug |
| off | Turns off the plug | | off | Turns off the plug |
| info | Returns device info | | info | Returns device info |
| cloudinfo | Returns cloud connectivity info | | cloudinfo | Returns cloud connectivity info |
| wlanscan | Scan for nearby access points | | wlanscan | Scan for nearby access points |
| time | Returns the system time | | time | Returns the system time |
| schedule | Lists configured schedule rules | | schedule | Lists configured schedule rules |
| countdown | Lists configured countdown rules | | countdown | Lists configured countdown rules |
| antitheft | Lists configured antitheft rules | | antitheft | Lists configured antitheft rules |
| reboot | Reboot the device | | reboot | Reboot the device |
| reset | Reset the device to factory settings | | reset | Reset the device to factory settings |
| energy | Return realtime voltage/current/power| | energy | Return realtime voltage/current/power|
| ledon | Turn on the LED indicator | | energy_reset | Reset energy meters |
| ledoff | Turn off the LED indicator | | 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. 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.

View File

@@ -61,7 +61,9 @@ commands = {'info' : '{"system":{"get_sysinfo":{}}}',
'antitheft': '{"anti_theft":{"get_rules":{}}}', 'antitheft': '{"anti_theft":{"get_rules":{}}}',
'reboot' : '{"system":{"reboot":{"delay":1}}}', 'reboot' : '{"system":{"reboot":{"delay":1}}}',
'reset' : '{"system":{"reset":{"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 # Encryption and Decryption of TP-Link Smart Home Protocol