withings-sync
withings-sync copied to clipboard
Duplicate entries
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.
Currently, there is no such prevention.
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.
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.
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