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

Issues with 1.1 Beta 3

ANSWERED

I'm really wondering if this is just me.

 

But I have a all in one kind of watch face that displays heart rate, steps and calories when the display comes on. It was working fine before the update.

 

So I went through the changelog, and some backstory. Even before permissions were being required, my package.json had requested appropriate permissions.

 

After fixing the depreciated warnings for inner text, I find the step count and the calorie count are now completely incorrect random numbers.

 

Code:

 

stepLabel.text = util.fixSteps(today.local.steps);

 

fixSteps is basically a small helper function to add a "," to format the thousands. I confirmed on the today page on the ionic that the steps for today was over 11,000 but the clock face reported only 2512. Caloried burned never changed.

 

calLabel.text = util.fixSteps(today.local.calories);

Also maybe of significance, I used my blaze for a lot of my activities today, as I use it for rigorous sport (not wanting to damage my ionic). I may have only done 2512 steps on the ionic with the rest coming from the blaze. However, prior to this update, this was never a problem.

 

Any confirmation from the dev team as to whats going on ? If what I suspect is the case, there must be a fix for getting the total steps. 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Please create a new app, add the user activity permission, then put this code in it:

 

import { today } from "user-activity";
console.log((today.local.steps || 0) + " steps");
console.log((today.adjusted.steps || 0) + " steps");

What values does that return compared to the values you see in the mobile app?

 

 

 

 

View best answer in original post

Best Answer
0 Votes
6 REPLIES 6

Just a quick mention that there is actually a built in too in Javascript to handle formatting the numbers.

 

.toLocaleString()

as in:

stepGoalLabel.text = goals.steps.toLocaleString();

 

Best Answer
0 Votes

I would also try a reboot, I think someone on Discord mentioned the same issue.

Best Answer
0 Votes

That was actually me. Reboot did not help. 

Best Answer
0 Votes

Please create a new app, add the user activity permission, then put this code in it:

 

import { today } from "user-activity";
console.log((today.local.steps || 0) + " steps");
console.log((today.adjusted.steps || 0) + " steps");

What values does that return compared to the values you see in the mobile app?

 

 

 

 

Best Answer
0 Votes

Ok since most of today I was wearing the same tracker, both the steps were the same, till I switched the trackers just to test and they became different again.

 

Screen Shot 2017-11-10 at 3.01.05 PM.png

 

So as I suspected, the today.local object stores data from the tracker only, while today.adjusted has information from all trackers linked to the account ?

 

So a simple change makes the script work. Maybe the documentation needs to be updated to include this new information.

 

Thanks

Best Answer

Adjusted is the server's value, local is the device's value. The server value has additional processing.

 

The docs do already cover this https://dev.fitbit.com/reference/device-api/user-activity/#interface-today-

Best Answer
0 Votes