Quickstart
There are two places to call:
| Growbud Cloud | Your Edge Server | |
|---|---|---|
| What you can do | Read sensor data and thresholds | Read and switch outlets and Controllers |
| Address | https://growbud-api-a2a9c.web.app | https://<edge-server>:8443 |
| Cost | Each request is charged from your API balance. See costs. | Free. No charge when it runs on your site. |
| Start | The four steps below | Get the Edge Server |
Get the Edge Server
To switch equipment, install the Edge Server on a computer on your site:
Install on Linux or macOS: version 5.3.10
curl -fsSL https://growbud.io/edge/install.sh | sudo bashRun it on the Edge Server computer. Run it again to upgrade. For Windows, the files, the SHA-256 and the signature, go to Download Edge Server.
Then follow Get the Edge Server to make a token and send your first call.
Read sensor data from the cloud
Read your sensor data from the Read API in four requests. You need a Growbud account with at least one sensor.
1. Get a token
Sign in at growbud.app and make an API token. Keep it secret: it reads every sensor on your account.
export TOKEN=eyJ...
export API=https://growbud-api-a2a9c.web.app
2. List your sensors
curl -s -H "Authorization: Bearer $TOKEN" "$API/api/list-sensors"
The answer has your Growbud sensor serial numbers, and your LoRaWAN sensors in lorawanSensors. Identify a LoRaWAN sensor by its devEui.
3. Read the latest values
curl -s -H "Authorization: Bearer $TOKEN" "$API/api/latest"
With no list, you get every sensor. To read some sensors only, send their serials in square brackets. Use curl -g so that curl sends the brackets as they are:
curl -sg -H "Authorization: Bearer $TOKEN" "$API/api/latest?serialNumbers=[E200201B,E2002022]"
4. Get history
The last 24 hours as CSV:
curl -sg -H "Authorization: Bearer $TOKEN" \
"$API/api/query?duration=24&serialNumbers=[E200201B]&format=csv"
duration is in hours, 1 to 2160. For a LoRaWAN sensor, send devEuis=[70b3d57ed0000002].
Next
- Get the Edge Server: install it and switch your first outlet.
- Authentication: web app tokens and Edge Server tokens.
- Errors and limits: status codes, rate limits and costs.
- Read API reference: every parameter and field.