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):
| Method | How |
|---|---|
| API key header | X-API-Key: ak_live_… |
| HTTP Basic | Username + password, or username api and password = your API key |
| Bearer token | Authorization: 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
| Method | Path | Purpose |
|---|---|---|
POST | /control/command | Send a control command |
GET | /control/levels | Read observed and target levels |
GET | /control/commands | List supported commands and aliases |
JSON request bodies are accepted with:
Content-Type: application/json(recommended), orContent-Type: text/plain, or- no
Content-Typeheader
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 param | Accepts |
|---|---|
group | Device Group name or UUID |
zone | Facility zone name or UUID |
floor | Floor name or UUID |
device | Device 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
}
| Field | Required | Description |
|---|---|---|
command | Yes | Command name (see catalog below). Optional prefix api:event: is accepted and ignored for dispatch. |
params | No | Command 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 / device | At 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_paths | No | Advanced: 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
| Command | Params | Description |
|---|---|---|
shade:level | level or position (0–100) | Move to position |
shade:open | — | Open |
shade:close | — | Close |
shade:stop | — | Stop |
shade:jog_up / shade:jog_down | optional jog step | Nudge |
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
| Command | Params | Description |
|---|---|---|
thermostat:level | setpoint fields as configured for the device | Set 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):
sceneorscene_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:
- Authenticate with Basic Auth (
api/ak_live_…). POSTto/api/v1/control/commandwith a JSON body (even if Content-Type istext/plainor omitted).- 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
| Family | Commands |
|---|---|
| Discrete | on, off, up, down, stop, s1, s2, s3, mot, vac |
| Light | light:level, light:cct, light:rgb, light:rgbw, light:on, light:off |
| Shade | shade:level, shade:open, shade:close, shade:jog_up, shade:jog_down, shade:stop |
| Thermostat | thermostat:level, thermostat:up, thermostat:down, thermostat:heat, thermostat:cool, thermostat:auto, thermostat:off |
| Fan | fan:on, fan:off, fan:auto |
| Scene | scene |
New commands added on the controller appear automatically in GET /control/commands.
Errors (typical)
| HTTP | Meaning |
|---|---|
400 | Missing target, invalid body, or ambiguous auth (more than one auth method) |
401 | Missing or invalid credentials |
403 | Authenticated but not allowed to control |
404 | Group / zone / floor / device name or id not found, or no matching devices |
502 / 504 | Downstream 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,
targetupdates immediately;observedupdates 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.
Related
- API Keys — Controller
- API Docs — Controller (Swagger — control tag)
- MCP Server — Controller