Folium: Metrics
The folium resources lets you access the data from your folium sensors on demand and in JSON format.
Resources
GET /folium/users/profile
GET /folium/sensors
GET /folium/sensors/metrics
GET /device/folium/metrics
Get the user profile
GET /folium/users/profile
Request your user profile. You will need to obtain your organisation ID to complete the proceeding requests.
Request Headers
Content-Type: application/json
Authorization: <token>
Parameters
username: "string"
Example Request
curl https://api.autogrow.com/v1/folium/users/profile?username=<username>
HTTP/1.1 200 OK
Response Object
{
"profile": {
"org_ids": ["string"],
"created": 0,
"updated": 0,
"language": "ENG",
"confirmed": "timestamp",
"trial_period": 30,
"alerting": {
"emails": [
{
"email": "string",
"confirmed": true
},
{
"email": "string",
"confirmed": true
}
],
"email_alert": true,
"mobiles": [
{
"mobile": "string",
"confirmed": true
},
{
"mobile": "string",
"confirmed": true
}
],
"mobile_alert": true
},
"units": {
"date_format": "dd/mm/yy",
"temperature": "C",
"ec": {
"ec_unit": "CF",
"tdscs": 0
}
},
"marketing": {
"first_name": "string",
"last_name": "string ",
"country": "string"
}
}
}
Error Response
{
"error_message": "string",
"error_type": "string"
}
Response Codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Internal Server Error |
503 | Service Unavailable |
Get a list of Folium sensors
GET /folium/sensors
Get a list of Folium sensors. The device_id
field will be what is required to request metrics for a specific Folium sensor.
Request Headers
Content-Type: application/json
Authorization: <token>
Parameters
username: "string"
org_id: "string"
Example Request
curl https://api.autogrow.com/v1/folium/sensors?username=<username>&org_id=<org_id>
HTTP/1.1 200 OK
Response Object
{
"devices": [
{
"device_id": "string",
"device_name": "string",
"device_type": "string",
"checked": 0
}
]
}
Error Response
{
"error_message": "string",
"error_type": "string"
}
Response Codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Internal Server Error |
503 | Service Unavailable |
Retrieve the metrics for a Folium sensor
GET /folium/sensors/metrics
This endpoint will allow you to get the metrics for a given folium sensor.
Request Headers
Content-Type: application/json
Authorization: <token>
Parameters
device: "string"
org_id: "string"
Example Request
curl https://api.autogrow.com/v1/folium/sensors/metrics?device=<device_id>&org_id=<org_id>
HTTP/1.1 200 OK
Response Object
{
"connected": true,
"folium-sensor": {
"analog_voltage": 375,
"battery_voltage": 2616,
"co2": 660,
"co2_calibation_count": 0,
"external_power": false,
"last_co2_calibration": "2020-07-30T10:50:22+12:00",
"last_updated": "2020-07-31T10:50:22+12:00",
"lean_angle": 0,
"par": 168.0975,
"par_raw": 155,
"pressure": 1020,
"rad": 28.99837899632436,
"rad_raw": 80,
"raw_data": "AOoAEQKUApsAUAB3ATgK/AMAAAA=",
"raw_data_string": {
"analog": "0x0177",
"battery": "0x0A38",
"co2": "0x0294",
"lean": "0x00",
"par": "0x009B",
"pressure": "0x03FC",
"rad": "0x0050",
"rh": "0x0211",
"status": "0x00",
"temp": "0x00EA"
},
"rh": 52.9,
"status_byte_raw": 0,
"temperature": 23.4,
"timestamp": 1596149422
},
"last_updated": 1596149501,
"status": null
}
Error Response
{
"error_message": "string",
"error_type": "string"
}
Response Codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Internal Server Error |
503 | Service Unavailable |
Retrieve historical folium metrics
GET /device/folium/metrics
Request the measurement data for an organisation and folium sensor group for a given time range.
This returns at most 1500 points. To retrieve all metric data for all sensors in a group, update the from_date and make the call to this API iteratively.
Request Headers
Content-Type: application/json
Authorization: <token>
Request Body
{
"group": "folium-group name",
"from_date": 1589685128,
"to_date": 1623899533,
"org_id": "string",
"metrics": [
"temperature",
"rh",
"pressure",
"co2",
"par",
"rad",
"est_vpd",
"dewpoint",
"vwc",
"vpd",
"plant_temp"
],
"points": 1500
}
Example Request
The group_id is mandatory and can be substituted with one of the device_id
from the output of https://api.autogrow.com/v1/devices
curl -X POST -d '{"from_date": <fromdate_epoch>, "to_date": <todate_epoch>, "org_id" : "<organisation id>", "group_id" : "<group_id>"}' https://api.autogrow.com/v1/device/folium/metrics
HTTP/1.1 200 OK
Response Object
{
"points": [
{
"sensor_id": "string",
"timestamp": 1623843240000,
"metrics": {
"co2": 446,
"dewpoint": 13.9,
"est_vpd": 1.2,
"par": 0,
"pressure": 1007,
"rad": 0,
"rh": 56.9,
"temperature": 22.9,
"vwc": 17
}
},
{
"sensor_id": "string",
"timestamp": 1623757680000,
"metrics": {
"co2": 332,
"dewpoint": 12.2,
"est_vpd": 0.7,
"par": 0,
"pressure": 1008,
"rad": 0,
"rh": 66.8,
"temperature": 18.5,
"vwc": 17
}
}
]
}
Error Response
{
"error_message": "string",
"error_type": "string"
}
Response Codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Internal Server Error |
503 | Service Unavailable |