Skip to main content

Third-Party Control — Controller

Requires Aida Controller 2.30.0 or later.

Integrate lighting, shades, and HVAC from external systems (BMS, cameras, scripts, and other controllers) using simple HTTP. Target Device Groups, zones, floors, or devices by name or ID — no low-level device protocols required.

Base URL: http://<controller-host>/api/v1
(Replace <controller-host> with the controller’s IP or hostname, e.g. 172.16.5.85.)


Authentication​

Use one of the following on each request (do not combine):

MethodHow
API key headerX-API-Key: ak_live_…
HTTP BasicUsername + password, or username api and password = your API key
Bearer tokenAuthorization: Bearer <access_token> from login

Create API keys in the controller UI under Settings → API Keys — see API Keys — Controller.

Basic Auth with an API key (useful when the client cannot set custom headers):

Set an auth string once (username api, password = your API key), then reuse it in curl. Examples in this doc use "$AIDA_AUTH" so sample commands never embed a key.

export AIDA_AUTH="api:<YOUR_API_KEY>" # paste your real key from Settings → API Keys

curl -s -u "$AIDA_AUTH" \
http://<controller-host>/api/v1/control/commands

API key header:

curl -s http://<controller-host>/api/v1/control/commands \
-H 'X-API-Key: <YOUR_API_KEY>'

Endpoints overview​

MethodPathPurpose
POST/control/commandSend a control command
GET/control/levelsRead observed and target levels
GET/control/commandsList supported commands and aliases

JSON request bodies are accepted with:

  • Content-Type: application/json (recommended), or
  • Content-Type: text/plain, or
  • no Content-Type header

as long as the body is valid JSON. This helps constrained clients (for example some camera HTTP command engines).

Successful commands appear in Command History as api:event:<command> (for example api:event:light:level). Scene activate is labeled api:scene.


Targeting​

Except for scene (targets are stored on the scene), every command and levels query must include at least one target:

Field / query paramAccepts
groupDevice Group name or UUID
zoneFacility zone name or UUID
floorFloor name or UUID
deviceDevice display name, IP/address, serial number, or UUID
  • Name matching is case-insensitive.
  • If more than one selector is provided, results are the intersection (AND).
  • Prefer group names configured in the controller (including resource groups such as a single lamp under a Matter bridge).

Names with spaces (GET query strings)​

Query values must be URL-encoded. A space is %20 (or +).

# Encoded by hand
curl -s -u "$AIDA_AUTH" \
'http://<controller-host>/api/v1/control/levels?group=Conference%20Room%20A'

# Safer: let curl encode
curl -s -u "$AIDA_AUTH" -G \
'http://<controller-host>/api/v1/control/levels' \
--data-urlencode 'group=Conference Room A'

POST JSON bodies do not need encoding for spaces — send the name as normal JSON text:

{ "command": "light:level", "params": { "level": 50 }, "group": "Conference Room A" }

POST /control/command​

Request body​

{
"command": "light:level",
"params": { "level": 80, "delay": 0 },
"group": "Lobby",
"zone": null,
"floor": null,
"device": null
}
FieldRequiredDescription
commandYesCommand name (see catalog below). Optional prefix api:event: is accepted and ignored for dispatch.
paramsNoCommand parameters (level, delay, cct, rgbw, scene / scene_id, …). Target fields may also be placed inside params for clients that send a single JSON object.
group / zone / floor / deviceAt least one*Target selectors (name or id). *Not used for scene — targets are defined on the scene; send params.scene (name) or params.scene_id only.
resource_pathsNoAdvanced: manually scope multi-endpoint gateways. Usually omit — the controller resolves paths from Device Group memberships automatically. Not accepted with scene.

Success response​

{
"control_event": "light:level",
"label": "api:event:light:level",
"success_count": 1,
"failed_device_ids": [],
"attempted": 1
}

GET /control/levels​

Query parameters: group, zone, floor, device (at least one; encode spaces as above).

Returns observed (reported) and target (last commanded) levels per channel, plus color fields when available.

curl -s -u "$AIDA_AUTH" -G \
'http://<controller-host>/api/v1/control/levels' \
--data-urlencode 'group=Lobby'

Example response (shape abbreviated):

{
"devices": [
{
"device_id": "…",
"device_name": "Hue Bridge",
"group": "Lights",
"resource_paths": ["matter/nodes/1/endpoints/2"],
"levels": [
{
"label": "Hue color lamp 1",
"kind": "light_rgbw",
"observed": 100.0,
"target": 40.0,
"paths": ["matter/nodes/1/endpoints/2"]
}
],
"state": { "dim": 100 },
"updated_at": "…"
}
]
}

GET /control/commands​

Returns the live command catalog and aliases for this controller. Use this to discover names after updates.

curl -s -u "$AIDA_AUTH" \
http://<controller-host>/api/v1/control/commands

Command catalog and examples​

Below are typical commands. Aliases such as dim → light:level are also accepted; call GET /control/commands for the full alias map.

Unless noted, examples use Basic Auth via -u "$AIDA_AUTH" (see Authentication). Replace the host and target names for your site.

Lights — level (dim)​

Command: light:level
Params: level (0–100), optional delay (minutes before final level)

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"light:level","params":{"level":40,"delay":0},"group":"Lobby"}'

Turn off (level 0):

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"light:level","params":{"level":0},"group":"Hue-Lamp1"}'

Lights — on / off​

Commands: light:on, light:off (also discrete on / off where supported)

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"light:on","group":"Lobby"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"light:off","group":"Lobby"}'

Lights — color temperature (CCT)​

Command: light:cct
Params: cct (Kelvin, e.g. 2700–6500), optional dl (dim level; default keeps intensity)

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"light:cct","params":{"cct":5000},"group":"Hue-Lamp1"}'

Lights — RGB / RGBW​

Commands: light:rgb, light:rgbw
Params: nested rgbw with r, g, b, w (0–255) and optional dl (dim)

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{
"command": "light:rgbw",
"params": {
"rgbw": { "r": 255, "g": 0, "b": 0, "w": 0, "dl": 100 }
},
"group": "Lobby"
}'

Discrete / policy events​

Commands: on, off, up, down, stop, s1, s2, s3, mot, vac

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"on","group":"Lobby"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"off","group":"Lobby"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"s1","group":"Lobby"}'

Shades​

CommandParamsDescription
shade:levellevel or position (0–100)Move to position
shade:open—Open
shade:close—Close
shade:stop—Stop
shade:jog_up / shade:jog_downoptional jog stepNudge
curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"shade:level","params":{"level":50},"group":"West Facade"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"shade:open","group":"West Facade"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"shade:close","group":"West Facade"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"shade:stop","group":"West Facade"}'

Thermostat​

CommandParamsDescription
thermostat:levelsetpoint fields as configured for the deviceSet temperature
thermostat:up / thermostat:down—Nudge setpoint
thermostat:heat / thermostat:cool / thermostat:auto / thermostat:off—Mode
curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"thermostat:auto","device":"Conference Thermostat"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"thermostat:heat","device":"Conference Thermostat"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"thermostat:off","device":"Conference Thermostat"}'

Fan​

Commands: fan:on, fan:off, fan:auto

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"fan:auto","device":"Conference Thermostat"}'

curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"fan:on","device":"Conference Thermostat"}'

Scene​

Command: scene
Params (one of):

  • scene or scene_name — scene name (case-insensitive; must be unique)
  • scene_id — scene UUID

Targets are defined inside the scene — do not send group / zone / floor / device.
History label: api:scene

# By name (typical for cameras / Alarm Task Engines)
curl -s -X POST http://<controller-host>/api/v1/control/command \
-u "$AIDA_AUTH" \
-H 'Content-Type: application/json' \
-d '{"command":"scene","params":{"scene":"All Off"}}'

Constrained clients (cameras / Alarm Task Engines)​

Many camera systems support only:

  • URL + query string
  • HTTP Basic (or Digest)
  • A plain JSON body

They often cannot set X-API-Key or Content-Type: application/json.

Recommended pattern:

  1. Authenticate with Basic Auth (api / ak_live_…).
  2. POST to /api/v1/control/command with a JSON body (even if Content-Type is text/plain or omitted).
  3. Prefer high-level commands (light:level, light:cct, light:rgbw) instead of raw device protocol calls.

PowerShell (Windows) example:

$user = "api"
$key = "<YOUR_API_KEY>" # paste your real key from Settings → API Keys
$basic = [Convert]::ToBase64String(
[Text.Encoding]::ASCII.GetBytes("${user}:${key}")
)
Invoke-RestMethod -Method POST `
-Uri "http://<controller-host>/api/v1/control/command" `
-Headers @{ Authorization = "Basic $basic" } `
-ContentType "text/plain" `
-Body '{"command":"light:level","params":{"level":0},"group":"Hue-Lamp1"}'

Quick reference — all canonical commands​

FamilyCommands
Discreteon, off, up, down, stop, s1, s2, s3, mot, vac
Lightlight:level, light:cct, light:rgb, light:rgbw, light:on, light:off
Shadeshade:level, shade:open, shade:close, shade:jog_up, shade:jog_down, shade:stop
Thermostatthermostat:level, thermostat:up, thermostat:down, thermostat:heat, thermostat:cool, thermostat:auto, thermostat:off
Fanfan:on, fan:off, fan:auto
Scenescene

New commands added on the controller appear automatically in GET /control/commands.


Errors (typical)​

HTTPMeaning
400Missing target, invalid body, or ambiguous auth (more than one auth method)
401Missing or invalid credentials
403Authenticated but not allowed to control
404Group / zone / floor / device name or id not found, or no matching devices
502 / 504Downstream device did not complete the command (check Command History and device connectivity)

Notes for integrators​

  • Device Groups can represent a whole room or a single fixture (for example one lamp under a multi-endpoint gateway). Using the group name is usually enough; the controller applies the correct endpoint scope.
  • Observed vs target: after a command, target updates immediately; observed updates when the device reports state. A short delay before re-reading levels is normal.
  • Use UUIDs in automation if site names may change; use names for human-readable camera / BMS configs.
  • Always URL-encode spaces and special characters in GET query parameters.