GithubHelp home page GithubHelp logo

jaroslawhartman / withings-garmin-v2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ikasamah/withings-garmin

64.0 64.0 18.0 268 KB

Withings to Garmin Connec sync

Home Page: http://jhartman.pl/tag/fitness/

License: MIT License

Python 98.08% Dockerfile 1.46% Shell 0.46%

withings-garmin-v2's People

Contributors

dinde avatar dryparn avatar ikasamah avatar jaroslawhartman avatar rgusmero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

withings-garmin-v2's Issues

AttributeError: 'NoneType' object has no attribute 'group' again

Hi
I just started using this, and it worked like a charm.
It seems an issue earlier refered to in #2 and #4 has reemerged - same error reported.
The search for username in the page returned by session.get does not seem to contain the texxt searched for in this line from login() in garmin.py
userdata_json_str = re.search(r"VIEWER_SOCIAL_PROFILE\s*=\s*JSON\.parse\((.+)\);$", dashboard.text, re.MULTILINE).group(1)
The dashboard.text is a web page containing some java scrips, that also seems to contain comments on how to log in.
It does seem the login is performed ok though. It is just that the page returned by get_session is not the expected one.

AttributeError: 'NoneType' object has no attribute 'groups' (another incarnation)

Garmin has changed something again, between 10th and 11th of May.... Issue similar to #2

Traceback (most recent call last):
  File "/home/jhartman/scripts/withings-garmin-v2/sync.py", line 126, in <module>
    main()
  File "/home/jhartman/scripts/withings-garmin-v2/sync.py", line 59, in main
    sync(**opts.__dict__)
  File "/home/jhartman/scripts/withings-garmin-v2/sync.py", line 118, in sync
    session = garmin.login(garmin_username, garmin_password)
  File "/home/jhartman/scripts/withings-garmin-v2/garmin.py", line 139, in login
    session = self._get_session(email=username, password=password)
  File "/home/jhartman/scripts/withings-garmin-v2/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'

Withings changed authentication to OAuth 2.0 - sync broken

Our friends at Withings changed the authentication protocol from OAuth 1.0 towards 2.0 and switched off on November 30th. Now the sync with the scale is broken -

Any chance to update the code to OAuth 2.0 ? Thanks for your help !

Strange error now

Thanks for updating repo. Getting strange error now:

File "sync.py", line 77
print 'could not find user: %s' % withings_shortname
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print 'could not find user: %s' % withings_shortname)?

user has not opened withings data

Hi,
I am trying to use this script but can't quite figure out how to have it to work.
After a bit of trial and error process i have managed to find out what my withings short name is however i am getting a persistent message:
user has not opened withings data
Is there a setting in my withings account that needs to be adjusted?
many thanks!

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ IMPORTANT ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ - Tool migrated to "withings-sync" repo. Old version will not authorise anymore

WARNING

The tool has been migrated to https://github.com/jaroslawhartman/withings-sync

The old withings-garmin-v2 will not authorise anymore and cause the following error:

URL:"https://account.withings.com/oauth2_user/authorize2?response_type=code&client_id=183e03e1f363110b3551f96765c98c10e8f1aa647a37067a1cb64bbbaf491626&state=OK&scope=user.metrics&redirect_uri=https%3A%2F%2Fwieloryb.uk.to%2Fwithings%2Fwithings.html&selecteduser=2916101

Provides me with:
{"errors":[{"message":"redirect_uri_mismatch: The redirect URI provided is missing or does not match partner callback url"}]}

Sync sleep to Garmin?

I have no idea - tried to google it buy couldn't find any info.

Is it possible to sync Withings sleep to Garmin sleep tracking?

Sync last month

Would be nice if you could specifiy to sync the last month only instead of a fixed date.

persistent docker container + docker-compose

Hi,

first of all thank You very much for your work! I have a few questions:

  1. Is there a way to make the script/tool run as a continuous/persistent docker daemon?
    Currently, I'm only able to manually run the container via
    docker start -i withings
    which then automatically terminates after syncing data (to garmin connect, in my case). That way, I need to re-run the container after each weighing, or alternatively add a cronjob to do this regularly. I'd prefer to have the container running all the time and continuously sync new weight data, is there something I'm missing or is this not possible?

  2. Does anyone have a clue if/how to include this script in a docker-compose.yml? Also, any idea on how to include a host volume for the script's config (in order to allow for central storage and ultimately, backup of all relevant config data)?

Best regards,
Piotr

Unable to retrieve username! Most likely: incorrect login or password!

Hello,

Is this still working as is?
Thanks.


withings-garmin-v2 <..>$ ./sync.py
Can't read config file config/withings_user.json


  •     W A R N I N G               *
    

User interaction needed to get Authentification Code from Withings!

Open the following URL in your web browser and copy back the token. You will have 30 seconds before the token expires. HURRY UP!
(This is one-time activity)

https://account.withings.com/oauth2_user/authorize2?response_type=code&client_id=183e03e1f363110b3551f96765c98c10e8f1aa647a37067a1cb64bbbaf491626&state=OK&scope=user.metrics&redirect_uri=https://wieloryb.uk.to/withings/withings.html&

Token : 14e0bd27d3f81b8a4266e1ac8f23c113fff74b23
Withings: Get Access Token
Withings: Refresh Access Token
Withings: Get Measurements
Measurements received
'NoneType' object has no attribute 'group'
Unable to retrieve username! Most likely: incorrect login or password!
Bad response during GC upload: 403

Thank you - Still something strange

First, Thank you. I updated garmin.py and I'm still receiving the following

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 "/1-CODE/PYTHON/Withings-Garmin/garmin.py", line 132, in login
cookies = self._get_cookies(email=username, password=password)
File "/1-CODE/PYTHON/Withings-Garmin/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'

AttributeError: 'NoneType' object has no attribute 'groups'

Issue:

jhartman@wieloryb:~/scripts/withings-garmin-v2$ ./sync.py
Traceback (most recent call last):
  File "./sync.py", line 124, in <module>
    main()
  File "./sync.py", line 59, in main
    sync(**opts.__dict__)
  File "./sync.py", line 116, in sync
    cookie = garmin.login(garmin_username, garmin_password)
  File "/home/jhartman/scripts/withings-garmin-v2/garmin.py", line 132, in login
    cookies = self._get_cookies(email=username, password=password)
  File "/home/jhartman/scripts/withings-garmin-v2/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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.