Use Node-RED to work with IoT in the browser with very little code! For this week's exercise, I created a HTTP endpoint that displays the red, green, and blue readings from my sensor.
With Node-RED’s drag-and-drop nodes, I subscribed to my red, green, and blue MQTT topics, converted those readings to integers, joined them into an array, and printed that to a log file. Then, I implemented a GET request to display the array on an HTML page.
Ideally I’d figure out how to incorporate that data into CSS code to update the background color of the page. For now, I’ve posted the current setup below: