homebridge-rgb-serial
v1.0.0
Published
Homebridge plugin for controlling RGB LED strips via Serial connection
Maintainers
Readme
Homebridge RGB Serial
A Homebridge plugin for controlling RGB LED strips via serial connection (Arduino, Raspberry Pi, etc.).
Installation
npm install -g homebridge-rgb-serialConfiguration
Add the following configuration to your Homebridge's config.json:
{
"accessories": [
{
"accessory": "RGBSerial",
"name": "RGB Light",
"port": "/dev/ttyUSB0",
"baudRate": 115200,
"debounceMs": 20,
"colorTempMin": 140,
"colorTempMax": 500
}
]
}Configuration Parameters
| Parameter | Type | Default | Description |
| -------------- | ------ | -------------- | ------------------------------------ |
| name | string | "RGB Light" | Device name in HomeKit |
| port | string | "/dev/ttyUSB0" | Serial port path |
| baudRate | number | 115200 | Communication speed (9600 or 115200) |
| debounceMs | number | 20 | Color update delay (ms) |
| colorTempMin | number | 140 | Minimum color temperature (K) |
| colorTempMax | number | 500 | Maximum color temperature (K) |
Communication Protocol
The plugin sends the following commands through the serial port:
- Power control:
power onorpower off - Color setting:
rgb R,G,B(where R,G,B are values from 0 to 255)
Arduino Wiring Diagram
Arduino
+------------------+
| |
| D5 -----> R LED |
| D6 -----> G LED |
| D7 -----> B LED |
| |
+------------------+Requirements
- Node.js >= 16.0.0
- Homebridge >= 1.6.0
- Device with serial port (Arduino, Raspberry Pi)
Development
# Clone the repository
git clone https://github.com/whereayodev/homebridge-serial-rgb.git
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run watchTesting
# Run tests
npm test
# Run linter
npm run lintFeatures
- HomeKit integration
- RGB color control
- Power on/off
- Color temperature adjustment
- Brightness control
- Debounced color updates
- Serial communication
License
MIT
Support
If you encounter any issues, please create an issue in the repository.
Sponsorship
If you find this project helpful, consider supporting its development via GitHub Sponsors.
Credits
Built with:
