I accidentally found that under certain circumstances data can be added, although for that date already exists.
When I insert mental data that already exists I get:
Code: Select all
Response 'Datapoint already exists' for mental status at 2021-04-09T06:00:00Z
Response 'Datapoint already exists' for mental status at 2021-04-10T06:00:00Z
That is different when data was already added via sync. When I then run the same code for the same date, I get the following response:Response 'Datapoint already exists' for heartrate rest at 2021-04-09T06:00:00Z
Response 'Datapoint already exists' for heartrate rest at 2021-04-10T06:00:00Z
Only visible difference is, that the heartrate doesn't have a time when synced automatically, of course has one when I add data via api.Response 'Datapoint successfully created' for heartrate rest at 2021-04-09T06:00:00Z
Response 'Datapoint successfully created' for heartrate rest at 2021-04-10T06:00:00Z
The existing data (from sync) is not overridden, the new data is just added, messing up the history.
So to me it seams that the check for existing data requires a time to be existing, but for some reasons the heartraterest that is synced from Garmin doesn't get a time assigned.
br Matthias