Acknowledged
over 1 year ago

Stress iterator is null on Instinct 2

The following calls return null when trying to get the stress history on an Instinct 2:

        if (Toybox.SensorHistory has :getStressHistory) {
            return Toybox.SensorHistory.getStressHistory(
                {:period  => null});
        }
        if (Toybox.SensorHistory has :getStressHistory) {
            return Toybox.SensorHistory.getStressHistory(
                {:period  => null, :order => SensorHistory.ORDER_OLDEST_FIRST});
        }
However this call does not and I can read the last stress value
if (Toybox.SensorHistory.getStressHistory({:period=>1})!=null){
     ............
}
Version info
  • Device Name: Instinct 2 APAC
  • Firmware Version: 13.21

An update to this. Both these snippets also return a null iterator:

        if (Toybox.SensorHistory has :getStressHistory) {
            return Toybox.SensorHistory.getStressHistory(
                {:period  => 360, :order => SensorHistory.ORDER_OLDEST_FIRST});
        }
        if (Toybox.SensorHistory has :getStressHistory) {
            return Toybox.SensorHistory.getStressHistory(
                {:period  => 360});
        }
  • This was not on a watch that I have, but one of my users.  He reports that stress data was visible in his Garmin Connect Mobile app.  On the watch my 3rd example call proved that there was stress data because I could read the latest value. But that was all I could read.

  • I tried running all of these on an Instinct 2 and was able to get a non-null stress sample from the stress iterator after wearing the device for awhile to record some stress history. Are you certain the device has any data recorded for stress history?