Hallo,
im Inject-Node bei Node-RED gibt es die Möglichkeit Flow oder Global auszuwählen.
Ich habe da dann noch einen Variablennamen dahinter geschrieben.
Im Debug-Mode erscheint die Eingabe aber gar nicht.
Kann mir jemand bitte sagen wozu diese beiden Properties da sind und wie man sie verwendet.?
Ich dachte, dass man damit übergreifende Variablen deklariert.
https://nodered.org/docs/user-guide/context
Ja, genau das tut man. Entweder global/überall oder “flow” für jeweils ein “Tab”.
Danke für deine Info,
auf dieser Seite war ich schon mal
Hab folgenden Flow erstellt.
Warum erscheint hinter dem Change Node der alte Zeitstempel
[{"id":"15d32fc2.52b1d","type":"inject","z":"7f53de17.f5acf","name":"","topic":"","payload":"test","payloadType":"flow","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":560,"wires":[["22f7aa75.643816","a4bbaeb2.6712a"]]},{"id":"97938c0b.8659a8","type":"change","z":"7f53de17.f5acf","name":"Test","rules":[{"t":"set","p":"test","pt":"flow","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":680,"wires":[["6501d5bc.ca9b4c"]]},{"id":"6501d5bc.ca9b4c","type":"debug","z":"7f53de17.f5acf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":410,"y":680,"wires":[]},{"id":"22f7aa75.643816","type":"delay","z":"7f53de17.f5acf","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":240,"y":620,"wires":[["97938c0b.8659a8"]]},{"id":"a4bbaeb2.6712a","type":"debug","z":"7f53de17.f5acf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":410,"y":560,"wires":[]}]
Benutz doch bitte die Formatierungsfunktionen des Forums:
Du setzt node.test
und gibst msg.payload
im Debug-Node aus. Was führt dich zu der Annahme, dass in msg.payload
was enthalten ist?
Schau dir mal das hier an:
[{"id":"f307407d.def618","type":"inject","z":"d343035e.cb056","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":200,"wires":[["a8b35a13.52b59","c55a6aec.e34b2"]]},{"id":"ac344098.8a4e88","type":"debug","z":"d343035e.cb056","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":550,"y":320,"wires":[]},{"id":"a8b35a13.52b59","type":"delay","z":"d343035e.cb056","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":360,"y":260,"wires":[["ac344098.8a4e88"]]},{"id":"c55a6aec.e34b2","type":"debug","z":"d343035e.cb056","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":530,"y":200,"wires":[]}]
Hallo, danke für den Hinweis
ich habe das Buch bereits durchgearbeitet
Zu meinen Problemen hab ich darin nichts gefunden
Hab das Buch gerade nicht hier, bin mir aber ziemlich sicher, dass dort die Grundlagen flowbasierter Programmierung und wie das Message-Objekt funktioniert, erklärt ist.
Hat du meinen Beispiel-Flow oben ausprobiert?