K5S RGB LED Plugin for Homebridge
This plugin will create a new light accessory with On, Hue, Saturation, and Brightness characteristics. Updates from HomeKit are processed by the plugin and converted to RGB before being sent out over MQTT on a topic of your choosing. This allows you to easily build your own RGB light controller that can interact with HomeKit and Siri.
This plugin leverages the homebridge-mqtt-base library to implement the MQTT communication.
Prerequisite
- Something to run Homebridge and an MQTT Broker on (Raspberry Pis are great for this)
- An network connected device that can act as an MQTT client (I use Photons)
- Homebridge
- An MQTT broker (I use Mosquitto)
Example Homebridge config
Parameters
- host (
String
) the hostname of the MQTT broker - inboundTopic (
String
) the topic used to emit from the accessory to HomeKit - outboundTopic (
String
) the topic used to emit from HomeKit to the accessory
MQTT Interface
The plugin will send a JSON payload with red
, green
, and blue
fields to the topic specified in outboundTopic
.
To update the plugin's (and HomeKit's) state from the outside, send a JSON payload of the same structure to the topic specified in inboundTopic
.
All colors can be a float
between 0
and 255
.