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/statePOST /light/state- Using either query or form-encodedstate=0|off|1|onDELETE /light/stateGET /light/rgbPOST /light/rgb- Using either query or form-encodedr=0..255g=0..255b=0..255DELETE /light/rgbGET /light/hsvPOST /light/hsv- Using either query or form-encodedh=0..360s=0..1v=0..1DELETE /light/hsvGET /light/temperature(for blackbody radiation, in Kelvin)POST /light/temperature- Using either query or form-encodedk=1000..40000v=0..1DELETE /light/temperature
Published MQTT topics; (Using the default prefix of light)
light/state-on|offlight/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- Acceptson|offlight/temperature/set- Accepts Kelvin1000..40000light/color/set- Accepts comma-separated hue and saturation in0..360and0..100light/brightness/set- Accepts brightness in0..100light/rgb/set- Accepts comma-separated RGB in0..255(Auto-scales to brightness)