-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
MQTT
WLED versions from 0.8.0 up are able to connect to an MQTT broker for smart home control. Connection to both domains and IP servers is supported on port 1883.
WLED will subscribe to up to six topics to change the state of the lights.
-
[mqttDeviceTopic]
-> Send brightness as ASCII number 0-255 or the strings "ON", "OFF", and "T" (for toggle) -
[mqttDeviceTopic]/col
-> Send color as HEX (#WWRRGGBB or #RRGGBB) or 32bit DEC. Hex has '#','h' or 'H' as prefix. -
[mqttDeviceTopic]/api
-> Send a call to the API. You may omit the "win" and just send e.g. "FX=73" -
[mqttGroupTopic]
-
[mqttGroupTopic]/col
-
[mqttGroupTopic]/api
The topic parts [mqttDeviceTopic] and [mqttGroupTopic] are customizable in Sync settings.
If [mqttGroupTopic] is left empty, it will not subscribe to anything. An empty [mqttDeviceTopic] will instead be replaced with the default "wled/macaddr".
[mqttDeviceTopic] is intended to be unique to one WLED device and just control that device.
[mqttGroupTopic] is intended to control a group of or all WLED devices.
UDP notifications will be sent just as if the change was done via the UI or HTTP API. More control over UDP functions from MQTT will be added in the future.
Additionally, on light change, WLED will publish to two topics for MQTT clients to know the state of the light.
-
[mqttDeviceTopic]/g
-> Contains current brightness as ASCII number 0-255 -
[mqttDeviceTopic]/c
-> Contains current color as HEX (#RRGGBB if white is 0, else #WWRRGGBB)
The connection to the MQTT server might cause lag in some circumstances. The boot time of the ESP may also be longer. There is no support for authentication/encryption at this time.
- List of effects and palettes
- Macros & Button
- Multi strip
- Presets
- Segments
- Webserver sitemap
- Control a relay
- Blynk
- DMX Output
- E1.31 (DMX) / Art-Net
- UDP Realtime / tpm2.net
- HTTP Request API
- Infrared
- JSON API
- MQTT
- Philips hue sync
- WebSocket
- WLED UDP sync