Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculate AZM (Active Zone Minutes)

Several devices are now being upgraded to Active Zone Minutes (AZM).  Charge 4 has had it for a while, but now Ionic and Versa 2 devices do, too.  According to several articles on teh web, it will be rolled out to several more devices, as well.  

 

It seems the Web API no longer reports the information to calculate Active minutes (Active minutes = veryActiveMinutes + fairlyActiveMinutes) for these devices.  Our users who own these devices now see 0 minutes when using our app.  We have been told that the API will *eventually* support AZM, but not until "some time this fall".  

 

What can we do to calculate AZM for these users in the interim?

 

Thanks!

Best Answer
10 REPLIES 10

We started looking into the calculation, and it seems easy enough to do.  However, there seems to also be a mismatch with the API's minutes in the Fat Burn, Cardio, and Peak heart rate zones.  Here's a snippet from an actual user:

 

      "heartRateZones": [
        {
          "caloriesOut": 331.89828,
          "max": 109,
          "min": 30,
          "minutes": 264,
          "name": "Out of Range"
        },
        {
          "caloriesOut": 368.94207,
          "max": 129,
          "min": 109,
          "minutes": 139,
          "name": "Fat Burn"
        },
        {
          "caloriesOut": 4.3995,
          "max": 155,
          "min": 129,
          "minutes": 1,
          "name": "Cardio"
        },
        {
          "caloriesOut": 0,
          "max": 220,
          "min": 155,
          "minutes": 0,
          "name": "Peak"
        }
      ],

According to this data, the user should see 139 + (1 x 2) = 141 Active Zone Minutes.  However, she sees 24 in the Fitbit app.  After interviewing the users, it's clear that the minutes in these heart rate zones are way off.  

 

In short, there's a discrepancy between the minutes in the heartRateZones data structure and what is used to calculate AZM.

Best Answer

Hey Fitbit folks!  Any updates on AZM hitting the Web API?  It's been pretty painful for our users who can't correlate their AZM on their device and their Active minutes we get through the API.

Best Answer

It would help a lot to know how to calculate it or a time frame to get it from web api.

Best Answer
0 Votes

Heart rate zones are calculated differently when using AZM, compared to active minutes. Details here. Be careful: last time I checked, some of the maths in the examples was wrong.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Welp, I'm hopping into this today.  Tomorrow morning I'll add a Versa to my collection and see if I can make the data and the math work, though from these other posts it seems like that may be unlikely.

 

It would be appreciated to see AZM data provided in the Web API in a NVP like activeZoneMinutes or whatever.

Best Answer
0 Votes

Thanks for the link, Gondwana.  That filled in one more detail I was missing.  

 

From that article, it looks like it's not possible to use the Activity Time Series API or the Activity API to calculate AZM.  The reason is because the data provided by Fitbit's Web APIs use 50% HRR for bottom of the Fat Burn Zone, but AZM uses 40% as the bottom.  Afaict, it's not possible to figure out how many minutes the user spent between 40% and 50% HRR from the Web API.  Is it?

Best Answer

@JohnAtPaceline wrote:

...AZM uses 40% as the bottom...


I don't think this is true, in general. AZM takes resting heart-rate into account when calculating the zone thresholds, whereas AM doesn't. Worse, resting heart-rate changes on a daily basis.

 

You can get intra-day heart-rate values and compare with the zone thresholds at the time, but that would be rarely worth the effort.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Hi @JohnAtPaceline,

 

I'm not sure I quite understand, so please correct me if I have misunderstood. You should still be able to see active minutes with the addition of AZM. For example, if you query the Get Activity Logs List endpoint, you'll be returned with each activity's AZM and active minutes elements. For example:

{
  "activities": [
    {
      "activeDuration": 14603000,
      "activeZoneMinutes": {
        "minutesInHeartRateZones": [
          {
            "minuteMultiplier": 2,
            "minutes": 0,
            "order": 2,
            "type": "CARDIO",
            "zoneName": "Cardio"
          },
          {
            "minuteMultiplier": 0,
            "minutes": 0,
            "order": 0,
            "type": "OUT_OF_ZONE",
            "zoneName": "Out of Range"
          },
          {
            "minuteMultiplier": 1,
            "minutes": 21,
            "order": 1,
            "type": "FAT_BURN",
            "zoneName": "Fat Burn"
          },
          {
            "minuteMultiplier": 2,
            "minutes": 0,
            "order": 3,
            "type": "PEAK",
            "zoneName": "Peak"
          }
        ],
        "totalMinutes": 21
      },
      "activityLevel": [
        {
          "minutes": 0,
          "name": "sedentary"
        },
        {
          "minutes": 12,
          "name": "lightly"
        },
        {
          "minutes": 138,
          "name": "fairly"
        },
        {
          "minutes": 93,
          "name": "very"
        }
      ],

Can you clarify if this is the data you were referring to?

 

Best Answer
0 Votes

Hi @JohnFitbit,

 

I do see that it's possible to get some AZM from the Get Activity Logs List endpoint, but it seems like there are common cases where the Fitbit mobile app shows a number of AZM that's not retrievable from this endpoint. For example, we have a user who registered 2 AZM on a particular date (shows as "2 Zone Minutes" on her app), but when we query Get Activity Logs for her, there are zero entries for that date. Indeed, her app doesn't show any activities for that date either, but it does show steps and those 2 AZM. This isn't the only date and user for which this is the case.

 

Is there any other place we can reliably get AZM in all cases from the API? In particular, it would seem to make sense to just put the total AZM somewhere in Get Daily Activity Summary, as a clear single value, computed on Fitbit's servers using the same logic that's used to populate the mobile app. Previous posts in this thread show it's difficult if not impossible to replicate this logic given what's available in the API.

Best Answer

I just stumbled upon the same problem. Is there any solution to it?

The total summary is not in the daily summary stats and the Get Activity Logs List endpoint only returns AZM for specific activities, so the total which is shown in the fitbit app almost never matches unfortunately.

Best Answer
0 Votes