Storing data into variables | Node-RED Essentials | Tutorial
HTML-код
- Опубликовано: 16 июл 2024
- 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: • Node-RED Function Node...
Useful Links:
Contexts: nodered.org/docs/user-guide/c...
Writing Functions: nodered.org/docs/user-guide/w...
My Node-RED playlist: • Node-RED
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 Наука
Thank you. Very helpful
For the saving variables across node-red restarts section: how do I find the settings.js.
I legit installed Studio Code but there is no folder node red
The default folder has since changed to the Node Red folder within the new 'addon_config' folder. The latter is not visible by default.
To access the .js file, I installed the File editor add-on. By disabling 'Enforce Basepath' in its 'Configuration ' tab, you gain access to 'addon_config'. This alllows you to see the Node Red folder and the .js file you're looking for.