HomeHome AutomationNodeRED for beginners: 1. Why do you need a NodeRED server?

NodeRED for beginners: 1. Why do you need a NodeRED server?

To server or not to server? That's a very silly question!

I’ve done art at uni, chemistry and physics in college, I had very little to do with computers until I turned 25. I didn’t start programming and hacking things until I was 32 (I’m 35). It’s often a daunting task to learn a new language, not to mention pick one that will be most useful to you. For this reason alone, I have been avoiding clicking on NodeRED server icon.

But when I pressed the NodeRED icon, I quickly discovered that it uses more traditional JavaScript, as well as, visual programming the to ease you gently into the world of code, programming and the home automation. NodeRed is as simple, and as complicated you want it to be.

In 7 parts, you will learn everything you need to understand the visual aspects of NodeRED as well as the basics of JavaScript.

NodeRED for beginners: server vs ad-hoc

If you are a professional code cruncher (why are you even reading this?) you could find the NodeRED restrictive. To me, NodeRED is a perfect blend of:

  • I don’t know how to code
  • I found this script online“,
  • if I connect these two will it work?

Driven by a purely graphical interface, NodeRED eases you into the world of node.js.

It starts by drawing a line between “nodes” to achieve a simple outcome. Once you master connecting the dots, each node opens a world of customisation, user-generated versions and pure function editors to unleash your inner (amateur) programmer. NodeRED can be as simple as you want it to be and as sophisticated as you can imagine.

The best thing is: You can run NodeRED on virtually anything. I always joke that you could run a NodeRED server on a microwave, but why do so if you can buy Raspberry Pi Zero for $5?

This leads me to the next question: Why would you need a server in the first place?

Why Server architecture?

The world figured out a long time ago that the server structure will be always superior to anything else (apart from the niche, edge-case scenarios). You can disagree, and provide me with a list of options where ad-hoc would do the same thing cheaper, but the sooner you jump to server organised structure, the more you will benefit in the long run.

Let me show you a simple example. A long time ago I have created a Wake on LAN project to control my Desktop PC as the years went by, I scrapped the original ad-hoc style solution and rebuild the WOL system with a NodeRED server architecture. Here are key points to consider:

WOL – wake on LAN example

Waking up a desktop PC using a mobile device.

Ad-hoc

In your typical ad-hoc configuration – a phone would send the magic packet with correct details to the IP of the device you want to wake *(I’m using WOL app). If you want to have feedback once the device is online, the target device has to be configured to notify the phone issuing the WOL request.

For each phone/user/computer, this process has to be configured separately on every device.

Server

In this approach, another device (server) is introduced. You may be thinking that it creates an unnecessary cost and complication for a relatively simple task (you are correct!).

The NodeREe server is a (cheap) investment, and if you planning on adding more features, automation and projects later, it’s a justified expense.

The WOL request is sent to the server, where once processed, the magic packet is sent to the correct device. If feedback is required the target device is configured to talk to the server only. The server will handle the feedback and send the notification back to the phone or all devices required.

Each phone/user/computer has to be configured once. In addition to that input devices only need to issue HTTP requests rather than have designated WOL software.

Benefits

Instantly, you will notice the benefit of this approach. The server architecture is scalable, more flexible and easier to maintain. You can introduce new devices without recreating the entire setup. As long as you send the correct information, the server will know what to do.

At this point, I can use virtually anything to be the trigger. I’m no longer limited to a single device (or device type)  or what causes the WOL request to be sent.

Lastly, your NodeRED server will continue to operate, even if the internet is down. As long as you have no issues with your local network – your flows won’t be affected. Bear in mind that services in use that require internet access (like speed test, voice control) won’t work offline on their own.

Conclusion

It’s true, setting up a NodeRED server for your first home automation task may sound like a lot of work, but give it a go. With time, I can assure you, that you won’t regret your decision. If you already feel comfortable with NodeRED check my other projects out.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

0
Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Sonoff Zigbee Bridge – review

0
Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

DIY Smart Washing Machine – for about 15 bucks!

0
Learn how to add washing machine notifications to your Google Home on the cheap

Nora – Google Assistant in NodeRED

0
Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

Smart Home

Multi-lights for your ceiling from Aqara

0
This is the biggest light I held in my hands so far. It's ZigBee and it comes from Aqara - meet Aqara Ceiling Light T1M

Almost the fastest PIR sensor you can buy

0
ITEAD introduced a new ZigBee sensor - Sonoff PIR (SNZB-03P) which is also the fastest PIR sensor in their line up. Is it good? Read more!

Smart Panel automation by Tuya

0
I'm checking out two smart panels by Tuya. Both run Linux systems, fit inside the wall switch cavity and offer a range of automation options

Adding Matter to Sonoff BasicR4

0
Sonoff goes back to basics with Sonoff BasciR4 - a new and improved basic smart relay - and I'm about to add Matter to it (and Tasmota)

Sonoff Presence Sensor (SNZB-06P) is not what you think

0
This mm wave radar sensor combines cool tech and ZigBee 3.0, but it's not what you think it is. Closer look at Sonoff Presence Sensor