Andy Stanford-Clark and I updated the backend systems that make CheerLights work. We now process the incoming CheerLights tweets with Node-RED and update three IoT platforms using MQTT. This new system allows for different ways to get access to the latest CheerLights color and to build your display or application.
Node-RED is a graphical programming tool for wiring together hardware devices, APIs, and online services. The CheerLights flow passes text from tweets that contain either “#CheerLights” or “@CheerLights” and looks for color names. When there are matches, the flow sends the colors to our supported IoT platforms. Node-RED is helping people of all skills build new applications and take advantage of event-based applications with no-code and low-code.
And, while we were at it, we made some other fixes and updates:
CheerLights now supports long tweets. Twitter used to support 140 characters and over the years, they expanded to 280 characters. CheerLights was still processing the first 140 characters. We would miss color mentions in long tweets. We now have that fixed, thanks to an assist by Andy Piper, a developer advocate at Twitter. We can now catch “red” at the very end of this long tweet.
CheerLights handles multiple colors mentioned in the tweet. You can mention multiple colors in one tweet. We take each color send them along and add a short delay in between. This is a good reason to use MQTT for your CheerLights display. Your lights will change as the colors get processed instead of having your lights continually ask for the latest color. Check out the latest CheerLights API documentation for how to subscribe to CheerLights color using MQTT.
Comment on “Updates to the CheerLights System: Node-RED and MQTT”