https://github.com/uintdev/tplink-lightbulb-http
Basic controls for TP-Link light bulbs over HTTP
https://github.com/uintdev/tplink-lightbulb-http
api javascript kasa tplink
Last synced: about 2 months ago
JSON representation
Basic controls for TP-Link light bulbs over HTTP
- Host: GitHub
- URL: https://github.com/uintdev/tplink-lightbulb-http
- Owner: uintdev
- License: mit
- Created: 2024-03-08T19:13:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-04T14:07:52.000Z (3 months ago)
- Last Synced: 2026-01-08T16:59:06.751Z (3 months ago)
- Topics: api, javascript, kasa, tplink
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TPLink LightBulb HTTP
Basic controls for TP-Link light bulbs over HTTP
The communication is handled using the [tplink-lightbulb](https://github.com/konsumer/tplink-lightbulb) library.
## What does this do?
This allows for the following actions:
### Light actions
- Light on
- GET
- /light/on
- Light off
- GET
- /light/off
- Light brightness to 100
- GET
- /light/brightness/100
- Light brightness to 50
- GET
- /light/brightness/50
- Light details
- GET
- /light/details
### Display actions (refer to displayOffFile variable info)
- Display on
- GET
- /display/on
- Display off
- GET
- /display/off
## Configuration
### Installing dependencies
Run the following to install `express` and `tplink-lightbulb` dependencies:
```bash
npm install
```
### Configuring the server
There are values of variables that you may need to adjust (especially the IP address of the lightbulb).
| Variable | Description |
| -------------- | ------------------------------------------------------------------------------------------------------------------ |
| hostname | IP address of TP-Link light bulb |
| port | Port number of the HTTP server that the script would be hosting |
| writeToFile | Output last action status to file |
| statusFile | Path to last action status file -- intended to use with SSD1306-Display-SysInfo to display the status on a display |
| displayOffFile | Path to display off file -- intended to use with SSD1306-Display-SysInfo to control the display visibility |