Async Code and Modules
How to use await and promises in the Node-RED Function node, handle async errors, set a timeout, and load extra Node.js modules.
How to use await and promises in the Node-RED Function node, handle async errors, set a timeout, and load extra Node.js modules.
How to remember values between messages in a Node-RED Function node using node, flow, and global context, and how to use timers to delay, debounce, and cancel work.
Ready-to-use Node-RED Function node recipes for filtering, routing, counting, throttling, averaging, detecting changes, quiet hours, and building Home Assistant messages.
A guide to the built-in Node-RED nodes you will use most, including inject, debug, change, switch, template, delay, trigger, filter, and the nodes that handle errors and link flows together.
A tour of the Node-RED editor, including the palette, workspace, and sidebar, how to build and deploy flows, import and export JSON, and back up your work.
Locks
How to connect Node-RED to Home Assistant with the node-red-contrib-home-assistant-websocket palette, including the server config, state and action nodes, JSONata, and reading states from context.
What Node-RED is, how flows, nodes, and messages work, how to install it with Docker, npm, or the Home Assistant add-on, and how to build your first flow.
How data moves through a Node-RED flow in the msg object, how to read and set properties, and how to remember values with node, flow, and global context.
How to send messages from a Node-RED Function node, including multiple outputs, multiple messages, sending later with node.send, finishing with node.done, and how messages are copied.
This example shows a Node-RED flow that watches a hardwired smoke and carbon monoxide (CO) detector, plus a battery powered listener that hears the detector's alarm, in Home Assistant. When any of them goes off, it sends a high priority phone notification and switches the living room lights to a fire alarm scene. When they clear, it sends a quieter notification and puts the lights back.
This example shows a Node-RED flow that keeps a Home Assistant thermostat inside safe limits and reports on its health. All temperatures are in °F.
How to debug Node-RED flows, with fixes for common problems such as nothing happening, undefined errors, Invalid JSON in Home Assistant actions, wrong timezones, lost context, loops, and duplicate notifications.
The basics of the Node-RED Function node, including what it is, how to return a message, the editor tabs, the objects you can use, logging, status, and error handling.