⚠️ Note: This is obsolete for me and will be archived soon™️. One can achieve the same thing with WLED and the Homebridge Pluginhomebridge-wled-simple
, which is super easy to configure and brings a lot more features. This setup seems to be extremely reliable as well.
This program lets you control WS2812 LED stripes connected to an ESP8266 via Homebridge and the Homebridge MQTT-Thing plugin. This way you can control a WS2812 LED stripe via the iOS Home.app or Siri.
I was following Studio Pieter's HOWTO for controlling a WS2812 LED stripes, which uses the homekit2mqtt
Homekit bridge. But I didn't want another Homekit bridge since I already had Homebridge installed and in use. So I adjusted the code from Studio Pieter's NeoPixel-MQTT HOWTO to use the direct HSV values from Homebridge MQTT-Thing plugin and set the LEDs.
- Platform.io installation
- Homebridge installation
- MQTT Broker installation running in your network
- Homebridge MQTT-Thing plugin installes in Homebridge
For installing Homebridge and MQTT Broker, follow the corresponding parts in https://www.studiopieters.nl/homebridge-homekit-2-mqtt-revised-installation/. Install Homebridge MQTT-Thing via the Homebridge UI.
- Adjust the variables at the top of
main.ino
to your needs - Install the NeoPixel library to the project:
platformio lib install --save "Adafruit NeoPixel"
- Compile the project:
platformio run
- Upload the build to your ESP8266
- You need to configure a Lightbulb - HSV item in the Homebridge MQTT-Thing plugin.
Add this to the accessories
array on your Homebridge config:
{
"type": "lightbulb-HSV",
"name": "LED Stripe",
"topics": {
"getOnline": "led-nodemcu/online",
"setHSV": "led-nodemcu/hsvcolor",
"getHSV": "led-nodemcu/hsvcolor",
"getOn": "led-nodemcu",
"setOn": "led-nodemcu"
},
"confirmationIndicateOffline": true,
"integerValue": false,
"accessory": "mqttthing"
}
Adjust led-nodemcu
above if you changed the host
variable in main.ino
. Also adjust the name to your needs.
- This is (more or less) heavily based on the code from https://www.studiopieters.nl/homebridge-mqtt-neopixel/, but heavily modified.
- I also used parts from https://www.studiopieters.nl/homebridge-homekit-2-mqtt-revised-installation/
PubSubClient
library included in this repo by https://github.com/Imroy/pubsubclientStringTokenizer
library included in this repo by https://github.com/syalujjwal/Arduino-StringTokenizer-Library