https://github.com/uintdev/tplink-lightbulb-http
Basic controls for TP-Link light bulbs over HTTP
https://github.com/uintdev/tplink-lightbulb-http
Last synced: 9 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-05T23:38:50.000Z (about 1 year ago)
- Last Synced: 2025-01-20T18:16:06.994Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 2
- 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 |