Withings to Garmin Connect

Since a while I’m owning great Withings Scale which has a capability to store measurements in a cloud. Because I’m using Garmin GPSes (and Garmin Connect), I’d love to synchronize the measurements to the Garmin Connect site.

Lucky, I found a great script garmin-withings.

Unfortunately, after latest changes in the Garmin Connect (implementation of SSO on march 2014) the script stopped to work. I’ve compiled changes proposed by https://github.com/cpfair/tapiriik and it seems that the script with my updates works again (well, at least until further changes in Garmin Connect…)

You can find the script on https://github.com/jaroslawhartman/withings-garmin-v2

ToDo

Garmin Connect can display a lot of other parameters, not only weight and body fat level:

Measurements

It would be great to calculate all these figures and post them to Garmin Connect, right? 🙂

Withings to Garmin Connect
Tagged on:

10 thoughts on “Withings to Garmin Connect

  • 2017-04-15 at 13:06
    Permalink

    Did you notice that this script is not working anymore? It gives me this error message:

    Traceback (most recent call last):
    File “sync.py”, line 125, in
    main()
    File “sync.py”, line 60, in main
    sync(**opts.__dict__)
    File “sync.py”, line 117, in sync
    cookie = garmin.login(garmin_username, garmin_password)
    File “/Users/Cezex/Utilities/Withings2Garmin/garmin.py”, line 132, in login
    cookies = self._get_cookies(email=username, password=password)
    File “/Users/Cezex/Utilities/Withings2Garmin/garmin.py”, line 100, in _get_cookies
    data[“lt”] = re.search(“name=\”lt\”\s+value=\”([^\”]+)\””, preResp.text).groups(1)[0]
    AttributeError: ‘NoneType’ object has no attribute ‘groups’

    Will you be able to fix it?

    Reply
  • 2017-04-26 at 15:42
    Permalink

    Hi.

    I’m trying to run the script, but I’m getting “user EVG has not opened withings data”. As I understand my Withings profile should be public, but I can’t find a wake to make it so, neither in the web interface or in Android app.

    Could you help me with that please?

    Reply
    • 2017-04-26 at 16:16
      Permalink

      Although, I was able to sync by commenting out these three lines:
      if not user.ispublic:
      print ‘user %s has not opened withings data’ % withings_shortname
      return

      Reply
  • 2017-05-19 at 09:25
    Permalink

    This script is not working for me. It gives me this error message:
    ==> Python sync.py – no – upload> weight.fit
    Traceback (most recent call last):
    File “sync.py”, line 126, in
    main()
    File “sync.py”, line 59, in main
    sync(**opts.__dict__)
    File “sync.py”, line 118, in sync
    session = garmin.login(garmin_username, garmin_password)
    File “/Users/aurelio/Desktop/Garmin/withings-garmin/garmin.py”, line 139, in login
    session = self._get_session(email=username, password=password)
    File “/Users/aurelio/Desktop/Garmin/withings-garmin/garmin.py”, line 77, in _get_session
    data[“lt”] = re.search(“name=\”lt\”\s+value=\”([^\”]+)\””, preResp.text).groups(1)[0]
    AttributeError: ‘NoneType’ object has no attribute ‘groups’

    Reply
  • 2017-11-16 at 19:09
    Permalink

    Hi, is this script working for you ? It generated the .fit file, upload to garmin connect but I see no data in garmin. I tried also upload fit file manually with the same result. Any clue ?

    Thanks

    $ ./sync.py –no-upload -v > file.fit
    generating fit file…
    appending weight scale record… 2017-11-16 18:58:01 Nonekg None%
    appending weight scale record… 2017-11-16 18:58:01 Nonekg None%
    appending weight scale record… 2017-11-16 18:58:01 75.15kg 16.713%
    appending weight scale record… 2017-11-16 00:12:32 Nonekg None%
    $

    Reply
    • 2017-11-18 at 21:15
      Permalink

      Hm, can’t really reproduce this issue, even when ran same command:

      generating fit file…
      appending weight scale record… 2017-11-18 08:15:36 Nonekg None%
      appending weight scale record… 2017-11-18 08:15:36 76.891kg 17.259%
      attempting to upload fit file…
      weight.fit has been successfully uploaded!

      What I found strange in your results is multiple lines with Nonekg, especially, the last line. Perhaps this is confusing the script?

      Reply
      • 2017-11-19 at 22:27
        Permalink

        interestingly, I’ve run the script just now and seem to have gone through. maybe it was some temp issue on garmin side 🙂 thanks

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *