https://github.com/ananace/light
Personal light service
https://github.com/ananace/light
Last synced: 9 months ago
JSON representation
Personal light service
- Host: GitHub
- URL: https://github.com/ananace/light
- Owner: ananace
- Created: 2016-02-07T04:38:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-05-18T19:29:10.000Z (about 5 years ago)
- Last Synced: 2025-02-24T05:12:12.561Z (over 1 year ago)
- Language: C
- Size: 144 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
LED REST service
====
A simple service in C for controlling an RGB LED strip connected to a BitWizard Motor board over SPI or an P9813 IC, made for running on a Raspberry Pi
Supports both REST and MQTT interfaces for status and modification.
HTTP endpoints;
- `GET /light/state`
- `POST /light/state` - Using either query or form-encoded `state=0|off|1|on`
- `DELETE /light/state`
- `GET /light/rgb`
- `POST /light/rgb` - Using either query or form-encoded `r=0..255` `g=0..255` `b=0..255`
- `DELETE /light/rgb`
- `GET /light/hsv`
- `POST /light/hsv` - Using either query or form-encoded `h=0..360` `s=0..1` `v=0..1`
- `DELETE /light/hsv`
- `GET /light/temperature` (for blackbody radiation, in Kelvin)
- `POST /light/temperature` - Using either query or form-encoded `k=1000..40000` `v=0..1`
- `DELETE /light/temperature`
Published MQTT topics; (Using the default prefix of `light`)
- `light/state` - `on`|`off`
- `light/temperature` - blackbody radiation in Kelvin (`1000..40000`)
- `light/rgb` - comma-separated RGB color (`0..255`)
- `light/color` - comma-separated hue (`0..360`) and saturation (`0..100`)
- `light/brightness` - brightness (`0..100`)
Subscribed MQTT topics; (Using the default prefix of `light`)
- `light/state/set` - Accepts `on`|`off`
- `light/temperature/set` - Accepts Kelvin `1000..40000`
- `light/color/set` - Accepts comma-separated hue and saturation in `0..360` and `0..100`
- `light/brightness/set` - Accepts brightness in `0..100`
- `light/rgb/set` - Accepts comma-separated RGB in `0..255` (Auto-scales to brightness)