jaroslawhartman / withings-garmin-v2 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ikasamah/withings-garmin
Withings to Garmin Connec sync
Home Page: http://jhartman.pl/tag/fitness/
License: MIT License
This project forked from ikasamah/withings-garmin
Withings to Garmin Connec sync
Home Page: http://jhartman.pl/tag/fitness/
License: MIT License
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.
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'
Would be great to get calculated BMI values into Garmin.
Here is a link to some more information including code from a similar project:
magnific0/nokia-weight-sync#13
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 !
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)?
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!
Follow up of #7 (comment)
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"}]}
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?
Would be nice if you could specifiy to sync the last month only instead of a fixed date.
Hi,
first of all thank You very much for your work! I have a few questions:
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?
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
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)
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
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'
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.