I recently discovered the Node Red tool and almost immediately fell in love. I was about to write something like that myself when I found out about it and so far it does everything the way I would expect it: you could call it if-this-than-that for your home automation/internet of things projects.
|I needed a high activity Twitter hash tag. What could be more
active today than #FIFAgate?
My first little project was to pass on a twitter feed through MQTT to a NodeMCU ESP8266 module with an attached OLED display. It was super easy and even more versatile than I expected. I can now shift away the logic from the ESPs which are always short on RAM to the central node running on a Raspberry Pi. The stream can then easily be setup in the browser. As soon as you press “deploy” the changes will become visible on the OLED display.
|The twitter flow: get the tweets from twitter, beautify them a little
throttle the news feed to not overload the ESP and send them to the
ESP over MQTT.
|The data flow: Twitter, Node Red, NodeMCU (Lua), Oled display|
Now a beer! Did you like this post? It often takes me several hours of my free time to write one. If I was your neighbour would you offer me a beer for the hard work I did for you? The beauty is: beers can be teletransported with a painless donation using Paypal. A beer in a Swiss bar costs about USD $4.80. Or use this affiliate link if you order something on Banggood and I'll get a small kickback. Thank you!
I also started using Node Red to do all my "heavy lifting" .It runs on a rPi2 along with Mosquitto with WebSockets.
You're right – this lets the ESP modules just do one thing.
That sure keeps things simple.
I have sensors that monitor temp, humidity, barometric pressure, vibration, light, presence (PIR, ) control mains outlets, control LED strips, etc – each ESP just doing one or two simple tasks and listening to or publishing to mqtt.
I also have made two "mqtt Message Centers".
One is written in Lua and uses the .96" i2c oled.
It listens to my root topic – "home/#"
It displays the last two topic/payload pairs and scrolls them up as more come in.
The second one uses an i2c 4×20 display. The little .96" is pretty hard to read with my old eyes.
It listens to the topic "home/msgBoard".
It takes a comma-delimited message and displays four lines, like
"line 1, line 2, line 3, line 4" so Node Red just formats up whatever I want to display on it.
I want to change that one to listen for another topic, like "home/setTopic".
It would take that message and change it's subscription to listen to whatever topic I choose.
I've also thought about having a scroll up, scroll down button that would let me scroll through the message history. Haven't figured that one out yet.
That one's written in the ESP-Arduino environment.
I'm going to make a few more of these to use like a message board for the family stuck to the refrigerator, etc.
All this has really got me wanting to get a 3D printer to make nice enclosures!That's next on my hobby budget.
Actually, it was your comment on the forum which made me try Node Red! So thanks for putting the idea in my head. I was almost starting to program sth like Node Red myself;-).
As for the scrolling of the display, I might have just the solution for it but I didn't have time to try it out yet: I was thinking of using sth like carousels you see for picture or the different "home screens" on the iPhone: you have some bullets on the bottom, the filled one shows on which one you currently are. Every few seconds the screen moves from one bullet or view to the next. Everyone of these screens could listen to a specific topic, which you can control from Node Red, you just have to define the number of views on the ESP…