Pulse Ox on watch face problem (SDK 3.2)

Hi all, I need your help trying to understand the difference between 2 methods that I could use to bring the Pulse Ox data to my watch face. The default setting is to show the floors climbed number+icon, but I expected it to switch to the pulse ox icon+percentage as soon as the pulse ox sensor is activated (like during sleep or activity). The idea is that most people use pulseOx for sleep tracking and that while you're asleep, you're not climbing floors.

Initially, I was using this code and got a message from a Venu user saying that the pulse ox was never being displayed:

var pulseOx = null;
if (ActivityMonitor.getInfo() has :currentOxygenSaturation) {
	pulseOx = ActivityMonitor.getInfo().currentOxygenSaturation;
}

if (pulseOx!= null) {
    // draw pulseOx code here
} else {
    // draw floorClimb code here
}

Then I changed the code to the below (to test a different method) and now I got a message from another user (Fenix 6 Pro Solar), where it seems that pulse ox is being shown all the time, even when the sensor is off. In this case, the ox percentage being displayed is from the last time that it was active (it was measured manually a week ago, according to him), even though I'm not using the SensorHistory module.

var pulseOx = null;
if (ActivityMonitor.getInfo() has :currentOxygenSaturation) {
	pulseOx = ActivityMonitor.getInfo().currentOxygenSaturation;
} else if (Activity.getActivityInfo() has :currentOxygenSaturation) {
	pulseOx = Activity.getActivityInfo().currentOxygenSaturation ;
}

The problem is that I don't have an actual watch to test it. Do any of you know what is the actual difference between those 2 methods (ActivityMonitor.getInfo() x Activity.getActivityInfo()) and if the behaviour that I want to do is possible in a watch face?

Thanks!

  • It's in Activity, not ActivityMonitor.  ActivityMonitor is generally the 24/7 stuff like steps and calories.  The info is also in SensorHistory, but last I checked, that still had issues. (the oldest reading was always first on a real device.) Also in Sensor

    Readings are only taken every 15 minutes at most, and saved in SensorHistory once an hour.

  • Thanks , that explains why the first code (ActivityMonitor) didn't work. However, do you know why the Activity method is still showing the last value even when the sensor is not active? Since it's called "currentOxygenSaturation" it shouldn't save the values from an activity that happened a week ago, right? 

    EDIT: Forgot to mention that I don't see that same behaviour on the simulator, it's just users telling me this. On the simulator, when I deactivate the activity mock data, the currentOxygenSaturation returns null.

  • You see the last reading until there is a new one, and like I said, that can be 15 minutes or more.

    To be honest, this is something where you want to be able to test on a real device.  In the case of the SensorHistory in general, in the sim, that's all canned data, so if you want to see changes, you need to use a real device.