0

Chart enhancements
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Chart enhancements

by something_fishy on Fri Jan 12, 2018 6:29 am

Hi
First great product, I'm using a rPi to log temperatures from my heating and have virtually no Linux experience but was able to get sending data to adafruit and charting it up and running in a couple of hours.

A couple of feature requests for the chart block
- more chart types please (it would be good to combine an area chart with a line chart)
- Switchable grid lines for both X and Y axes.
- Ability to generate and chart simple statistical operators eg moving average for last (for eg) 5 observations or moving average +/- 1 st dev etc

And a question, I'm a novice with curl and bash scripts but can I send data for multiple feeds in one POST (and is there an overhead advantage in doing so over sending data to each feed individually). I can work out any syntax that is accepted. All the feeds in question are in the same group (the default group renamed).

Cheers
Eric

something_fishy
 
Posts: 2
Joined: Wed Jan 10, 2018 12:07 pm

Re: Chart enhancements

by abachman on Mon Jan 15, 2018 12:44 pm

Hi Eric. Welcome!

can I send data for multiple feeds in one POST (and is there an overhead advantage in doing so over sending data to each feed individually). I can work out any syntax that is accepted. All the feeds in question are in the same group (the default group renamed).


Yes, you can use the group feed data create endpoint (https://io.adafruit.com/api/docs/#!/Dat ... eGroupData) to publish to multiple feeds in the same group with a single request. Each data point for each feed you write to still counts against your data rate, so there's no advantage with regards to throttling, but you may find it easier to send a single request or you may find it helpful to keep data points lined up with each other.

The URL for that is io.adafruit.com/api/v2/{username}/groups/{group_key}/data and the POST data should look like
Code: Select all | TOGGLE FULL SIZE
{
  "location": {
    "lat": 0,
    "lon": 0,
    "ele": 0
  },
  "feeds": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "created_at": "string"
}


Location and created_at are both optional.

So if I wanted to publish to my office temperature and humidity feeds, the URL would be io.adafruit.com/api/v2/abachman/groups/office/data and the body of the POST request would be
Code: Select all | TOGGLE FULL SIZE
{
  "feeds": [
    {
      "key": "temperature",
      "value": "72.3121223"
    },
    {
      "key": "humidity",
      "value": "53.22131"
    }
  ]
}


The values don't necessarily have to be sent as strings, but they will be converted to strings for storage.

- adam

abachman
 
Posts: 185
Joined: Mon Feb 01, 2010 12:48 pm

Re: Chart enhancements

by something_fishy on Tue Jan 16, 2018 6:27 am

Thank you for the POST and JSON syntax that's exactly what I need.

In overhead I meant in terms of load on the rPi, the network and your servers; it did seem unnecessary sending the authentication tokens with every single data point.

something_fishy
 
Posts: 2
Joined: Wed Jan 10, 2018 12:07 pm

Please be positive and constructive with your questions and comments.