-4

I have 5 ESP8266 sensors gathering temperature and humidity data. What's the best way to get the data to display as a line for each sensor's temperature and humidity? The sensor id has a value of ESP

Here is a sample of the data:

{"total_rows":3363,"offset":0,"rows":[
{"id":"357215d4071f05ffd21a9535646c4cde","key":["2015-09-08T05:05:09.240Z","ESP0005"],"value":{"temp":"76.20","humid":"37.80"}},
{"id":"357215d4071f05ffd21a9535646c3dbd","key":["2015-09-08T05:04:55.526Z","ESP0004"],"value":{"temp":"77.70","humid":"38.70"}},
{"id":"357215d4071f05ffd21a9535646c3405","key":["2015-09-08T05:04:53.448Z","ESP0001"],"value":{"temp":"75.00","humid":"39.90"}},
{"id":"357215d4071f05ffd21a9535646c308c","key":["2015-09-08T05:00:09.247Z","ESP0005"],"value":{"temp":"76.20","humid":"38.00"}},
{"id":"357215d4071f05ffd21a9535646c2587","key":["2015-09-08T04:59:55.516Z","ESP0004"],"value":{"temp":"77.10","humid":"38.70"}},
{"id":"357215d4071f05ffd21a9535646c16f2","key":["2015-09-08T04:59:53.444Z","ESP0001"],"value":{"temp":"75.00","humid":"40.20"}},
{"id":"357215d4071f05ffd21a9535646c13c2","key":["2015-09-08T04:55:09.240Z","ESP0005"],"value":{"temp":"76.20","humid":"38.00"}},
{"id":"357215d4071f05ffd21a9535646c0eea","key":["2015-09-08T04:54:55.499Z","ESP0004"],"value":{"temp":"75.50","humid":"38.20"}},
{"id":"357215d4071f05ffd21a9535646c0c3b","key":["2015-09-08T04:54:53.450Z","ESP0001"],"value":{"temp":"75.00","humid":"40.20"}},
{"id":"357215d4071f05ffd21a9535646c05f8","key":["2015-09-08T04:50:09.216Z","ESP0005"],"value":{"temp":"76.20","humid":"37.90"}},
{"id":"357215d4071f05ffd21a9535646c00f5","key":["2015-09-08T04:49:55.526Z","ESP0004"],"value":{"temp":"76.20","humid":"38.60"}},
{"id":"357215d4071f05ffd21a9535646bf808","key":["2015-09-08T04:49:53.448Z","ESP0001"],"value":{"temp":"75.20","humid":"40.30"}},
{"id":"357215d4071f05ffd21a9535646bf4dc","key":["2015-09-08T04:45:09.213Z","ESP0005"],"value":{"temp":"76.40","humid":"38.00"}},
{"id":"357215d4071f05ffd21a9535646be7df","key":["2015-09-08T04:44:55.478Z","ESP0004"],"value":{"temp":"75.70","humid":"38.30"}},
{"id":"357215d4071f05ffd21a9535646be79b","key":["2015-09-08T04:44:53.449Z","ESP0001"],"value":{"temp":"75.30","humid":"40.20"}},
{"id":"357215d4071f05ffd21a9535646bded6","key":["2015-09-08T04:40:09.192Z","ESP0005"],"value":{"temp":"76.20","humid":"38.10"}},
{"id":"357215d4071f05ffd21a9535646bd308","key":["2015-09-08T04:39:55.486Z","ESP0004"],"value":{"temp":"75.90","humid":"38.30"}},
{"id":"357215d4071f05ffd21a9535646bcfa0","key":["2015-09-08T04:39:53.450Z","ESP0001"],"value":{"temp":"75.00","humid":"39.80"}},
{"id":"357215d4071f05ffd21a9535646bcf6f","key":["2015-09-08T04:35:09.182Z","ESP0005"],"value":{"temp":"76.20","humid":"38.10"}},
{"id":"357215d4071f05ffd21a9535646bcbdb","key":["2015-09-08T04:34:55.467Z","ESP0004"],"value":{"temp":"75.70","humid":"38.70"}},
{"id":"357215d4071f05ffd21a9535646bca96","key":["2015-09-08T04:34:53.450Z","ESP0001"],"value":{"temp":"75.20","humid":"40.90"}},
{"id":"357215d4071f05ffd21a9535646bba7e","key":["2015-09-08T04:30:09.187Z","ESP0005"],"value":{"temp":"76.40","humid":"38.10"}},
{"id":"357215d4071f05ffd21a9535646bb6d4","key":["2015-09-08T04:29:55.455Z","ESP0004"],"value":{"temp":"76.20","humid":"38.50"}},
{"id":"357215d4071f05ffd21a9535646badf4","key":["2015-09-08T04:29:53.450Z","ESP0001"],"value":{"temp":"75.00","humid":"40.40"}},
{"id":"357215d4071f05ffd21a9535646ba44e","key":["2015-09-08T04:25:09.161Z","ESP0005"],"value":{"temp":"76.40","humid":"38.20"}},
{"id":"357215d4071f05ffd21a9535646b9652","key":["2015-09-08T04:24:55.441Z","ESP0004"],"value":{"temp":"77.50","humid":"38.80"}},
{"id":"357215d4071f05ffd21a9535646b92b7","key":["2015-09-08T04:24:53.450Z","ESP0001"],"value":{"temp":"75.20","humid":"40.40"}},
{"id":"357215d4071f05ffd21a9535646b890f","key":["2015-09-08T04:20:09.173Z","ESP0005"],"value":{"temp":"76.40","humid":"38.20"}},
{"id":"357215d4071f05ffd21a9535646b7e40","key":["2015-09-08T04:19:55.404Z","ESP0004"],"value":{"temp":"75.90","humid":"38.80"}},
{"id":"357215d4071f05ffd21a9535646b72de","key":["2015-09-08T04:19:53.451Z","ESP0001"],"value":{"temp":"75.20","humid":"40.40"}},
{"id":"357215d4071f05ffd21a9535646b6c9c","key":["2015-09-08T04:15:09.148Z","ESP0005"],"value":{"temp":"76.40","humid":"38.30"}},
{"id":"357215d4071f05ffd21a9535646b68d8","key":["2015-09-08T04:14:55.436Z","ESP0004"],"value":{"temp":"75.50","humid":"38.70"}},
{"id":"357215d4071f05ffd21a9535646b5e3f","key":["2015-09-08T04:14:53.454Z","ESP0001"],"value":{"temp":"75.50","humid":"40.40"}},
{"id":"357215d4071f05ffd21a9535646b5221","key":["2015-09-08T04:10:09.141Z","ESP0005"],"value":{"temp":"76.40","humid":"38.30"}},
{"id":"357215d4071f05ffd21a9535646b4456","key":["2015-09-08T04:09:55.384Z","ESP0004"],"value":{"temp":"75.70","humid":"38.70"}},
{"id":"357215d4071f05ffd21a9535646b3f5c","key":["2015-09-08T04:09:53.456Z","ESP0001"],"value":{"temp":"75.30","humid":"40.40"}},
{"id":"357215d4071f05ffd21a9535646b3579","key":["2015-09-08T04:05:09.125Z","ESP0005"],"value":{"temp":"76.60","humid":"38.30"}}
Mike C
  • 1
  • 1
  • 4
  • Can you show us something more than just the input code? Here is a quickstart guide: [link](https://developers.google.com/chart/interactive/docs/quick_start) and here is a guide to json formatting: [link](https://developers.google.com/chart/interactive/docs/php_example) and here is the actual 'JSON-format' guide: [link](https://developers.google.com/chart/interactive/docs/reference#dataparam) – Henrik Aronsson Sep 17 '15 at 05:51
  • Thank you for your response. But, I'm not sure I understand. I'm assuming people responding to this are already familiar with the different ways you can visualize data using the google charts api. I'm also assuming a certain level of understanding of JSON. A code example would present one to two lines in the chart at best. I'm looking for ideas. It looks like the google line chart would require pivoting the data into columns for each sensor but as you can see the sensors record data at different times so that doesn't make sense to me. Should I be considering a different charting tool? – Mike C Sep 18 '15 at 02:19

1 Answers1

0

After doing some research and prototyping, I'm moving over to Metrics Graphics http://metricsgraphicsjs.org

It appears to be able to handle time series data and is easy to stage the data for the chart tool to consume.

Mike C
  • 1
  • 1
  • 4