withings-sync icon indicating copy to clipboard operation
withings-sync copied to clipboard

Duplicate entries

Open michaelknox opened this issue 2 years ago • 4 comments

Is there a way to have the app check if an entry has already been uploaded and then not upload if already present?

I have noticed that if you put a fromdate parameter in there it will re upload any values that were already present. Garmin doesn't seem to care.

michaelknox avatar Jan 26 '23 13:01 michaelknox

Currently, there is no such prevention.

longstone avatar Feb 07 '23 12:02 longstone

I looked at the way the chart is rendered in garmin connect, it hits 2 endpoints of note.

This is the first weight measurement of all time. I suspect there would also be an equivalent "last", which would be convenient.

https://connect.garmin.com/weight-service/weight/first

This is a call to get all measurements within a time range.

https://connect.garmin.com/weight-service/weight/range/2023-02-01/2023-02-07?includeAll=true

If I try to directly connect via session without any headers or cookies set (using the session returned by login), I get a 404.

If I set a get request header "DI-Backend": "connectapi.garmin.com", I get a 403.

If I add a get header "Authorization", I get a 401. That may be because I copied it from my web session into pycharm for evaluation.

The "Authorization" value is the "access_token" returned from https://connect.garmin.com/services/auth/token/refresh.

dhiltonp avatar Feb 07 '23 17:02 dhiltonp

To be clear, my thought is that the default behavior could be changed to auto-set the fromdate to the day after the most recent value in garmin connect.

dhiltonp avatar Feb 07 '23 18:02 dhiltonp

Yes you do and will see duplicate entries. Garmin seems to add in a "version" id even if it's for the same timestamped data. which is why there are duplicates.

However, what this means is that it will just clutter the "readings" if you export as CSV or the web list view will have multiple entries with the same data (same timestamp, same weight, same bp etc) But.. since they are all the same (for the day) it will be plotted as 1 entry.

Garmin plots the data as an average of the day's reading/entry

app4g avatar Oct 20 '23 02:10 app4g