This installment covers the Node-RED setup.
- Gather parts.
- Set up Node-RED on the main Raspberry Pi and register it with Amazon Echo Dot [This article]
- Headless WiFi setup for Raspberry Pi Zero W
- Copy IR remote codes with Raspberry Pi
- Call IR functions from Node-RED to control the TV
- Control Arduino over HTTP API using FlashAir GPIO mode
- (Bonus) Control Roomba from Arduino via ROI serial interface
- Control Roomba from Arduino via IR
- Control Roomba from Node-RED via FlashAir/Arduino
Check on Amazon Another approach for Alexa home control is IFTTT.
But with IFTTT, you'd have to say:
"Alexa, trigger Roomba!"
which sounds like something designed to give the author a neck injury.
Actually, if all you need is "trigger ON," IFTTT might be fine for that.
What is Node-RED?
Anyway — combining Node-RED with Alexa lets you say something natural like
"Alexa, ask Roomba to clean"
and have it actually work.
Node-RED is a flow-based development environment.
Despite being called a "development environment," no coding is generally needed.
It runs as a web app on the Raspberry Pi, and you configure logic by dragging and connecting blocks in a browser.
Available nodes include GPIO, shell command execution, email, HTTP request/response, and other Raspberry Pi-friendly actions.
Adding an Alexa Home Skill node through the extension system is what ties it all together.
Setup
For Raspberry Pi general setup, see the earlier post:
"Setting Up Raspberry Pi as a File Server"
To install Node-RED on Raspberry Pi, run the following.
The update takes 20–30 minutes — be patient.
$ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
Run the Node-RED web server as the pi user.
Since it executes shell commands, avoid running as root.
That said, if Node-RED is accessible from outside, user-level permissions are a concern regardless — so don't overthink it.
Start Node-RED with:
$ node-red-start
Then access "http://{raspberry-pi-ip}:1880/" from a browser.To enable auto-start on reboot:
$ sudo systemctl enable nodered.service
Alexa Home Skill
Next, add the Alexa nodes to Node-RED.Most guides for "Node-RED Alexa" recommend using the Node-RED Alexa Home Skill Bridge ("Bridge"), but it's actually not necessary.
From the Node-RED settings menu (top right), select "Manage Palette."

In the "Install" tab, search for "node-red-contrib-alexa" to find several options.
Use "node-red-contrib-alexa-local" for this project.
node-red-contrib-alexa-local is a local Home Skill that works without the Bridge.
If you want to use the Bridge, use "node-red-contrib-alexa-home-skill" instead.
The difference is minimal — if anything, the local version is more stable since it doesn't depend on an external server, and everything is configurable within Node-RED.
Either way, Home Skill nodes don't require building a custom Alexa skill, which keeps things simple.
On the other hand, functionality is limited — it's basically designed for light control, with three capabilities:
ON/OFF
Saying "turn on [device]" sends an ON/OFF command to the node.Alexa seems to recognize non-light verbs too: "Roomba, clean" was interpreted as ON.
Relative Value
Saying "make [device] brighter" sends +1; "lower it" sends -1.The keyword matching is flexible: "make [device] louder" also works.
However, "raise the TV volume" didn't work in testing.
Absolute Value
Saying "set [device] to 10" sends the value 10.This can be used to change TV channels: "set TV to 8" = switch to channel 8.
Create a device named "Channel" and say "set Channel to 8" for a cleaner command.
Creating the Alexa Home Skill Node
From the left panel in Node-RED, drag an "alexa local" node from "input" and add it to the flow.Double-click it and name it "ルンバ" (Roomba in Japanese). This name is what you say to Alexa — naming it "Roomba" (in English/katakana) might not be recognized correctly depending on the locale.

Add a "debug" output node and connect it to the "Roomba" node.
The "debug" node prints received messages to the console.
Click "Deploy" in the top right to apply changes.
Connecting Amazon Echo
Node-RED setup is done for now.Say "Alexa, discover devices" and wait a moment.
If you hear "I found a new device called Roomba" — success.
Say "Alexa, ask Roomba to clean" and something should appear in Node-RED's debug console.
Next: stepping away from Alexa and Node-RED to build the IR remote control.

No comments:
Post a Comment