Controllers
A Growbud Controller has four outputs. With the Write API, you can switch an output on or off.
To read a Controller, use the Read API. To change schedules, use the Growbud app.
Address
Use the serial on the Controller label, for example F1001003. The outputs are 0 to 3.
GET /sensing/v1/controllers/F1001003
POST /control/v1/controllers/F1001003/outputs/0/switch {"on": true}
The output must have a load type. Set it in the Growbud app. An output without one gets 409 failed_precondition with reason CAPABILITY_MISMATCH.
Switch an output
POST .../outputs/{ch}/switch with {"on": true} sends one command. The Edge Server does not send it again.
Add "retry": true to keep the output in that state. The Edge Server then sends commands until the Controller confirms: 5 commands maximum, for 10 minutes maximum. If the Controller refuses, it does not send again. The answer has desired, with status converging, converged, failed, overridden or superseded.
Wait for the result
Add ?wait=0 to 30 (seconds). You get 200 when the result is final in that time. If not, you get 202 and a poll path. A final result is not always a success. Read command.status.
| Command status | Meaning |
|---|---|
pending | stage is queued or sent. |
confirmed | The Controller reported the new state. |
refused | The Controller did not do the command. reason tells why, for example LEAK_INTERLOCK. |
timed_out | No answer by expiresAt (5 minutes for output commands). A late answer can change it. |
failed | The Edge Server could not send the command. |
Errors
Errors are JSON: {"error": {"code", "message", "reason", "details"}}. See Errors and limits.