homebridge-wled-studio 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +87 -2
- package/config.schema.json +73 -0
- package/homebridge-ui/public/index.html +742 -0
- package/homebridge-ui/server.js +36 -0
- package/index.js +6 -0
- package/lib/color.js +80 -0
- package/lib/fxdata.js +118 -0
- package/lib/platform.js +405 -0
- package/lib/scan.js +50 -0
- package/lib/switchAction.js +70 -0
- package/lib/uiHandlers.js +253 -0
- package/lib/wledClient.js +105 -0
- package/lib/wledDevice.js +173 -0
- package/package.json +39 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
- Light tile per WLED device: on/off, brightness and colour (Siri voice control included).
|
|
6
|
+
- Preset tile: pick WLED presets in the Home app; choose which presets appear; you can hide inputs in the Home app.
|
|
7
|
+
- Switches for presets, effects (palette, colours, effect sliders and options read from WLED) and single colours, with optional brightness.
|
|
8
|
+
- Settings page with three tabs: Devices (find by IP, scan an IP range), Device & troubleshooting (health check, live state, device info, connection test, identify, on/off, reboot) and Switches (editor with colour wheels and a Test button).
|
|
9
|
+
- Names for every tile; renames made in the Home app are kept.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 codoboy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WLED Studio for Homebridge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Control your [WLED](https://kno.wled.ge) lights from the **Apple Home app** and **Siri**, and manage them
|
|
4
|
+
from a settings page in Homebridge with three tabs: **Devices**, **Device & troubleshooting** and **Switches**.
|
|
5
|
+
|
|
6
|
+
## What appears in the Home app
|
|
7
|
+
|
|
8
|
+
For every WLED controller you add:
|
|
9
|
+
|
|
10
|
+
| Tile | What it does |
|
|
11
|
+
|---|---|
|
|
12
|
+
| **Light** | On/off, brightness and colour. Siri works: *"Hey Siri, set Profile Light to blue"*, *"…to 40%"*. |
|
|
13
|
+
| **Preset tile** | A picker with all your WLED presets (choose which ones appear). Long-press it in the Home app and pick a preset. |
|
|
14
|
+
| **Your switches** | One switch per preset, effect or colour you create. *"Hey Siri, turn on Strip Vibe"*. Each switch turns itself back off after a second, so it's ready for next time. |
|
|
15
|
+
|
|
16
|
+
You choose the name of every tile in the settings. If you later rename a tile in the Home app, the plugin
|
|
17
|
+
keeps your Home app name; it only pushes a name again when you change it in the settings.
|
|
18
|
+
|
|
19
|
+
## Settings page
|
|
20
|
+
|
|
21
|
+
### 1 · Devices
|
|
22
|
+
- **Find by IP address:** type the controller's IP and click **Find**.
|
|
23
|
+
- **Scan an IP range:** finds every WLED between two addresses, even behind another router (where automatic discovery can't reach).
|
|
24
|
+
- For each device: label, IP address, status update interval, whether to publish it, and the **light tile** and **preset tile** names. You can also choose which presets the preset tile shows.
|
|
25
|
+
- **Switch to Solid when a colour is chosen:** makes Home app colours show even when an effect was running (on by default).
|
|
26
|
+
|
|
27
|
+
### 2 · Device & troubleshooting
|
|
28
|
+
- **Health check:** reachability and response time, Wi-Fi signal, free memory, power limiter and power draw, frame rate, live-data override, recent restarts, and saved presets.
|
|
29
|
+
- **Live state:** power, brightness, preset, effect, palette, colour, transition and nightlight.
|
|
30
|
+
- **Device info:** version, build, chip, IP/MAC, LED count, segments, uptime and storage.
|
|
31
|
+
- Buttons: **Connection test** (5 requests, with timing), **Identify** (blinks 3×), **Turn on/off**, **Reboot**, **Open WLED web page**.
|
|
32
|
+
- A short "if something doesn't work" guide.
|
|
33
|
+
|
|
34
|
+
### 3 · Switches
|
|
35
|
+
Create as many switches as you like, each with a **Test** button:
|
|
36
|
+
- **Preset:** pick any saved WLED preset or playlist.
|
|
37
|
+
- **Effect:** pick any of WLED's effects (searchable) and a palette. The page shows exactly the controls the chosen effect uses, read from your WLED: speed and intensity, the custom sliders, option checkboxes, and one **colour wheel per colour slot**. Includes **Use this effect's default settings**.
|
|
38
|
+
- **Single colour:** a colour wheel with shade.
|
|
39
|
+
- Optional **brightness** for every switch.
|
|
40
|
+
- Edit, duplicate or delete switches at any time.
|
|
41
|
+
|
|
42
|
+
Click **Save** at the bottom of the settings window and restart Homebridge to apply changes.
|
|
43
|
+
|
|
44
|
+
## Tips
|
|
45
|
+
|
|
46
|
+
- **Give each WLED a fixed IP address** in your router (DHCP reservation).
|
|
47
|
+
- **Siri naming:** avoid words Siri links to phone features, such as *mode, music, play, focus, sleep, alarm* and *timer*. A switch called "Music Mode" may start music instead of your lights.
|
|
48
|
+
- **Preset tile missing or empty:** save presets in WLED first. The plugin reads them at start-up and every 10 minutes.
|
|
49
|
+
- **"No Response":** the controller didn't answer three status checks in a row. Use the health check in tab 2.
|
|
50
|
+
|
|
51
|
+
## Example config
|
|
52
|
+
|
|
53
|
+
The settings page writes this for you:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"platform": "WLEDStudio",
|
|
58
|
+
"name": "WLED Studio",
|
|
59
|
+
"resetDelay": 1,
|
|
60
|
+
"devices": [
|
|
61
|
+
{
|
|
62
|
+
"id": "441bf6d37c30",
|
|
63
|
+
"name": "Desk strip",
|
|
64
|
+
"host": "10.24.6.6",
|
|
65
|
+
"pollInterval": 5,
|
|
66
|
+
"light": { "enabled": true, "name": "Profile Light", "solidOnColor": true },
|
|
67
|
+
"presets": { "enabled": true, "name": "Profile Light Preset", "exclude": [] },
|
|
68
|
+
"switches": [
|
|
69
|
+
{ "id": "sw1", "name": "Strip Vibe", "mode": "preset", "preset": 2 },
|
|
70
|
+
{ "id": "sw2", "name": "Strip Fire", "mode": "effect", "fx": 66, "pal": 35, "sx": 64, "ix": 160, "brightness": 80 },
|
|
71
|
+
{ "id": "sw3", "name": "Strip Red", "mode": "color", "color": "#ff0000", "brightness": 50 }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install
|
|
82
|
+
npm test # unit and HomeKit tests (fake WLED, real HAP-NodeJS)
|
|
83
|
+
node dev/preview-server.js # try the settings page in a browser at http://localhost:8590
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginAlias": "WLEDStudio",
|
|
3
|
+
"pluginType": "platform",
|
|
4
|
+
"singular": true,
|
|
5
|
+
"customUi": true,
|
|
6
|
+
"customUiPath": "./homebridge-ui",
|
|
7
|
+
"headerDisplay": "Control WLED from the Apple Home app: a light tile (on/off, brightness, colour, Siri), a preset tile, and your own switches for presets, effects and colours.",
|
|
8
|
+
"footerDisplay": "After saving, restart Homebridge so the changes reach the Home app.",
|
|
9
|
+
"schema": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"name": { "title": "Platform name", "type": "string", "default": "WLED Studio" },
|
|
13
|
+
"resetDelay": { "title": "Switches turn back off after (seconds)", "type": "number", "default": 1, "minimum": 0.5, "maximum": 60 },
|
|
14
|
+
"debug": { "title": "Detailed logging", "type": "boolean", "default": false },
|
|
15
|
+
"devices": {
|
|
16
|
+
"title": "WLED devices",
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"properties": {
|
|
21
|
+
"id": { "title": "Device ID (MAC, filled in automatically)", "type": "string" },
|
|
22
|
+
"name": { "title": "Device label", "type": "string" },
|
|
23
|
+
"host": { "title": "IP address", "type": "string", "required": true },
|
|
24
|
+
"enabled": { "title": "Publish to the Home app", "type": "boolean", "default": true },
|
|
25
|
+
"pollInterval": { "title": "Status update interval (seconds)", "type": "integer", "default": 5, "minimum": 1, "maximum": 3600 },
|
|
26
|
+
"light": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"enabled": { "title": "Light tile", "type": "boolean", "default": true },
|
|
30
|
+
"name": { "title": "Light tile name", "type": "string" },
|
|
31
|
+
"solidOnColor": { "title": "Switch to Solid when a colour is chosen", "type": "boolean", "default": true }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"presets": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"properties": {
|
|
37
|
+
"enabled": { "title": "Preset tile", "type": "boolean", "default": true },
|
|
38
|
+
"name": { "title": "Preset tile name", "type": "string" },
|
|
39
|
+
"exclude": { "title": "Preset numbers to hide", "type": "array", "items": { "type": "integer" } }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"switches": {
|
|
43
|
+
"title": "Switches",
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"id": { "type": "string" },
|
|
49
|
+
"name": { "title": "Switch name", "type": "string", "required": true },
|
|
50
|
+
"mode": { "title": "Type", "type": "string", "enum": ["preset", "effect", "color"], "default": "preset" },
|
|
51
|
+
"preset": { "title": "Preset number", "type": "integer", "minimum": 1 },
|
|
52
|
+
"fx": { "title": "Effect number", "type": "integer", "minimum": 0 },
|
|
53
|
+
"pal": { "title": "Palette number", "type": "integer", "minimum": 0 },
|
|
54
|
+
"colors": { "title": "Colours (hex)", "type": "array", "maxItems": 3, "items": { "type": "string" } },
|
|
55
|
+
"color": { "title": "Colour (hex)", "type": "string" },
|
|
56
|
+
"sx": { "type": "integer", "minimum": 0, "maximum": 255 },
|
|
57
|
+
"ix": { "type": "integer", "minimum": 0, "maximum": 255 },
|
|
58
|
+
"c1": { "type": "integer", "minimum": 0, "maximum": 255 },
|
|
59
|
+
"c2": { "type": "integer", "minimum": 0, "maximum": 255 },
|
|
60
|
+
"c3": { "type": "integer", "minimum": 0, "maximum": 31 },
|
|
61
|
+
"o1": { "type": "boolean" },
|
|
62
|
+
"o2": { "type": "boolean" },
|
|
63
|
+
"o3": { "type": "boolean" },
|
|
64
|
+
"brightness": { "title": "Brightness %", "type": "integer", "minimum": 1, "maximum": 100 }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|