Shouldn't ActiveMinutes contain the current activity?

I'm trying to display the daily active minutes in a DF:

function compute() {
    var activityMonitorInfo = ActivityMonitor.getInfo();
    if (activityMonitorInfo has :activeMinutesDay && activityMonitorInfo.activeMinutesDay != null) { // ciq_2_1_0
        value = (activityMonitorInfo.activeMinutesDay as ActiveMinutes).total;
    }
    return value;
}

I thought it'll return the time including the current activity (which I see is increasing in Activity.getActivityInfo().timerTime). At the beginning I thought it might be a bug in the simulator, but now I saw on fr965 that it's also not increasing on the real device. Is this my misunderstanding or bad wording of the documentation?

Is the right thing to do:

function compute(info as Activity.Info) {
    var activityMonitorInfo = ActivityMonitor.getInfo();
    if (activityMonitorInfo has :activeMinutesDay && activityMonitorInfo.activeMinutesDay != null && info.timerTime != null) { // ciq_2_1_0
        value = (activityMonitorInfo.activeMinutesDay as ActiveMinutes).total + info.timerTime / 60000;
    }
    return value;
}

Or are devices where this will count the current activity twice?

  • I saw on fr965 that it's also not increasing on the real device

    How about on the real device, outside of the context of CIQ? i.e. If you're doing an activity, and you check the active/intensity minutes glance/widget, do the numbers increase? I'm guessing not.

    Whether or not the native behavior makes sense to us, I think it's best if CIQ is consistent with the native behavior. This would be analogous to how the user's aggregate training load is not updated until the current activity is finished (saved or cancelled), even though the activity training load can be displayed in real time. (Yeah I realize the difference is that intensity minutes can be earned outside of an activity. I also realize that steps are accumulated in real time.)

    value = (activityMonitorInfo.activeMinutesDay as ActiveMinutes).total + info.timerTime / 60000;

    You can't just add the current activity time to the total daily active minutes.

    Total active minutes = moderate active minutes + vigorous active minutes * 2.

    Unless you know the exact algorithm Garmin uses to determine which minutes are "vigorous", you won't be able to replicate their calculation.

    https://support.garmin.com/en-CA/?faq=pNU9nnDzzGAHmEavp9rpY8 (How Are Intensity Minutes Earned?)

  • 1. I am OK with the way it works, if that's the intention, but then I'd hope the documentation to be clarified.

    2. Ahhhh, I totally forgot about the vigorous counts twice :) But I don't think I can do much about it. For what I do it's good enough that I count every activity minute once, because I need to know if I reached a goal, so this is a good minimum estimation.