Giter Club home page Giter Club logo

ifitsync's People

Contributors

omriasta 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ifitsync's Issues

Docker Documentation

This is a fantastic project!

For anybody interested, this is implemented in Docker by cloning this Repo, obtaining the token.pickle file and copying it into the directory then using the following Dockerfile:

FROM python:3.8-slim-buster

ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Install dependencies:
COPY requirements.txt .
RUN pip install -r requirements.txt

# Run the application:
RUN mkdir /ifitsync
WORKDIR /ifitsync

CMD ["python", "ifitsync.py"]

After building the image, run it with the following command:

docker run -d --name ifitsnyc -v ~/ifitsync:/ifitsync <image name>

IndexError: list index out of range

Hello,

Installed on Win10 with python 3.12 I had to modify the requirements.txt to set lxml to 5.1.0 but not a gig deal
Google API is set up and the credentials.json is working with a quickstart project.
Here it is asking for ifit.com account and the crash.... Sorry Yes I have a nordiktrack bike.

Thanks for your help.

C:\Users\franc\GIT\ifitsync>python ifitsync.py
iFit Username(email):
SomeAccount
Password:
Traceback (most recent call last):
File "C:\Users\franc\GIT\ifitsync\ifitsync.py", line 2, in
from get_ifitaccount import HISTORY_JSON, IFIT_HIST_HEADERS
File "C:\Users\franc\GIT\ifitsync\get_ifitaccount.py", line 101, in
CLIENT_ID = clientid_list[0]
~~~~~~~~~~~~~^^^
IndexError: list index out of range

Changes to use with NordicTrack bike?

What changes to the code would be necessary to use this with a NordicTrack stationary bike? I like the idea of using it to sync my rides with iFit :)

Google Fit changes required scopes for HR

I have already updated the scopes in the script, so remember to run git pull first. If you have previously run this script, you will need to delete token.pickle and run the script to reauthorize the script with your google account and receive the new permissions.
After that the script will work again.

cannot login to iFit

Hi, came across your project, it looks great but I'm having trouble logging into iFit when running python ifitsync.py.
I enter my iFit email and password and it returns:

Traceback (most recent call last):
  File "ifitsync.py", line 2, in <module>
    from get_ifitaccount import HISTORY_JSON, IFIT_HIST_HEADERS
  File "/home/pi/ifitsync/get_ifitaccount.py", line 98, in <module>
    clientid_list = re.findall(regex_clientid, scripts[0].text_content())
IndexError: list index out of range

I created my iFit account using Google credentials.

IndexError: list index out of range

I get this error when uploading a workout. I believe this is a workout that was captured in the ifit app on a phone rather than from a treadmill itself. Here is the actual error output:

Uploaded Body Weight HIIT Workout Calorie data successfully
Traceback (most recent call last):
File "ifitsync/ifitsync.py", line 691, in
UploadIfitDistanceToGoogle(y)
File "ifitsync/ifitsync.py", line 314, in UploadIfitDistanceToGoogle
+ IfitWorkoutJson.lists["meters"][0]["offset"] * 1000000,
IndexError: list index out of range

I'm having a hard time figuring out which value Google isn't liking. Do you mind pointing me in the right direction?

Upload to Google Fit not including Steps / Heart Points

I have noticed that steps and heart points are not showing up when I upload a workout but if I change the scripts timestamp and upload the workouts a second time after a couple of hours, then these stats do eventually populate.
I am not sure if this is an issue with the script or if google fit is enacting some changes...
Not sure if anyone else is noticing or wants to take a look to see if they can figure out why this is happening?

Token expiration

I'm getting the following error after a few days when I run the cron job every 6 hours. When I refresh the pickle file via GUI, it works again for a few days. It seems the script is not updating the token after it runs.

Traceback (most recent call last):

File "ifitsync.py", line 25, in

service = main()

File "/ifitsync/get_googleaccount.py", line 39, in main

creds.refresh(Request())

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/credentials.py", line 200, in refresh

access_token, refresh_token, expiry, grant_response = _client.refresh_grant(

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/_client.py", line 248, in refresh_grant

response_data = _token_endpoint_request(request, token_uri, body)

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request

_handle_error_response(response_body)

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response

raise exceptions.RefreshError(error_details, response_body)

google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked.', '{\n "error": "invalid_grant",\n "error_description": "Token has been expired or revoked."\n}')

Traceback (most recent call last):

File "ifitsync.py", line 25, in

service = main()

File "/ifitsync/get_googleaccount.py", line 39, in main

creds.refresh(Request())

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/credentials.py", line 200, in refresh

access_token, refresh_token, expiry, grant_response = _client.refresh_grant(

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/_client.py", line 248, in refresh_grant

response_data = _token_endpoint_request(request, token_uri, body)

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request

_handle_error_response(response_body)

File "/opt/venv/lib/python3.8/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response

raise exceptions.RefreshError(error_details, response_body)

google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked.', '{\n "error": "invalid_grant",\n "error_description": "Token has been expired or revoked."\n}'

last_run_time.json

I get both the iFit and Google Fit authentication working and then I get this error. I hope maybe I'm missing something. I tried creating empty 'last_run_time.json' file but that did not work.
Traceback (most recent call last): File "ifitsync.py", line 674, in <module> with open('last_run_time.json') as timestamp_file: FileNotFoundError: [Errno 2] No such file or directory: 'last_run_time.json'

iFit Data Question

Is a premium membership required through iFit to transfer all access/sync all of the data?

I haven't used the iFit app that much so I'm not extremely familiar with it.

I appreciate the project, thanks!

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.