Skip to main content

Device State (lamp.device_state)

Records screen on/off events, lock/unlock events, and battery level. This sensor does not record time spent in specific apps or notification counts.

Configurationโ€‹

  • SensorSpec: lamp.device_state
  • Sampling: Continuous (one event per state change)
  • Platform: iOS, Android

Usageโ€‹

Events are generated automatically whenever the device state changes. No participant action is required.

Dataโ€‹

Fieldsโ€‹

FieldTypeDescription
valueintegerNumeric state code (see table below)
representationstringHuman-readable state name
battery_levelfloatBattery level as a decimal (e.g., 0.85 = 85%)

State Codesโ€‹

ValueRepresentationMeaning
0screen_onScreen turned on (by user or notification)
1screen_offScreen turned off (by user or timeout)
2lockedDevice locked (by user or timeout)
3unlockedDevice unlocked by user

Exampleโ€‹

{
"timestamp": 1649465295573,
"sensor": "lamp.device_state",
"data": {
"value": 1,
"representation": "screen_off",
"battery_level": 0.07
}
}

Cortex Featuresโ€‹

device_state (raw) โ†’ screen_active (primary) โ†’ screen_duration, screen_unlocks, screen_unlock_duration, screen_wakes, inactive_duration, battery_level (secondary)

View in Portal | Python SDK | API Reference