Getting Heart Rate History

Former Member
Former Member
I'm currently making an app that's gathering some data to pass onto a companion mobile app. At the moment, I'm trying to get the heart rate history using ActivityMonitor/SensorHistory's getHeartRateHistory/Iterator methods, and printing it out to see what it looks like, and it seems like (from what I can tell, anyway) that it only gets the last 4 hours of data? This is all on the simulator, and I still can't figure out how to set heart-rate data, if you can, so it seems to just be using the default heart rate data that always seems to be the same. However, I am looking to get the last week's history of Avg. Heart rates, if possible, like as shown on the Vivoactive HR(The device I am developing on) HR widget(When you click on it and it shows the last 7 days), similar to how I'm getting step data and intensity minutes data per day for the last 7 days. Am I just reading the chart wrong and it's not actually average heart rates per day or is there some way of getting this information from the Connect IQ API that I just missed somewhere, or some other explanation?

Thanks in advance.
  • Former Member
    Former Member over 8 years ago
    The VAHR widget will show the last 4 hours .. the max amount of data you will get from HR History.
    That is using .. ActivityMonitor.getHeartRateHistory

    If you want to see in detail how the HR is received on the VAHR over time, check out my watch face 'HR Frequency' from my signature.
  • Former Member
    Former Member over 8 years ago
    The VAHR widget will show the last 4 hours .. the max amount of data you will get from HR History.
    That is using .. ActivityMonitor.getHeartRateHistory

    If you want to see in detail how the HR is received on the VAHR over time, check out my watch face 'HR Frequency' from my signature.


    Yes, I can see that it says last 4 hours, but I was talking about this:


    Which is the view you get when you tap on the HR widget, and I guess it's your average resting heart rate, from what I can gather. Honestly, I'm not entirely sure what the difference is between average RHR and just your average HR throughout the entire day, but I think our client would still be interested in this data regardless, and since it's on the HR widget, I figured there's a way to get it since it's shown, but is that not the case?

    I suppose, in the end, what our client is mainly looking for is that the user is exercising, which would be gotten mostly from Intensity minutes(The steps, heartrate, etc, would be just additional contents used for their research), though I am a bit worried about consistency with actually registering intensity minutes 100% of the time, but I guess I might have to settle for just getting the last 4 hours' heart rate data.
  • Former Member
    Former Member over 8 years ago
    The best data is actually in the Garmin Connect Mobile app.
  • Former Member
    Former Member over 8 years ago
    So it sounds like you're probably not able to get the last 7 days average resting heart rate data using connect IQ then? Not really sure what my alternatives here would be...I'm looking at the Garmin Connect app, and I guess it does store the data throughout the data using bluetooth or something, and it looks like exactly what I'm looking for. Would there be a way to pull that data using Connect IQ, given permission, or is that not possible/against the TOS/other? Would normally be fine to just look at the app itself on the device, though it's a little different in my case since I'm working on a senior design/capstone project with a group and it's part of our requirements to gather all the data and send it to our clients with as little effort as possible(i.e. not having to look through each user's account/logging in/etc).
  • Former Member
    Former Member over 8 years ago
    I personally do not put too much merit on the average (except during sleep) .. but rather look more at the minimum, more as a guideline to my heart health.

    As you likely saw on GCM, you can see your daily numbers (min-max etc) every day. The lower your HR, I believe the fitter your heart and the nice thing you can see your numbers over time.

    I am a huge proponent of looking at your HR data during sleep .. as in my mind, your HR data during the day is extremely influenced by your day to day activities.

    The thing .. Connect IQ can get data while your app is running, but you can get some data using the items in Connect IQ .. ie steps, HR data, intensity minutes etc.

    Garmin, well .. they are the manufacturer and can really do almost whatever they like. But Connect IQ is still very powerful.

    If you are looking longer term .. I would recommend a watch face as that is likely where the device is going to be more often or maybe a widget for a quick glimpse at the data. But that depends on the user .. but myself my VAHR is most often on that normal 'watch face' state.

    The first thing you need to do .. decide what the goals (purpose) of your app will be, and what data you want to capture and then go from there.

    If you are looking for exercise, you could look at intensity minutes, but I am not a big fan of that as a gauge as it is too flaky. Maybe deciding to capture steps, the min and max HR for the day and maybe average and log that daily. Reading the docs for HR data should get you started.
  • Former Member
    Former Member over 8 years ago
    Hmm...I don't think I would want to go through Garmin Connect Mobile to get the data from there(If that's even possible) if I can help it. The average was more of just an example, ideally we would have the data for the entire day of heartrate(maybe min/max every hour/day/etc so there's not a huge amount of data, since this will be going into a .csv file). I did not really think of using a watch face...do you think you could elaborate on its capabilities(I'll also look through the documentation, but I figure I might as well ask)?
    Sounds like it could potentially solve our problem. Is it always running whenever the watch is on/it's on the watchface?

    What I was potentially thinking is, if it works how I would hope it to work, was to have a custom watch face that'll occasionally look at the past 4 hours(so, every 4 hours for example) of HR data and get some statistics on that(min/max/average) and store that data internally(It should be able to do that, correct? Without losing data, unless a loss of power or something like that?) until it's synced to the watch.