pe-st / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
376 stars 77 forks source link

Time spent in HR zones #68

Closed sgowtham closed 2 years ago

sgowtham commented 3 years ago

Greetings.

I am wondering if there's a way to extract the time spent in various heart rate zones (e.g, Z1, Z2, Z3, Z4 and Z5) in hh:mm:ss format for a given activity using this garmin-connect-export python workflow?

My best, Gowtham

pe-st commented 3 years ago

Hello @sgowtham

Currently this is not supported, but it should be quite easy to add in a next version. Would you also need the bpm of the lower boundary of each zone?

Regards

sgowtham commented 3 years ago

Thank you, @pe-st.

Yes please. I let Garmin adjust my zones based on the resting heart rate. So, the lower boundary of each zone will be very useful to me!

pe-st commented 2 years ago

I released version 3.3.0 that supports extracting the seconds for each zone as well as the lower boundaries.

Feel free to close the issue if it is what you wanted...

sgowtham commented 2 years ago

Thank you so much! I appreciate it :)

Best regards, Gowtham

- Gowtham, PhD Director of Research Computing, IT Research Associate Professor, College of Computing Michigan Technological University

(906) 487-4096 https://it.mtu.edu https://hpc.mtu.edu

On Sun, Dec 26, 2021 at 7:05 AM Peter Steiner @.***> wrote:

I released version 3.3.0 that supports extracting the seconds for each zone as well as the lower boundaries.

Feel free to close the issue if it is what you wanted...

— Reply to this email directly, view it on GitHub https://github.com/pe-st/garmin-connect-export/issues/68#issuecomment-1001166534, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXCPKALFOO6MX4IE7MXWYDUS4AHTANCNFSM5GRXQTSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

sgowtham commented 2 years ago

Good evening.

I cloned the repository and ran the following command:

python3 ./gcexport.py -f json

I entered the username and password when prompted. It runs successfully and I see the following files under the 2021-12-26_Garmin_connect_export folder:

activities-1-1.json, activities.csv, activity_8013272014.json, device_889502.json, downloaded_ids.json, userstats.json.

None of them contain the HR zones (lower limit or the time spent in a zone) information. I ran python3 ./gcexport.py and see the GPX file but no HR data. Am I doing something wrong? Could you please guide me in the right direction?

My best, Gowtham (G)

pe-st commented 2 years ago

Sorry, I forgot to leave instructions. Because fetching the HR zone data necessitates an extra request for every activity (you noticed yourself that the HR data is not included in the regular activity JSON), it is not retrieved with the default configuration.

Try this: python3 ./gcexport.py -f json -t csv_header_all.properties

You can then change your default configuration (the csv_header_default.properties file) to include the HR CSV columns based on the examples in csv_header_all.properties. As soon as you include the columns hrZone1Low and/or hrZone1Seconds in your configuration, the HR zone data will get fetched.

sgowtham commented 2 years ago

Thank you! I will try this today and close the issue when I get it to work :)

Best regards, Gowtham

- Gowtham, PhD Director of Research Computing, IT Research Associate Professor, College of Computing Michigan Technological University

(906) 487-4096 https://it.mtu.edu https://hpc.mtu.edu

On Mon, Dec 27, 2021 at 8:18 AM Peter Steiner @.***> wrote:

Sorry, I forgot to leave instructions. Because fetching the HR zone data necessitates an extra request for every activity (you noticed yourself that the HR data is not included in the regular activity JSON), it is not retrieved with the default configuration.

Try this: python3 ./gcexport.py -f json -t csv_header_all.properties

You can then change your default configuration (the csv_header_default.properties file) to include the HR CSV columns based on the examples in csv_header_all.properties. As soon as you include the columns hrZone1Low and/or hrZone1Seconds in your configuration, the HR zone data will get fetched.

— Reply to this email directly, view it on GitHub https://github.com/pe-st/garmin-connect-export/issues/68#issuecomment-1001560276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXCPKA62JEHOMDHLLZNBMTUTBQEFANCNFSM5GRXQTSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

sgowtham commented 2 years ago

Good evening.

It works as expected! Thank you for your work on this. I greatly appreciate you and your help :)