{"id":27115383,"url":"https://github.com/tyeth/gitlab_0xsamy_tapoplug-rest-api","last_synced_at":"2025-08-13T20:06:47.116Z","repository":{"id":266891012,"uuid":"864976406","full_name":"tyeth/GitLab_0xSamy_TapoPlug-Rest-API","owner":"tyeth","description":"Fork of https://gitlab.com/0xSamy/TapoPlug-Rest-API (intended for porting to circuitpython using adafruit_circuitpython_rsa)","archived":false,"fork":false,"pushed_at":"2025-06-22T22:10:40.000Z","size":621,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T23:19:42.429Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tyeth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-29T17:03:44.000Z","updated_at":"2024-09-29T17:11:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a9bd2ac-16fd-436c-b577-80df24aae747","html_url":"https://github.com/tyeth/GitLab_0xSamy_TapoPlug-Rest-API","commit_stats":null,"previous_names":["tyeth/gitlab_0xsamy_tapoplug-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tyeth/GitLab_0xSamy_TapoPlug-Rest-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyeth%2FGitLab_0xSamy_TapoPlug-Rest-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyeth%2FGitLab_0xSamy_TapoPlug-Rest-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyeth%2FGitLab_0xSamy_TapoPlug-Rest-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyeth%2FGitLab_0xSamy_TapoPlug-Rest-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyeth","download_url":"https://codeload.github.com/tyeth/GitLab_0xSamy_TapoPlug-Rest-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyeth%2FGitLab_0xSamy_TapoPlug-Rest-API/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270305185,"owners_count":24562087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-07T04:54:57.755Z","updated_at":"2025-08-13T20:06:47.085Z","avatar_url":"https://github.com/tyeth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TapoPlugAPI\n\nTapo Plug Api is a python wrapper that can be easily integrated in any project to control the TP-Link Tapo P100 and P105 plugs.\n\n![TP-Link Tapo API](https://i.ibb.co/vvg3FT8/Tapo-Plug-API-naqwada.jpg)\n\nAll endpoints integrated in this package were discovered after a reverse engineering of the firmware Tapo P105, 1.3.2 Build 20210122 Rel.\nHowever, due to a lack of information about which parameters to use for each request, other endpoints not exploited yet still need to be added in this package. If you are interested, the full endpoints list are listed below after the examples.\n\nAlso, If you want to have fun with the firmware, the link is also below after the examples.\n\n[![PyPI Version](https://badge.fury.io/py/netsparker-api.svg)](https://pypi.python.org/pypi/tapo_plug)\n### Dependencies:\n* Python 3.3+\n* requests module (install via pip)\n* The dependencies can be satisfied via `pip install -r requirements.txt`\n\n### Quick Install\n```\npip install tapo-plug\n```\n\n### Endpoints:\n\n* Get device information\n\n```python \nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getDeviceInfo(device)\nprint(response)\n```\n\n* Get device running information\n\n```python \nfrom tapo import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getDeviceRunningInfo(device)\nprint(response)\n```\n\n* Turn ON the plug.\n\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.plugOn(device)\nprint(response)\n```\n* Turn OFF the plug.\n\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.plugOff(device)\nprint(response)\n```\n\n* Get plug time usage.\n\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getPlugUsage(device)\nprint(response)\n```\n\n* Change plug alias.\n\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\",\n    \"nickname\": \"My Awesome Plug!\",\n}\n  \nresponse = tapoPlugApi.setNickname(device)\nprint(response)\n```\n\n* Turn OFF the LED.\n\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.ledOff(device)\nprint(response)\n```\n\n* Turn ON the LED.\n\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.ledOn(device)\nprint(response)\n```\n* Get LED status (ON/OFF).\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getLedInfo(device)\nprint(response)\n```\n\n* Automatically turns OFF the device when the provided delay is expired.\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\",\n    \"delay\":60 #seconds\n}\n  \nresponse = tapoPlugApi.plugOffCountdown(device)\nprint(response)\n```\n\n* Automatically turns ON the device when the provided delay is expired.\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\",\n    \"delay\":60 #seconds\n}\n  \nresponse = tapoPlugApi.plugOnCountdown(device)\nprint(response)\n```\n\n* Get some diagnostic information's.\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getDiagnoseStatus(device)\nprint(response)\n```\n\n* Should get device log, but always empty for me, I leave it here just in case...\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getPlugLog(device)\nprint(response)\n```\n\n* Can't really tell for what this id used for now.\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.qsComponentNego(device)\nprint(response)\n```\n\n* Get wireless access points information around the plug.\nSSID are encoded in base64\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\"\n}\n  \nresponse = tapoPlugApi.getWirelessScanInfo(device)\nprint(response)\n```\n\n* Update plug WiFi settings.\n```python\nfrom tapo_plug import tapoPlugApi\n  \ndevice = {\n    \"tapoIp\": \"DEVICE IP\",\n    \"tapoEmail\": \"ENTER YOUR TP-LINK EMAIL\",\n    \"tapoPassword\": \"ENTER YOUR TP-LINK PWD\",\n    \"ssid\": \"AP SSID\",\n    \"password\": \"AP PASSWORD\",\n    \"key_type\":\"AP ENC\", #wpa2_psk...\n    \"region\": \"Asia/Tokyo\", #Meaningless, but seems required\n}\n  \nresponse = tapoPlugApi.setWirelessInfo(device)\nprint(response)\n```\n*Don't forget to change your tapo IP in the dict once this request completed :)\n\n### Full endpoints list:\n\nHere are all enpoints used by Tapo P105 found in the firmware.\n\nEndpoints List         | Endpoints List         |\n-------------| -----------|\nget_device_info | remove_antitheft_rules |\nget_device_running_info |  set_antitheft_all_enable |\nset_device_info |     unbindDevice  |   \ndevice_reset |  setAlias | \ndevice_reboot |   passthrough |\nget_latest_fw |  multipleRequest |\nfw_download |  getWifiBasic |\nget_fw_download_state |   getFwCurrentVer |\ncomponent_nego |  getFwDownloadProgress |\nqs_component_nego |  module.negotiate |\nset_qs_info |  module.query |\nset_qs_extra_info |  module.execute |\nget_device_time |  module.config |\nset_device_time |  get_factory_info |\nget_wireless_scan_info |  get_diagnose_status |\nset_wireless_info |  account_sync |\nget_schedule_rules |  sync_env |\nadd_schedule_rule |  set_device_log | \nedit_schedule_rule |  get_device_log |\nremove_schedule_rules |  set_flash_log |\nset_schedule_all_enable |  get_flash_log |\nget_next_event |  get_led_info |\nget_schedule_day_runtime |  set_led_info |\nget_schedule_month_runtime |  connect_cloud |\nremove_all_schedule_runtime |  get_connect_cloud_state |\nget_countdown_rules |  get_ffs_info |\nadd_countdown_rule |  close_device_ble |\nedit_countdown_rule |  heart_beat |\nremove_countdown_rules |  get_device_usage |\nget_antitheft_rules |  heart_beat |\nadd_antitheft_rule |  set_inherit_info |\nedit_antitheft_rule |  get_inherit_info|\nset_auto_off_config | get_auto_off_config|\nget_auto_off_status | cancel_auto_off\nexec_atcmd |  I think the function exec_atcmd is one of the most interesting because the function name mean it is possible to send AT commands directly to the device, in theory. I've tried everything but nothing worked... In any case all the compatible AT commands are also listed in the firmware, if someone can find how to use it... PLEASE ping me!|\n\n### Tapo firmware:\n\nTapo P105 1.3.2 firmware:\u003cbr\u003e\nhttp://download.tplinkcloud.com/firmware/P105_1.3.2_20210122_r57063_up_signed_1615802824400.bin\u003cbr\u003e\u003cbr\u003e\n\n[2022-05-30] Update - Tapo P105 1.3.3 firmware has been released:\u003cbr\u003e\nhttp://download.tplinkcloud.com/firmware/P105_1-3-320220311-rel61171_2022-04-12_11.04.5_1653890825333.bin\n```json\n{\n  \"error_code\": 0,\n  \"result\": {\n    \"fwList\": [\n      {\n        \"fwReleaseLog\": \"Modifications and Bug Fixes:\\n1.Fixed the bug that fail to set schedule remotely.\\n\",\n        \"fwVer\": \"1.3.3 Build 220311 Rel.61171\",\n        \"fwReleaseDate\": \"2022-05-30\",\n        \"fwType\": 2,\n        \"fwUrl\": \"http://download.tplinkcloud.com/firmware/P105_1-3-320220311-rel61171_2022-04-12_11.04.5_1653890825333.bin\",\n        \"fwTitle\": \"Hi, a new firmware with bug fixes is available for your Tapo P105.\",\n        \"fwLocation\": 0,\n        \"fwReleaseLogUrl\": \"undefined yet\"\n      }\n    ]\n  }\n}\n```\n\n[2023-11-15] Update - Tapo P105 1.3.8 firmware has been released:\u003cbr\u003e\nhttp://download.tplinkcloud.com/firmware/P105_1.0_1.3.8_20230720_r59046_signed_1690537026862.bin\n```json\n{\n  \"error_code\": 0,\n  \"result\": {\n    \"fwList\": [\n      {\n        \"fwReleaseLog\": \"リリースノート：\\n1. Google Homeでプラグをオンにできない問題を修正しました。\\n2. デバイスのセキュリティが向上しました。\",\n        \"fwVer\": \"1.3.8 Build 20230720 Rel.59046\",\n        \"fwReleaseDate\": \"2023-07-28\",\n        \"fwType\": 2,\n        \"fwUrl\": \"http://download.tplinkcloud.com/firmware/P105_1.0_1.3.8_20230720_r59046_signed_1690537026862.bin\",\n        \"fwTitle\": \"Hi, a new firmware with bug fixes and performance improvement is available for your Tapo P105.\",\n        \"fwLocation\": 0,\n        \"fwReleaseLogUrl\": \"undefined yet\"\n      }\n    ]\n  }\n}\n```\n\n### Building modules:\n\n* To build a package to install via `pip` or `easy_install`, execute:\n    * `python setup.py sdist`\n* The resulting build will be in `$PWD/dist/tapo_plug-\u003cversion\u003e.tar.gz`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyeth%2Fgitlab_0xsamy_tapoplug-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyeth%2Fgitlab_0xsamy_tapoplug-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyeth%2Fgitlab_0xsamy_tapoplug-rest-api/lists"}