forked from futureshocked/NodeRed-ESP32-TerrariumController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Global-Variables-context-examples-flows.json
1 lines (1 loc) · 1.85 KB
/
Global-Variables-context-examples-flows.json
1
[{"id":"a5daa7e2.9e07a8","type":"tab","label":"Global Variables & context examples","disabled":false,"info":""},{"id":"5d0226fd.838028","type":"comment","z":"a5daa7e2.9e07a8","name":"Documentation source","info":"For more information on how to use variables and scope, please see https://nodered.org/docs/user-guide/context.","x":320,"y":80,"wires":[]},{"id":"15cf074f.7f72a9","type":"inject","z":"a5daa7e2.9e07a8","d":true,"name":"Get temperature","topic":"","payload":"temperature","payloadType":"global","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":340,"wires":[["1c4ef0a9.eb9bff"]]},{"id":"1c4ef0a9.eb9bff","type":"debug","z":"a5daa7e2.9e07a8","name":"Show global temperature","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":810,"y":340,"wires":[]},{"id":"4d69f08a.829d6","type":"inject","z":"a5daa7e2.9e07a8","d":true,"name":"Get humidity","topic":"","payload":"humidity","payloadType":"global","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":400,"wires":[["621b0867.162678"]]},{"id":"621b0867.162678","type":"debug","z":"a5daa7e2.9e07a8","name":"Show global humidity","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":800,"y":400,"wires":[]},{"id":"72f93ebb.a4aaa","type":"function","z":"a5daa7e2.9e07a8","name":"Set global and flow variables","func":"humidity = global.get(\"humidity\", msg.humidity);\ntemperature = global.get(\"temperature\", msg.payload);\n\nreturn [{payload: temperature},{payload:humidity}];","outputs":2,"noerr":0,"x":420,"y":220,"wires":[["1c4ef0a9.eb9bff"],["621b0867.162678"]]},{"id":"237d0468.1af89c","type":"inject","z":"a5daa7e2.9e07a8","name":"Trigger","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":220,"wires":[["72f93ebb.a4aaa"]]}]