adds code

Control Smart Devices with Node-RED and Alexa

Originally published: 2020-06-16

Pairing Alexa with Node-RED turns voice commands into triggers for your own automation flows: you say a phrase, and a flow you control switches a relay, dims a light, or fires any logic you have built. This guide walks through how that connection works, what runs locally versus in the cloud, and how to reproduce the setup shown in the video below on a current Node-RED install.

Quick answer: Connect Node-RED to Alexa through a smart-home skill with a bridge, or through the node-red-contrib-alexa-remote2 palette, which talks to Amazon’s Alexa web API. Voice recognition always makes a cloud round trip — Amazon’s servers interpret the speech — but the device switching itself can stay local when Node-RED drives devices over MQTT on your own network.

Watch: Alexa and Node-RED working together

The video shows the full loop on a real setup: Node-RED running in Docker, a flow with a device named “Kitchen Lights”, and a voice command that switches it on and off. Watch how the device gets a unique name and how the Alexa skill is linked to the Node-RED bridge — those two steps are where most setup mistakes happen.

How do Alexa voice commands reach Node-RED?

There are two common paths, and both start in the cloud because Alexa’s speech recognition runs on Amazon’s servers:

  • Smart-home skill plus bridge: the approach shown in the video. A skill in the Alexa app (search for “Node-RED Smart Home Control”) links your Amazon account to a bridge service, and devices you define in the bridge appear to Alexa as real plugs or lights. The video uses a third-party bridge; if a bridge service is unavailable, the palette route below is the maintained alternative.
  • node-red-contrib-alexa-remote2: a Node-RED palette that connects to Amazon’s Alexa web API with your account credentials. It can trigger routines, send announcements to Echo devices, and read device state, which lets Node-RED and Alexa talk in both directions (palette page).

What works locally and what needs the cloud?

The split is simple: voice interpretation is always cloud, device switching can be local. If your flow drives a Tasmota-flashed Sonoff relay over a local MQTT broker, the actual switching happens on your LAN in milliseconds — Alexa only supplies the trigger. If your internet connection drops, voice commands stop working, but time-based and sensor-based Node-RED flows keep running untouched.

Practical tip: put the logic in the flow, not in the voice. Treat Alexa as a convenience layer for hands-full moments, and let Node-RED rules (schedules, thresholds, sensor input) do the real automation. That way the system degrades gracefully instead of going dark with the internet.

How do you set up the flow from the video?

  1. Install Node-RED, for example in Docker: docker run -it -p 1880:1880 --name mynodered nodered/node-red — the editor then lives at http://127.0.0.1:1880.
  2. Open Manage palette and install the Alexa nodes you plan to use (search for “alexa” — the video’s era used the alexa-smart-* bridge nodes; today node-red-contrib-alexa-remote2 is the common choice).
  3. Create a flow with one device and give it a unique, natural name such as “Kitchen Lights” — Alexa discovery matches on these names, so “Lights” alone will collide with everything else in your home.
  4. Enable the skill in the Alexa app and link the account the flow expects, then say “Alexa, discover devices”.
  5. Wire the flow’s output to a debug node first and confirm the voice commands arrive before attaching real hardware.

Which first device should you automate?

Voice control is the gateway into smart homes, and for most people the first Alexa-automated device is a smart plug: it needs no wiring, and it makes an ordinary lamp instantly voice-controllable. Before buying, check measured specifications rather than box claims — load rating, standby draw, and whether the plug supports local control, which matters for Node-RED users who want switching to stay on the LAN. Our compare smart plugs on verified specs page collects exactly those numbers.

If you buy through links on the sites we recommend, we may earn a small commission.

Frequently Asked Questions

Does Alexa work without internet?

No. Speech processing runs in Amazon’s cloud, so voice commands need a connection. Node-RED flows that do not depend on voice — schedules, sensor rules, MQTT logic — keep running offline.

Do I need a Sonoff or specific hardware to follow this?

No. Any MQTT-capable device works, and if you have nothing to switch yet, debug nodes let you complete the whole tutorial and watch voice commands arrive in the editor.

Can Node-RED trigger Alexa instead of the other way around?

Yes. With node-red-contrib-alexa-remote2, flows can send announcements or trigger routines on Echo devices — useful for alerts like “the greenhouse got too cold”.

Further reading

Sources

Previous Post Next Post