Hi everyone,
I'm Andi, a software developer at u::Lux in Austria.
We've recently added MQTT support to our u::Lux Switch IP, a compact wall-mounted controller with a color display and four physical buttons.
After connecting various devices and systems via MQTT, including Shelly, Tasmota, Zigbee devices through Zigbee2MQTT, and data from our own solar PV system, we wanted to explore how Node-RED could help to integrate additional devices and services.
We've put together two example flows: controlling a Sonos speaker with bidirectional MQTT communication and displaying weather information from OpenWeatherMap.
Sonos – control and status feedback via MQTT
For the Sonos example, we're using two existing Node-RED packages:
-
node-red-contrib-sonos-plusfor sending commands -
node-red-contrib-sonos-eventsfor receiving status updates
The wall controller publishes commands to the MQTT topic sonos/command. Node-RED receives the JSON messages and forwards the corresponding commands to the Sonos speaker.
In the other direction, Node-RED listens to Sonos events and publishes the relevant information to separate MQTT topics:
| MQTT topic | Information |
|---|---|
sonos/state/volume |
Current volume |
sonos/state/playstate |
Playback state |
sonos/state/content/artist |
Artist |
sonos/state/content/title |
Track title |
sonos/state/content/station |
Station name |
The controller subscribes to these topics and updates its display accordingly.
This allows us to control playback and volume using the physical buttons while displaying the current Sonos status and information about the playing content.
Because the feedback comes from Sonos events, the display can also reflect changes made through the Sonos app.
The flow also clears the displayed track information when playback is no longer active.
Weather – OpenWeatherMap to MQTT
Our second example uses node-red-node-openweathermap to retrieve current weather information.
The Node-RED flow is deliberately simple:
Inject → OpenWeatherMap → MQTT Out
An Inject node triggers a weather request every 15 minutes, with an initial request shortly after Node-RED starts.
The OpenWeatherMap node retrieves the current weather data for the configured location and publishes the resulting payload to the MQTT topic weather.
On the u::Lux side, the required values are extracted from the MQTT payload and displayed using a custom weather layout.
The example requires an OpenWeatherMap API key, a location and an MQTT broker.
Example flows and configuration
Both Node-RED examples are included in our free u::Lux IoT Designer, together with setup instructions.
The IoT Designer is used to configure the display layouts, button functions and MQTT variables. It also includes a virtual u::Lux Switch, allowing the MQTT communication to be tested on a Windows PC without purchasing any hardware.
We've also created a video tutorial showing how to import the example flows, configure the MQTT broker and set up the Sonos and OpenWeatherMap nodes.
Video tutorial: https://youtu.be/7LcCybR_uQY
Both Node-RED example flows, including setup instructions, are included in the free u::Lux IoT Designer. https://www.u-lux.com/en/support-2/downloads/
Beyond Sonos and weather
These are just two examples of how we're using Node-RED with our MQTT-enabled controller.
The same approach can be used to connect other devices, APIs and data sources supported by Node-RED. The controller exchanges commands and status information through configurable MQTT topics and payloads, while Node-RED handles communication with the respective systems.
Just wanted to share what we've been working on. Happy to answer any technical questions about the flows or MQTT configuration!
Andi | u::Lux



