brodeurlv / fastnfitness

FastNFitness Android app: Body, Cardio and Fitness tracking.
https://play.google.com/store/apps/details?id=com.easyfitness
BSD 3-Clause "New" or "Revised" License
275 stars 362 forks source link

Feature Request: Add wearable import support #87

Open roshavagarga opened 5 years ago

roshavagarga commented 5 years ago

Basically, the ability to import data, which can now be exported from wearables such as the Mi Band. I would be open to supplying examples of said data (csv files) privately :)

vanous commented 5 years ago

I would suggest to look at Gadgetbridge, it has periodic export function in sqlite3. https://github.com/Freeyourgadget/Gadgetbridge

roshavagarga commented 5 years ago

That's an export function. There is no guide or way to feasibly import data from a Mi Band 3 for instance :/

vanous commented 5 years ago

Do you mean as in getting the steps from the band and into fastnfitness? Gadgetbridge itself pulls the data. Or you mean inserting fastnfitness data into Mifit app?

roshavagarga commented 5 years ago

Gadgetbridge pulls the current data, but not the old data. Mi Fit allows you to export your previous data, or at least daily totals for everything. That data can't be imported into Gadgetbridge, hence it's practically lost, so once you install it, it's a clean slate sort of thing, hence why I asked about importing old data into FastNFitness - weight is probably the only one that's useful and can be imported :)

vanous commented 5 years ago

The mifit export is a csv file, very simple to be imported into gadget bridge data, which can easily be used anytime in the future with not only daily totals but in full detail, including heart rate.

roshavagarga commented 5 years ago

I've failed to actually find a guide or a proper explanation on how to do this, If you're aware of one, I'd be more than happy to make use of it. As far as I remember, GB uses some sort of an sql database and I'd have to somehow get that, then edit the old csv entries into it by hand and hope it doesn't get rejected.

vanous commented 5 years ago

The current work flow (untested) would be: make an export of the current data into an sqlite3 file. Get mifit export and push csv data into this sqlite3. Import sqlite3 back into Gadgetbridge. Gb already features both the export and import of its internal data, so the only bit in between is thr csv import. I am planning to look at it in the near future.

roshavagarga commented 5 years ago

If you can explain how one would go about doing so in a detailed way, I'd be very interested. My inability of switching to GB is one of the reasons I've been holding off on switching away from Mi Fit entirely :) Alternatively, if you're planning on working on a cleaner way of doing so via the app, I'd be interested in helping you test the function :)

vanous commented 5 years ago

Here is how to get an official access to the mifit data https://github.com/huamitech/rest-api/wiki

roshavagarga commented 5 years ago

Wouldn't this be the same data I can get by exporting it from the Mi Fit app? (About section export request per GDPR)

vanous commented 5 years ago

Probably yes. But the gdpr export is rather clunky and takes a long time, plus it is pretty much one time only, where the API access would/could provide continues access. I haven't tried the API access thought as I am not sending any data to huami...

Edited.

roshavagarga commented 5 years ago

The GDPR export is actually fine for me. I can do it as many times as I want while I'm using Mi Fit, it takes a minute to make the file and downloads it immediately, since it's under 1MB. If somebody provides API example export files, I'd be up for comparing both :) But yeah, I'd like to move away from Mi Fit, hence I understand your lack of enthusiasm for sending more data to huami :+1:

boykoatwork commented 5 years ago

Maybe import from google fit will be also possible?