https://dev.fitbit.com/blog/2019-10-29-announcing-fitbit-os-sdk-4.0/#activity-history-api
Best AnswerThis only speaks of minute history and day history, have they added the much needed hourly history?
Best AnswerYou might want to vote for this feature suggestion:
I posted this over 2 years ago asking for this functionality.
John
This is a reprint from an earlier post but still valid...
Yeah,...my solution to recording hourly steps was to trigger a record every hour. If the user switched to something else, it pro-rates the accumulated steps to each hour that has passed after control is returned to the watch face. It's not perfect but usually close enough to determine if 250 steps were walked in each passing hour.
I did try the step history and it absolutely does work as explained, but the neither time frame available was helpful for recording hourly steps.
Regards,
Reign
Best AnswerI tried to use minute activity, but the results are empty records. Are there samples how to use the API?
Best AnswerHello AjaySingh,
If you would like to test (play around with) activity history,
here is a short example you can start with:
import {minuteHistory,dayHistory} from "user-activity"
let tHistory = dayHistory.query()
for (let index1 in tHistory){
let tString = "index:" + index1
let tElements = tHistory[index1]
for (let index2 in tElements){
if (index2 != "constructor") tString += ", " + index2 + ":" + tElements[index2]
}
console.log(tString)
}
Example result is: [11:58:59 AM]index:2, steps:29, distance:21, calories:4, floors:0, averageHeartRate:93, restingHeartRate:undefined
Note that minuteHistory is limited to 60 minutes, dayHistory is limited to 6 days.
The dayHistory format and minuteHistory format are basically the same.
dayHistory delivers simulated data in the simulator. minuteHistory does not; it delivers undefined values.
There is no hour history equivalent ...yet. It seems likely to follow a similar format if or when they do add it.
Regards,
Reign
Best AnswerThank you Reign,
I will try playing with the code you have provided and submit back if find any better solution.
Best Answer