Hi there! I would like to ask, how to integrate a variable into a join push message, so that the join push node only sends a variable? Using the % in the node's 'message" doesn't seem to work. Thank you!
Hi there! Check the end part of this tutorial: https://notenoughtech.com/home-automation/how-to-use-join-app-in-nodered/ (Advanced Push Object). There you can use anything you like Hope this helps!
Sorrily, it does not help If I make a function node, populating it with the following msg.text = '%AirCondOn'; msg.devices = "Galaxy Note9"; return msg; Where %AirCondOn is a global variable within nodered, it just sends %AirCondOn, not the value.
Tried that too, nodered gives me this error: "ReferenceError: AirCondOn is not defined (line 1, col 12)"
Seems like the variable is not defined then. Do you know how to usually access that variable from a function node?
Yes I overlooked something, and just found out thats not how I access that variable... I use a function node: var ObtainedData = global.get("AirCondOn") msg.payload = ObtainedData; return msg; and then another function node msg.text = msg.payload; msg.devices = "Galaxy Note9"; return msg; this way, it works. Thanks anyways
I can't believe what's happening. Literally I made this mentioned flow as a test flow, with a simple inject at the start. var ObtainedData = global.get("AirCondOn") msg.payload = ObtainedData; return msg; and then another function node msg.text = msg.payload; msg.devices = "Galaxy Note9"; return msg; It worked by itself. When I copied it into the desired place, it now gives me another error: msg : string[20] "text needs to be set" What the hekk is going on?
Yea tried that too, gives the same error, and doesn't send anything. What I don't get is how is it even possible, that it worked (I didn't only looked at the flow, I checked my phone, where the flow sent the variable, and it did send the variable value), I copied, and suddenly it doesn't work. Tried rewriting the every node, tried restarting node-red itself, no success... Maybe tomorroww by itself, it will work again.
Works again, using () - which I don't even understand... msg.devices = "Galaxy Note9"; msg.text = (msg.payload); return msg;