Test Node

binderj1

New member
Hallo Leute
Ich habe ein Problem bei dem ich eure Hilfe benötige.
Ich habe mir einen Flow gebastelt, der aber nicht richtig funktioniert.

1742661392745.png
Der Injet-Nod liefert einen Text (msg.payload.E1 "HALLO") dieser soll in Abhängikeit von von "Injet E2" (der Toggelt true/false) bei Ausgang 1 oder Ausgang 2 landen.
Das "HALLO" kommt immer bei Ausgang 2 raus egal was der INJET-E2 toggelt.

Ich bin neu bei Node-red, und hoffe auf eure Hilfe

[{"id":"439acc0ded3ff4d2","type":"inject","z":"a5911143974613fb","name":"OPEN","props":[{"p":"payload.E1","v":"HALLO","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":370,"y":220,"wires":[["1ebe148d41a313de"]]},{"id":"af39ea09f999f888","type":"InjectUltimate","z":"a5911143974613fb","name":"Inject","topic":"E2","curVal":true,"outputJSON":"{ \n\t\"payload\":\"E2\",\n\t\"topic\":\"false\"\n}","x":360,"y":380,"wires":[[],[],["1ebe148d41a313de"],[]],"outputLabels":["","","Toggle",""]},{"id":"1ebe148d41a313de","type":"function","z":"a5911143974613fb","name":"JSON","func":"if (msg.payload.E1 !== undefined) {\n if (msg.payload.E2 === true) {\n return [null, { payload: msg.payload.E1 }]; // E1 → Ausgang 1\n } \n else{\n return [{ payload: msg.payload.E1 }, null];\n }\n}\nelse{\n\nreturn null; // Falls kein E1-Signal existiert, keine Nachricht senden\n} ","outputs":2,"timeout":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":300,"wires":[["d4046f0b4c1128fd"],["b468829235f5493d"]]},{"id":"b468829235f5493d","type":"debug","z":"a5911143974613fb","name":"Ausgang 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":380,"wires":[]},{"id":"d4046f0b4c1128fd","type":"debug","z":"a5911143974613fb","name":"Ausgang 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":220,"wires":[]}]


Vielen Dank
Johannes
 

Zurzeit aktive Besucher

Letzte Anleitungen

Statistik des Forums

Themen
6.506
Beiträge
62.538
Mitglieder
6.709
Neuestes Mitglied
Frank123
Zurück
Oben