Skip to main content

Stress data

Only available for the 287-2B

Stress data, also called EDA or EmoGraphy. The bracelet computes, from the skin conductance, a stress level and a cognitive zone (under-stimulated, balanced, over-stimulated). The SDK downloads these records, stores them, and builds a summary per day from them.

Requirements​

  1. A 287-2B. The SDK downloads EmoGraphy only from a 287-2B.
  2. EmoGraphy enabled on the bracelet, with InitializationConfig.isBiozOrEmographyEnabled = true in the bracelet initialization. See Enable EmoGraphy on the bracelet.
  3. A configuration the SDK accepts. EmoGraphy cannot be enabled together with NIBP (isNibpEnabled), nor with PPG2 at 128 Hz. enableAutoInitialization and updateConfiguration refuse such a configuration; check it with InitializationConfig.isStandard().
  4. A licence that includes PPG2 raw data. The automatic data transfer downloads the EmoGraphy file only then. See The licence and raw data.
  5. The automatic data transfer for the bracelet. See Data transfer.
val manager = DataSdk.getInstance().getManager()

manager.enableAutoInitialization(
InitializationConfig(
braceletPlan = DevicePlan.CONTINUOUS_GREEN_INTERMITTENT_MULTICOLOR,
samplingRate = SampleRate.ONE_MIN,
isBiozOrEmographyEnabled = true, // also enables BioZ
)
)

Emography data​

When EmoGraphy is enabled on the bracelet, the bracelet records it. The automatic data transfer downloads the file, stores every record as a MetricEmography, and recomputes the daily summaries from the first downloaded day on.

What you getWhere it arrives
The bracelet's records: cognitive zone, stress level from skin conductance, their qualitymanager.metricEmographyRepository: getByTimestampRange(start, end) { records -> }, getAll, getLast. No listener is called, see below. Fields: MetricEmography
A summary per day: the day's average stress level, and the values per slotmanager.emographySummaryUpdated, called once for every day saved after a download. Stored in manager.emographySummaryRepository: getByDate("yyyy-MM-dd") { summary -> }. Fields: EmographySummaryModel
val stressListener = object : ValueUpdated.Listener<EmographySummaryModel> {
override fun onValueUpdated(model: EmographySummaryModel) {
// model.serverDate: the day, "yyyy-MM-dd"
// model.stressLevelSkinConductanceAvg: 0 to 1000, 0 when the day has no value
// model.slots: one EmographySlotModel per slot of the day
showStress(model)
}
}

manager.emographySummaryUpdated.addListener(stressListener)
// When your screen goes away:
manager.emographySummaryUpdated.removeListener(stressListener)

// The records of a period, for example the last hour
val now = System.currentTimeMillis()
manager.metricEmographyRepository.getByTimestampRange(now - 60 * 60 * 1000L, now) { records ->
records?.forEach { Log.d("Corsano-SDK", "${it.date}: zone ${it.cognitiveZone}, stress ${it.stressLevelSkinConductance}") }
}
  • emographySummaryUpdated and the repository callbacks are called on the callback scheduler, the main thread by default. See Data events.
  • manager.metricEdaUpdated exists, but the SDK does not call it in 3.0.0. To be told about new EmoGraphy data, listen to emographySummaryUpdated, then read the records from metricEmographyRepository.
  • A record whose values are all 0 is not stored.
  • The slots of the summary have the length of slotsIntervalSecs in your DataSdk.Config. See slotsIntervalSecs.

Value ranges, in short (the full tables are on the pages linked above):

FieldValues
cognitiveZone, predictiveCZ, czHour0 undefined, 1 under-stimulated, 2 balanced, 3 over-stimulated
stressLevelSkinConductance0 to 1000
cognitiveZoneQ, stressLevelSkinConductanceQQuality, 0 (bad) to 4 (good)

:::note Changed

Earlier versions of this page said that no raw EmoGraphy data is saved. The SDK stores every record in metricEmographyRepository, and keeps it until you delete it. The daily summary is computed from these records, so keep at least the records of the last 2 days (see Delete data).

:::