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
- A 287-2B. The SDK downloads EmoGraphy only from a 287-2B.
- EmoGraphy enabled on the bracelet, with
InitializationConfig.isBiozOrEmographyEnabled = truein the bracelet initialization. See Enable EmoGraphy on the bracelet. - A configuration the SDK accepts. EmoGraphy cannot be enabled together with NIBP (
isNibpEnabled), nor with PPG2 at 128 Hz.enableAutoInitializationandupdateConfigurationrefuse such a configuration; check it withInitializationConfig.isStandard(). - A licence that includes PPG2 raw data. The automatic data transfer downloads the EmoGraphy file only then. See The licence and raw data.
- 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 get | Where it arrives |
|---|---|
| The bracelet's records: cognitive zone, stress level from skin conductance, their quality | manager.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 slot | manager.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}") }
}
emographySummaryUpdatedand the repository callbacks are called on the callback scheduler, the main thread by default. See Data events.manager.metricEdaUpdatedexists, but the SDK does not call it in 3.0.0. To be told about new EmoGraphy data, listen toemographySummaryUpdated, then read the records frommetricEmographyRepository.- A record whose values are all 0 is not stored.
- The slots of the summary have the length of
slotsIntervalSecsin yourDataSdk.Config. See slotsIntervalSecs.
Value ranges, in short (the full tables are on the pages linked above):
| Field | Values |
|---|---|
cognitiveZone, predictiveCZ, czHour | 0 undefined, 1 under-stimulated, 2 balanced, 3 over-stimulated |
stressLevelSkinConductance | 0 to 1000 |
cognitiveZoneQ, stressLevelSkinConductanceQ | Quality, 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).
:::