Storing data into variables | Node-RED Essentials | Tutorial @lets-automate
Storing data into variables | Node-RED Essentials | Tutorial  @lets-automate
Uploaded August 2023 | Updated September 2026, 6 hours ago
Working with contexts, flow and global variables in Node-RED is a valuable skill when building complex automations.

Using JSON and JavaScript makes it a fairly intuitive experience in Node-RED.

I show you examples using the Change Node and the Function Node; these are both very useful nodes.

Check out my video on the Function Node: youtu.be/mXVcxXI0jM0

Useful Links:

Contexts: nodered.org/docs/user-guide/context
Writing Functions: nodered.org/docs/user-guide/writing-functions

My Node-RED playlist: youtube.com/playlist?list=PL79iw4ttpsPfZ_fF3vjMmXmY-Rb_d-A3P

00:00 Intro
00:42 Change Node - Setting string variables
03:11 Change Node - JSON Strings & JS Objects
04:56 - Saving variables across Node-RED restarts
06:46 Change Node - Clearing / removing variables
07:33 Global Variable example with Home Assistant entity
08:58 Function Node - Storing and retrieving from variables
11:20 Local / Node context - Accessing data just within a node
12:42 Outro

#nodered
Storing data into variables | Node-RED Essentials | TutorialHome Assistant Release April 2023.4Beginners Guide to Node-RED in Home AssistantMake API Calls with Node-RED | TutorialSwitchBot Lock  | 9 Month VerdictUGREEN NAS DXP4800 Plus | Run Home Assistant, Virtual Machines, DockerSeptember Release | Home Assistant 2024.9Home Assistant 2024.5 | May ReleaseHome Assistant Friendly Hub! | SwitchBot Hub 3Connect Home Assistant to Apple Home & Google Home | Matter Hub Add-OnBest Retrofit Smart Lock so far? | Aqara U200Home Assistant Release August 2023.8
Lets Automate |

Storing data into variables | Node-RED Essentials | Tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER