Node-Red
Node-Red is a browser based tool to let you quickly and easily construct your own logic of handling various IoT devices, including subscribing the MQTT messages, listening to HTTP requests, reading and writing to Databases, publishing to MQTT brokers and responding to HTTP requests. It also allows you to define specific functions written in JavaScript to provide complex logic operations, while using a visual, easy to use, drag-and-drop user interface to link different components and logic together.
Node-Red is a very light weighted run time built on top of Node.js, taking full advantage of its event-driven, non-blocking model of operation.
A Node-Red node is a function block which consists of at least one input, some internal logic, and zero or more output. Data is usually carried via the msg.payload though it can be carried by other properties under msg.
A node can also be configured to access to certain resources such as file from the file system, a database, MQTT messages, or the local hardware I/O, for example, I/O pins on a Raspberry Pi.
The MQTT nodes are for talking with the MQTT brokers. In this project, there are a number of MQTT nodes listening to various topics from the weather stations, these include for example, the temperature of the balcony as shown in above picture, or the relative humidity of the bed room, or even more generic ones such as when the station is online and ready, etc..
Other MQTT nodes are for publishing messages to the broker, which in turn the broker will distribute these published messages to its subscribers. These messages including controlling the color of the MagicLight (see my upcoming post on MagicLight) to give a color-coded temperature reading outside of the house (from purple = very cold to Red = very hot) so that I don't have to go and check the figures on the console - I could just look at the color and I'll know if it is warm outside (yellow), or if it is super cold (blue, purple).
Other published messages also include the current temperature and relative humidity to other IoT devices' consumption, such as a LCD display console utilizing the HMI displays (see my other post on this one). You can imagine this could expand to controlling the Air Conditioner, or turn on the fan automatically. All sorts of these control logics can be centrally managed and implemented by using Node-Red and connected via MQTT. No fuzz, no difficult programming involved!
I am running my Node-Red service on my Mac Mini which is also serving as a media station connected to a HDTV. I have also tried to host the Node-Red on my Raspberry Pi 2 and the result is not bad at all. There, you have the flexibility.
Comments
Please log in or sign up to comment.