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

Miles displaying inaccurate on Versa once over specific milage

ANSWERED

Hi there,

 

I am experiencing a reoccurring issue where the milage displays low (between 1-4 miles) when the user is over 10 miles. Milage works perfectly on ionic, (always displaying as miles how I would like it).

 

Also, the battery life on this clock face drains very quickly. Is it possible it is updating while idle or repeating a line of code. Any idea what is might be?

 

Thank you so much. I appreciate your help.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

 

I can't see anything obvious which would cause battery drain. Have you tried without the hrm module? Perhaps the setTimeout()/clearTimeout() isn't behaving correctly.

 

Here's what I've been using for distance:

 

import userActivity from "user-activity";
import { units } from "user-settings";

let distance = userActivity.today.adjusted.distance || 0; let tmp = convertMetersToMilesOrKilometers(distance, "kilometers", "miles");
console.log(`Distance: ${tmp.value}${tmp.units}`); // Convert meters into the user preference for kilometers or miles. /** @description Converts a number in meters into either miles or kilometers. * Returns an object containing a value and units. * @param {number} meters The amount of meters to convert. * @param {string} unitK The units to return if the value is kilometers. * @param {string} unitM The units to return if the value is miles. * @return {object} */ function convertMetersToMilesOrKilometers(meters, unitK, unitM) { let val = (meters || 0) / 1000; let u = unitK; if (units.distance === "us") { val *= 0.621371; u = unitM; } return { value: val.toFixed(2), units: u }; }

You could also compare what the local distance returns:

 

 

userActivity.today.local.distance

Does the Fitbit mobile app display the correct distance?

 

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3
Best Answer
0 Votes

 

I can't see anything obvious which would cause battery drain. Have you tried without the hrm module? Perhaps the setTimeout()/clearTimeout() isn't behaving correctly.

 

Here's what I've been using for distance:

 

import userActivity from "user-activity";
import { units } from "user-settings";

let distance = userActivity.today.adjusted.distance || 0; let tmp = convertMetersToMilesOrKilometers(distance, "kilometers", "miles");
console.log(`Distance: ${tmp.value}${tmp.units}`); // Convert meters into the user preference for kilometers or miles. /** @description Converts a number in meters into either miles or kilometers. * Returns an object containing a value and units. * @param {number} meters The amount of meters to convert. * @param {string} unitK The units to return if the value is kilometers. * @param {string} unitM The units to return if the value is miles. * @return {object} */ function convertMetersToMilesOrKilometers(meters, unitK, unitM) { let val = (meters || 0) / 1000; let u = unitK; if (units.distance === "us") { val *= 0.621371; u = unitM; } return { value: val.toFixed(2), units: u }; }

You could also compare what the local distance returns:

 

 

userActivity.today.local.distance

Does the Fitbit mobile app display the correct distance?

 

Best Answer
0 Votes

Thank you Jon. The Versa distance corrects its self once the mobile application is opened. Any reason why it may not be displaying correctly until the mobile application is opened? I have an Ionic too which always has the correct distance on the display mobile application opened or not. 

Best Answer
0 Votes