Browse developer docs

Submit an IoT command

POSTfarm-device-action

Request

Send POST to /open/service with serviceName=farm-device-action and the common signing parameters.

Send extra fields in the JSON body

The command and parameters depend on the hardware. Confirm execution using the command log and device state.

This operation submits a change. Replace the illustrative values, confirm access, and review the intended action before sending a signed request.

Illustrative payload
{
  "org_id": "YOUR_FARM_ID",
  "fs_sn": "YOUR_FARM_SERVER_SN",
  "device_id": "YOUR_DEVICE_ID",
  "model_type": 16,
  "action_name": "<supported command>",
  "params": {}
}
ParameterRequirementMeaning
org_idRequiredAuthorized farm or organization ID.
fs_snRequiredFarm server serial from farm-server-list.
device_idRequiredDevice ID from the inventory.
model_typeRequiredIoT hardware type identifier.
action_nameRequiredCommand identifier for the installed equipment.
paramsRequiredModel-specific command argument object.
params.open_status1ConditionalOpening percentage for a valve port. Use open_statusN for the selected port and set only one port per request.
params.switchConditionalSwitch state, with 1 for on and 2 for off.
params.target_frequencyConditionalTarget inverter frequency in Hz for supported controllers.
params.ratioConditionalGate opening percentage for a supported flood-irrigation gate.

Response

Reconcile the command through the operation log and verify the observed hardware state. The example object leaves device-specific command parameters for the integrator.

Show example response fields and types
{
  "status": "number",
  "data": {
    "operId": "number"
  },
  "message": "string"
}

All Smart Farm operations

Location
Richmond Hill, Ontario, Canada