This is now available via ToyBox SensorHistory. On my watch this value doesn't correspond to the value I see in the glance. Not sure if it's just an old value. Is there an api to get a live / more up to date value?
private function getStress() {
// developer.garmin.com/.../SensorHistory.html
if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getStressHistory)) {
var history = Toybox.SensorHistory.getStressHistory({:period=>1,:order=>Toybox.SensorHistory.ORDER_NEWEST_FIRST});
var sample = history.next();
if (sample != null && sample.data != null && sample.data >=0 && sample.data <= 100) {
return sample.data.format("%02d") + "%";
}
}
return "--";
}