{"_id":"@alexweininger/tplink-lightbulb","_rev":"1-f3f8f57651e2687bdd2e9f82317369e6","name":"@alexweininger/tplink-lightbulb","dist-tags":{"latest":"1.7.4"},"versions":{"1.7.4":{"name":"@alexweininger/tplink-lightbulb","version":"1.7.4","type":"module","description":"Control TP-Link smart-home devices from nodejs","scripts":{"build":"npx microbundle --target node","test":"NODE_OPTIONS='--experimental-vm-modules --no-warnings' npx jest","test:integration":"node ./src/*.integration.js","release":"npx pkg --public --out-path=./dist ./src/tplight.cjs"},"bin":{"tplight":"src/tplight.cjs"},"repository":{"type":"git","url":"git+https://github.com/konsumer/tplink-lightbulb.git"},"author":{"name":"David Konsumer","email":"konsumer@jetboystudio.com"},"license":"MIT","bugs":{"url":"https://github.com/konsumer/tplink-lightbulb/issues"},"homepage":"https://github.com/konsumer/tplink-lightbulb#readme","keywords":["tp-link","lightbulb","smartbulb","smart-home","LB120","LB130","HS100","HS105","HS110","KP100"],"dependencies":{"yargs":"latest"},"source":"src/index.js","exports":"./dist/tplink-lightbulb.modern.js","main":"dist/tplink-lightbulb.cjs","module":"dist/tplink-lightbulb.module.js","unpkg":"dist/tplink-lightbulb.umd.js","gitHead":"5f03bc3a3fd10e45d56b41cc389df7665f8a771e","_id":"@alexweininger/tplink-lightbulb@1.7.4","_nodeVersion":"14.17.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-b7tDXEQdxBsztoNsLwNfZ5TgtWKLfwqqlKWpZHM3y6G2SYjssl/dfmUprK3Atm1VuQq/pqx4zXixxSQk/07ldw==","shasum":"d296cbd5d1b2470de04bf6e1a061484c1424f81a","tarball":"https://registry.npmjs.org/@alexweininger/tplink-lightbulb/-/tplink-lightbulb-1.7.4.tgz","fileCount":5,"unpackedSize":27551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhPvJ0CRA9TVsSAnZWagAAaAMQAJTnUmuuAiQuCaDgZ2UI\nFMpGCT7MCrEcXHy8PMBxvJQxlmRYJaOvC8WFb7zHF2mfz8Sx9FwDzWyj9LI3\nAUBpL7TpuULJC2SZkCGEn4k6VDm5n93hauzg1bjOnQkrYjzA1Y4lKXwAseWB\nW0AqXHtKfPrszaMU1+x9K5/a099Fo1tBr+3k+A1rUEsIY+q021JvcpujFdG1\n2HbolFTm0KDAWdvThM6P/IgKekwBf7Xm7EqIZbWTBgV5nbvj+yYtfQC4yeiA\nXSsx0oT9JRshXH/vHkAERD1ckZ56lO/Kfpo6wHjfS+w57OutMbt4IG+bfqLn\n7DAe3Lp0DGYTeb8v8l6fZ8rBg/aKWopfKejuT6RbC0nBd6qJmT+9ig/eG/jF\nk8MZZnPSR7NZ/7T/RA9YGhZHORo2f8Jbe+eflqc2bV5kwUOyLM6nmrI4CdW2\nxfbSv1zIXtw18oea8ebDWspN4G9A+cXUDJgv2/ANaDByDMiSTMzLVDTO6Qjg\n3k1oCI8fKmUBlb/fCC4yyBSf/SDLmWjFWkTpGDyKYh44Vze+1Cwa2N9we3s1\nB2b3fdemFlfh0KgCJBG8Gi+6J+32xt3rtxQDnu/szrJeoDxb1baoyi+/3Tmt\nynhHnG22FOKa7gjPYaS0B/WcaQ3LzY3QF1lCsqI6BZdEsAODFE2tFOfKrnCE\n+FnY\r\n=0stB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6fuD9YENKolKJEDiYxdJhA74/UNCrAgxwcgPAjaBn/AiA0XroE5oU3r7OqwFDDWVvOA4KCB1ECcTBVJpRUHWAJjw=="}]},"_npmUser":{"name":"alexweininger","email":"alex.weininger@live.com"},"directories":{},"maintainers":[{"name":"alexweininger","email":"alex.weininger@live.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tplink-lightbulb_1.7.4_1631515252565_0.656321802179332"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-13T06:40:52.527Z","1.7.4":"2021-09-13T06:40:52.691Z","modified":"2022-04-04T12:41:59.797Z"},"maintainers":[{"name":"alexweininger","email":"alex.weininger@live.com"}],"description":"Control TP-Link smart-home devices from nodejs","homepage":"https://github.com/konsumer/tplink-lightbulb#readme","keywords":["tp-link","lightbulb","smartbulb","smart-home","LB120","LB130","HS100","HS105","HS110","KP100"],"repository":{"type":"git","url":"git+https://github.com/konsumer/tplink-lightbulb.git"},"author":{"name":"David Konsumer","email":"konsumer@jetboystudio.com"},"bugs":{"url":"https://github.com/konsumer/tplink-lightbulb/issues"},"license":"MIT","readme":"<img src=\"https://officedepot.scene7.com/is/image/officedepot/945143_p_lb120_pkg?$OD%2DLarge$&wid=450&hei=450\" align=\"right\" alt=\"tested with LB120\" />\n\n# tplink-lightbulb\n\nControl TP-Link smart-home devices from nodejs\n\n[![NPM](https://badge.fury.io/js/tplink-lightbulb.svg)](https://nodei.co/npm/tplink-lightbulb/)\n\nThis will allow you to control TP-Link smart-home devices from nodejs or the command-line.\n\n## related\n\n* If you want to use kasa (allows you to hit your tplink devices, on an external network) have a look at [kasa_control](https://github.com/konsumer/kasa_control).\n* If you'd like to run a GraphQL server to control your lights, see [tplink-graphql](https://github.com/konsumer/tplink-graphql).\n* If you like to see a demo web-app that uses react & websockets, see [tpserver](https://github.com/konsumer/tpserver).\n\n## supported devices\n\nNot all TP-Link smart-home devices can do all things, here's the support-matrix:\n\n|                                                                                                             | raw | details | on | off | temp | hex | hsb | cloud | wifi | join |\n|------------------------------------------------------------------------------------------------------------:|:---:|:-------:|:--:|:---:|:----:|:---:|:---:|:-----:|:----:|:----:|\n| [LB100](http://www.tp-link.com/us/products/details/cat-5609_LB100.html)                                     |  X  |    X    |  X |  X  |   X  |     |     |   X   |   X  |   X  |\n| [LB120](http://www.tp-link.com/us/products/details/cat-5609_LB120.html)                                     |  X  |    X    |  X |  X  |   X  |     |     |   X   |   X  |   X  |\n| [LB130](http://www.tp-link.com/us/products/details/cat-5609_LB130.html)                                     |  X  |    X    |  X |  X  |   X  |  X  |  X  |   X   |   X  |   X  |\n| [HS100](http://www.tp-link.com/us/products/details/cat-5516_HS100.html)                                     |  X  |    X    |  X |  X  |      |     |     |       |   X  |   X  |\n| [HS105](http://www.tp-link.com/us/products/details/cat-5516_HS105.html)                                     |  X  |    X    |  X |  X  |      |     |     |       |   X  |   X  |\n| [HS110](http://www.tp-link.com/us/products/details/cat-5516_HS110.html)                                     |  X  |    X    |  X |  X  |      |     |     |       |   X  |   X  |\n| [HS200](http://www.tp-link.com/us/products/details/cat-5622_HS200.html)                                     |  X  |    X    |  X |  X  |      |     |     |       |   X  |   X  |\n| [KP100](http://www.tp-link.com/us/products/details/cat-5516_KP100.html)                                     |  X  |    X    |  X |  X  |      |     |     |       |   X  |   X  |\n| [LB200](http://www.tp-link.com/us/products/details/cat-5609_LB200.html)                                     |  X  |    X    |  X |  X  |   X  |     |     |   X   |   X  |   X  |\n| [LB230](http://www.tp-link.com/us/products/details/cat-5609_LB230.html)                                     |  X  |    X    |  X |  X  |   X  |  X  |  X  |   X   |   X  |   X  |\n| [KL110](https://www.tp-link.com/uk/home-networking/smart-bulb/kl110/)                                       |  X  |    X    |  X |  X  |      |     |     |       |   X  |   X  |\n| [KL120](https://www.tp-link.com/uk/home-networking/smart-bulb/kl120/)                                       |  X  |    X    |  X |  X  |   X  |     |     |   X   |   X  |   X  |\n| [KL130](https://www.kasasmart.com/us/products/smart-lighting/kasa-smart-wi-fi-light-bulb-multicolor-kl130/) |  X  |    X    |  X |  X  |   X  |  X  |  X  |   X   |   X  |   X  |\n\nI have LB120, LB130, and HS105, so any testing (and packet-capture) with other devices would be greatly appreciated. \n\n\n## command-line\n\nIf you have nodejs installed, you can install it for your system with this:\n\n```\nnpm i -g tplink-lightbulb\n```\n\nYou can even run it without installing:\n\n```\nnpx tplink-lightbulb\n```\n\nIf you don't want to install nodejs, or just want the standalone-version, install a [release](https://github.com/konsumer/tplink-lightbulb/releases) for your system.\n\nNow, you can use it like this:\n\n```\nUsage: tplight <COMMAND>\n\nCommands:\n  tplight scan                               Scan for lightbulbs\n  tplight on <ip>                            Turn on lightbulb\n  tplight off <ip>                           Turn off lightbulb\n  tplight bright <ip> <brightness>           Set the brightness of the lightbulb\n                                            (for those that support it)\n  tplight temp <ip> <color>                  Set the color-temperature of the\n                                            lightbulb (for those that support\n                                            it)\n  tplight hex <ip> <color>                   Set color of lightbulb using hex\n                                            color (for those that support it)\n  tplight hsb <ip> <hue> <saturation>        Set color of lightbulb using HSB\n  <brightness>                              color (for those that support it)\n  tplight cloud <ip>                         Get cloud info\n  tplight raw <ip> <json>                    Send a raw JSON command\n  tplight details <ip>                       Get details about the device\n  tplight led <ip> <ledState>                Turn on/off LED indicator\n  tplight wifi <ip>                          List available wifi for a particular\n                                            device\n  tplight join <ip> <SSID> [SECRET]          Configure the device to use these\n                                            wifi settings\n\nOptions:\n  -h, --help     Show help                                             [boolean]\n      --version  Show version number                                   [boolean]\n\nExamples:\n  tplight scan -h     Get more detailed help with `scan` command\n  tplight on -h       Get more detailed help with `on` command\n  tplight off -h      Get more detailed help with `off` command\n  tplight temp -h     Get more detailed help with `temp` command\n  tplight hex -h      Get more detailed help with `hex` command\n  tplight hsb -h      Get more detailed help with `hsb` command\n  tplight cloud -h    Get more detailed help with `cloud` command\n  tplight raw -h      Get more detailed help with `raw` command\n  tplight details -h  Get more detailed help with `details` command\n  tplight led -h      Get more detailed help with `led` command\n  tplight wifi -h     Get more detailed help with `wifi` command\n  tplight join -h     Get more detailed help with `join` command\n```\n\n## wireshark\n\nIf you want to analyze the protocol, you can use the included `tplink-smarthome.lua`.\n\nInstall in the location listed in About Wireshark/Folders/Personal Plugins\n\nI captured packets with tcpdump running on a [raspberry pi pretending to be a router](https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point?view=all). In general, this is a really useful way to capture IOT protocols and mess around with them.\n\nI ssh'd into my pi, ran `sudo apt update && sudo apt install tcpdump`, then `tcpdump -i wlan0 -w lights.pcap`\n\nI connected the lights to that network (reset them to factory default by turning the power off/on 5 times, then configure in Kasa app.)\n\nAfter I did stuff like switch the lights on/off in app, I open the pcap file in wireshark on my desktop.\n\n## library\n\nYou can install it in your project like this:\n\n```\nnpm i -S tplink-lightbulb\n```\n\nInclude it in your project like this:\n\n```js\nconst TPLSmartDevice = require('tplink-lightbulb')\n```\n\nor for ES6:\n\n```js\nimport TPLSmartDevice from 'tplink-lightbulb'\n```\n\nRead more about [the API](https://github.com/konsumer/tplink-lightbulb/blob/master/API.md).\n","readmeFilename":"README.md"}