Skip to content
Aircoookie edited this page Oct 2, 2018 · 23 revisions

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.

  • [mqttTopic0] -> Send brightness as ASCII number 0-255 or the strings "ON", "OFF", and "T" (for toggle)

  • [mqttTopic0]/col -> Send color as HEX (#WWRRGGBB or #RRGGBB) or 32-bit DEC. Hex must have '#','h' or 'H' prefix.

  • [mqttTopic0]/api -> Send a call to the API. You may omit the "win" and just send e.g. "FX=73"

  • [mqttTopic1]

  • [mqttTopic1]/col

  • [mqttTopic1]/api

The topic parts [mqttTopic0] and [mqttTopic1] are customizable in Sync settings. [mqttTopic0] is intended to be unique to one WLED device and just control that device. [mqttTopic1] is intended to control a group of or all WLED devices. Both topics don't send UDP notifications by default, but can be set to do so (e.g. if only one WLED device is connected to the broker and the rest are to be synced via UDP)

Additionally, on light change, WLED will publish to two topics for MQTT clients to know the state of the light.

  • [mqttTopic0]/g -> Contains current brightness as ASCII number 0-255

  • [mqttTopic0]/v -> Contains the XML response that is normally sent after an http API call

Clone this wiki locally