For supported GPIOs please see rpi-ws281x-python
LED_GPIO
(required)LED_COUNT
(required)LED_CHANNEL
(optional; default=0)LED_FREQ_HZ
(optional; default=800000; 400000 or 800000)LED_DMA_NUM
(optional; default=10; range=0-14)LED_BRIGHTNESS
(optional; default=255; range=1-255)LED_INVERT
(optional; default=0; 0 or 1)MQTT_BROKER
(optional; default='localhost')MQTT_USER
(optional; default=None)MQTT_PASSWORD
(optional; default=None)MQTT_PORT
(optional; default=1883; range=1-65535)MQTT_QOS
(optional; default=1; range=0-2)MQTT_ID
(optional; default='rpi-ws281x')MQTT_PREFIX
(optional; default='rpi-ws281x')MQTT_DISCOVERY_PREFIX
(optional; default='homeassistant')
version: "3.6"
services:
rpi_ws281x:
container_name: rpi_ws281x
restart: unless-stopped
image: pilotak/rpi-ws281x-mqtt
privileged: true
environment:
- LED_GPIO=12
- LED_COUNT=10
This image is ready to be used in HomeAssistant - supports MQTT discovery, for all other purposes, please see topics used below
Send to topic: rpi-ws281x/command
Note: color
and effect
are optional keys, you can send both or just one or none in which case last color selected is used.
{
"state": "ON",
"color": {
"r": 0,
"g": 255,
"b": 0
},
"effect": "Knight Rider"
}
Send to topic: rpi-ws281x/command
{
"state": "OFF"
}
Topic: rpi-ws281x/state
{
"state": "ON",
"color": {
"r": 255,
"g": 109,
"b": 109
},
"effect": "None"
}
Topic: rpi-ws281x/alive
Response: 1
or 0