How to read a table with sensor data

Hey there,

i want to read and display measuring data with dashboard nodes.
How is it possible to read a table with already measured values (.csv or .txt) and use the gauge and chart function to simulate that the sensordata is appearing for example like every second.
When I try to read a table I only get the whole information and the gauge and chart function don´t work.
The gauge needs the infomation piece by piece. Ich want the content of each row of the table to be displayed with the gauge or chart every second.

Structure of the table:
sensor a; sensorvalue a; sensor b; sensorvalue b
a;23;b;45
a;24;b;43
...

I hope for some example flows to solve the problem.
Thank you for help.

I would read the data file, send it thru a split node to break it apart to one msg per row. Then send it thru a delay node set to 'Rate Limit' to the time interval you want.

Then you can send the data to both the dauge and the chart.

Note: you may need to add a switch node (or function node) after the split node in case there are header lines you need to remove.

1 Like

Hey zenofmud!
Thank you for your answer.
The way you described works very well!

There is only one little question.
When i´ve got more than only one sensor data in my table i have to separate these values.
How is it possible to split the sensordata of "senor a" and "sensor b" with the split function.
All values are separated with ";".
The split function can´t distinguish between values of "sensor a" and "sensor b".
I hope I can solve the problem.

Thank you!

Do you control the creation of the data? If so, that would be the easiest way to fix it by changing the source

Will it always be in the form of a;value;b;value? If so, after the split, I'd feed it into a change node with this:

[{"id":"79b7f9a0.422198","type":"change","z":"c10ca2df.4c15c","name":"{\"a\":4,\"b\":7}","rules":[{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":":","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"a:","fromt":"str","to":"{\"a\":","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":b:","fromt":"str","to":",\"b\":","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload&\"}\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":120,"wires":[["931162bb.4b297","86f228c2.24a2b8"]]}]

and run the output thru a json node and now you will have a javascript object you can access as msg.payload.a and msg.payload.b

1 Like

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