How to access the coming data printing with curly braces?

I'm getting some data from my digital ocean server to arduino Yun. On my serial monitor, data is coming okay, but it has curly braces with it.

So in my server side javascript, I'm sending data with data and time:

io.on('connection', function(socket){
console.log('a user connected');

socket.on("start",function(data){
console.log(data);

var seconds = new Date().getTime() / 1000;
uvData.add({sensor: data, time: seconds});

})

});

and I'm getting those data from arduino every five seconds:

/*
Yún HTTP Client

This example for the Arduino Yún shows how create a basic
HTTP client that connects to the internet and downloads
content. In this case, you'll connect to the Arduino
website and download a version of the logo as ASCII text.

created by Tom igoe
May 2013

*/

#include <Bridge.h>
#include <HttpClient.h>

void setup() {
// Bridge takes about two seconds to start up
// it can be helpful to use the on-board LED
// as an indicator for when it has initialized
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
digitalWrite(13, HIGH);

Serial.begin(9600);

while (!Serial); // wait for a serial connection
}

void loop() {
// Initialize the client library
HttpClient client;

// Make a HTTP request:
client.get("http://104.131.94.5:3000/getdata");

// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char data = client.read();
Serial.print(data);

}

delay(5000);
}

And from serial monitor in Arduino, it's printing like following:

{"sensor":"0.02","time":1458829507.398,"_id":"ZyiqUiWFJYWDcqe7"}

So if the sensor value is greater than certain value(0.02), I would like to turn on/off led..but how do I point that value in the sketch? since it's printing inside the curly braces, I'm not sure how I can access to it..

Any help would be appreciated..thank you!!

The data with the curly braces looks like JSON notation.

To get your data out of it, you will have to do some parsing of the string, look for the "sensor" term, then skip over the colon character, and extract the next value inside of quotes. It can be done in your sketch, but it would be far more efficient to do it on the Linux side.

The way I would approach it is to write a Python script to fetch the data from your getdata URL. Then process that data with a little bit of Python code, where there are readily available libraries to parse JSON data formats. Basically, use the Python PyCURL library to get your data with the curly braces, then use the Python json library to parse it. Once you have your data value, simply print the value out. You can test that script by just running it from the command line, and see what it prints.

Then, if you need to get that data into your sketch, use the Bridge Library's Process class to run your Python script. Whatever the Python script prints out (that which shows up when running it from the command line) can be read by the sketch by reading from the Process object.

The whole idea is to do as much work as possible on the Linux side where the resources are greater and the coding is easier (because there are libraries to do most of the work) and then just send the digested data up to the sketch where it can control the devices that are attached to the Yun.

There are many ways to accomplish what you want, but that's the way I would approach it. In fact, rather than send the sensor values up to the sketch, you may want to do your threshold checks inside the Python script and simply send an on/off value up to the sketch.

Thank you for your reply.What kind of function can I use in arduino to get certain value within curly braces ? Since I'm using servi js and save data using database, I'm not sure how I can parse those data with Python JSON library.