ReferenceHTTP API
motionZones
The motionZones router: 3 methods of the motion-zones capability, with tier, scope, input and output.
Capability motion-zones · scope device · mode singleton · source packages/types/src/capabilities/motion-zones.cap.ts:57.
Every method is called at /trpc/motionZones.<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 |
getOptions | query | protected | view | yes |
setZone | mutation | admin | admin only | no |
motionZones.getStatus
- Kind: query —
GET /trpc/motionZones.getStatus(added by the framework) - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitymotion-zones, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=motionZones.getStatuson your hub
Input
{ deviceId: number }Output
MotionZoneStatusSchemaShapes: MotionZoneStatusSchema
motionZones.getOptions
- Kind: query —
GET /trpc/motionZones.getOptions - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitymotion-zones, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=motionZones.getOptionson your hub
Input
{ deviceId: number }Output
MotionZoneOptionsSchemaShapes: MotionZoneOptionsSchema
motionZones.setZone
- Kind: mutation —
POST /trpc/motionZones.setZone - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=motionZones.setZoneon your hub
Input
{ deviceId: number; patch: MotionZonePatchSchema }Output
voidShapes: MotionZonePatchSchema