I am able to pull my data correctly from Xively, it is from a thermostat and includes current temp, set temp, mode, etc. I have pasted the json response and it includes an array as pasted below.
How do I get my specific value from the "datastreams" array by specifing an id? I have tried writing some javascript and it always returns the first current_value. I am using the assignment as shown below. I have also included the json response to show the array structure:
"status":"live",
"updated":"2014-05-28T22:16:38.401214Z",
"created":"2014-05-19T01:50:18.782800Z",
"creator":"https://xively.com/users/pjacobs4",
"version":"1.0.0",
"datastreams":[
{
"id":"Mode",
"current_value":"2",
"at":"2014-05-28T22:16:38.233371Z",
"max_value":"3.0",
"min_value":"0.0"
},
{
"id":"mode_update",
"current_value":"0",
"at":"2014-05-27T22:45:07.877574Z",
"max_value":"0.0",
"min_value":"0.0"
},
{
"id":"Running",
"current_value":"1",
"at":"2014-05-28T22:16:38.233371Z",
"max_value":"7.0",
"min_value":"0.0"
},
{
"id":"Set_Temp",
"current_value":"70",
"at":"2014-05-28T22:16:38.233371Z",
"max_value":"85.0",
"min_value":"4.0",
"unit":{
"symbol":"F",
"label":"Degrees F"
}
},
{
"id":"Temperature",
"current_value":"72.6",
"at":"2014-05-28T22:16:38.233371Z",
"max_value":"83.5",
"min_value":"0.0",
"unit":{
"symbol":"F",
"label":"deg F"
}
},
{
"id":"temp_set_update",
"current_value":"0",
"at":"2014-05-27T22:44:46.975142Z",
"max_value":"0.0",
"min_value":"0.0"
}
],
"location":{
"name":"Home",
"domain":"physical",
"lat":42.5174949291418,
"lon":-83.089427947998
},