Split a Response from an SSH Client

Hi,
im new to Nodered and need some help with my project.
All in all I have an SSH Client which gets an Command from Nodered and I need to Split the Response into single parts. The Response Shows some text and coords. I need to take the X[m] and Y[m] coords to send an signal when they are in defined range. "Like X[m]= 2.4 until 2.6"
I thought of an Array to split them. But with the "function node" Im not able to create an array. Also my "session.stdout[0] is not defined.
Can you give me some infos, how I need to convert the output of my SSH client for using just the coords ?


You need to use msg.session.stdout[0] to reference it.

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

Forgive me if zenofmud's answer makes this irrelevant...

Assuming that you get a message looking like this
Untitled 2

then a function like this will extract the x and y values as a Javascript object making them much easier to access.
Untitled 3

But if you have control of the device sending the message, you could send the data in object format.

1 Like

Thanks for your answers. Ist works :grin:
Now I have another Problem. I installed boolean for And/ Or functions. „Endlage Tor Zu“ is an Gpio In from my raspberry and it works with my and function but it doesnt matter if i give out an „True“ Or just a „1“ of my function, my and function doesnt Switch through it. There is always an „unknown“ under my function. Can u Tell me whats wrong with my function ?

Edit: msg.plaetze is wrong. Its also msg.payload


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.