From 8bff9acbd81e5b5dd729cb943450ddef8f118b99 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 19 Jan 2019 21:19:06 +0000 Subject: [PATCH] README: Document new device-data API action --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index b988c5d..4a0fdb1 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,17 @@ https://example.com/path/to/api.php?action=device-data-bounds&device-id=18 https://example.com/path/to/api.php?action=device-data-bounds&device-id=11 ``` +### device-data +> Gets data by device given a start and end time. + +Parameter | Type | Meaning +--------------------|-----------|--------------------- +`device-id` | int | The id of the device to get data for. +`reading-type` | string | The type of reading to obtain data for. +`start` | datetime | The starting datetime. +`end` | datetime | The ending datetime. +`average-seconds` | int | Optional. If specified, readings will be grouped into lumps of this many seconds and averaged. For example a value of 3600 (1 hour) will return 1 data point per hour, with the value of each point an average of all the readings for that hour. + ## Notes - Readings are taken every 6 minutes as standard.