ReferenceHTTP API
control
The control router: 6 methods of the control capability, with tier, scope, input and output.
Capability control · scope device · mode singleton · source packages/types/src/capabilities/control.cap.ts:104.
Every method is called at /trpc/control.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getStatus | query | protected | view | yes |
setValue | mutation | protected | create | yes |
next | mutation | protected | create | yes |
previous | mutation | protected | create | yes |
first | mutation | protected | create | yes |
last | mutation | protected | create | yes |
control.getStatus
- Kind: query —
GET /trpc/control.getStatus(added by the framework) - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitycontrol, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=control.getStatuson your hub
Input
{ deviceId: number }Output
ControlStatusSchemaShapes: ControlStatusSchema
control.setValue
- Kind: mutation —
POST /trpc/control.setValue - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitycontrol, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=control.setValueon your hub
Input
{ deviceId: number; control: { kind: "numeric"; value: number } | { kind: "select"; value: string } | { kind: "text"; value: string } | { kind: "datetime"; value: string } }Output
voidcontrol.next
- Kind: mutation —
POST /trpc/control.next - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitycontrol, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=control.nexton your hub
Input
{ deviceId: number; cycle?: boolean = true }Output
voidcontrol.previous
- Kind: mutation —
POST /trpc/control.previous - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitycontrol, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=control.previouson your hub
Input
{ deviceId: number; cycle?: boolean = true }Output
voidcontrol.first
- Kind: mutation —
POST /trpc/control.first - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitycontrol, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=control.firston your hub
Input
{ deviceId: number }Output
voidcontrol.last
- Kind: mutation —
POST /trpc/control.last - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitycontrol, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=control.laston your hub
Input
{ deviceId: number }Output
void