Device Configuration Commands

How to configure Thingsee PRESENCE — Service API commands and GraphQL examples

Overview

Thingsee PRESENCE is configured remotely through the Service API (GraphQL) — named commands with built-in validation and automatic encoding.

This page documents the available commands and provides ready-to-use examples. For detailed parameter explanations, tuning guidance, and configuration scenarios, see Configuration.


Service API Commands

The Service API provides named configuration commands that handle CBOR encoding, delivery, and validation automatically. Use these through the Service API (GraphQL).

Available Commands

CommandPurposeParameters
SetDeviceConfigurationConfigure PIR behaviormode, threshold, enableLed, passiveReportInterval
GetDeviceConfigurationRead current PIR configuration
SetReportIntervalSet active reporting frequencyreportInterval
GetReportIntervalRead current report interval

SetDeviceConfiguration

Configures PIR sensor behavior: operating mode, sensitivity, LED indicator, and idle reporting interval.

Parameters:

ParameterTypeRangeDefaultDescription
modeInteger1–22Operating mode: 1 = Occupancy, 2 = Visitor counter
thresholdInteger80–1060150PIR detection sensitivity (lower = more sensitive)
enableLedInteger0–10LED indicator on detection (0 = off, 1 = on)
passiveReportIntervalInteger300–864003600Idle reporting interval in seconds

Set occupancy mode with default sensitivity:

mutation {
  setDeviceConfiguration(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      mode: 1
      threshold: 150
      enableLed: 0
      passiveReportInterval: 3600
    }
  ) {
    success
  }
}

Set visitor counter with high sensitivity:

mutation {
  setDeviceConfiguration(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      mode: 2
      threshold: 100
      enableLed: 0
      passiveReportInterval: 7200
    }
  ) {
    success
  }
}

GetDeviceConfiguration

Reads the current PIR configuration from the device.

query {
  getDeviceConfiguration(
    vendorSerial: "TSPR04-xxxxxxxx"
  ) {
    mode
    threshold
    enableLed
    passiveReportInterval
  }
}

SetReportInterval

Sets how often the sensor reports measurements during active periods.

Parameters:

ParameterTypeRangeDefaultDescription
reportIntervalInteger10–8640060Active reporting interval in seconds
mutation {
  setReportInterval(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      reportInterval: 60
    }
  ) {
    success
  }
}

GetReportInterval

Reads the current report interval.

query {
  getReportInterval(
    vendorSerial: "TSPR04-xxxxxxxx"
  ) {
    reportInterval
  }
}

Quick Configuration Recipes

Desk Occupancy Monitoring

Binary occupied/vacant status with hourly heartbeats:

mutation {
  setDeviceConfiguration(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      mode: 1
      threshold: 800
      enableLed: 0
      passiveReportInterval: 3600
    }
  ) {
    success
  }
}

Doorway Visitor Counting

Count movements every 60 seconds:

mutation {
  setDeviceConfiguration(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      mode: 2
      threshold: 150
      enableLed: 0
      passiveReportInterval: 3600
    }
  ) {
    success
  }
}
mutation {
  setReportInterval(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      reportInterval: 60
    }
  ) {
    success
  }
}

Installation Testing

Enable LED and fast reporting to verify sensor placement:

mutation {
  setDeviceConfiguration(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      mode: 2
      threshold: 150
      enableLed: 1
      passiveReportInterval: 3600
    }
  ) {
    success
  }
}
mutation {
  setReportInterval(
    input: {
      vendorSerial: "TSPR04-xxxxxxxx"
      reportInterval: 10
    }
  ) {
    success
  }
}

For more configuration scenarios and detailed parameter tuning, see Configuration.