Monitoring and alerting on resting Heart Rate?

Inspired by what Apple are doing in Watch OS 4 I'm trying to see if I can write my first every Connect IQ App? to do similiar.

Basically they seem to have implemented a feature that will alert you if your resting HR jumps above a limit you set after the watch has detected you've been inactive for 10 minutes.

Theoretically could something like that be written for Garmin watches with OHR built in?

If so would I need to do it in a watch face to have the ability for it to detect inactivity and also continuously monitor HR and alert if it jumps above a user set value?

Thanks for any help or pointers to get me started!

regards,

Greg
  • I'd go with a watchface here. You could consider something like a widget or a watch-app with a background process, but the background can run at most every 5 minutes, and then at most, for 30 seconds.


    restingHeartrate is available in the UserProfile, but to be honest, I've never used it, so you may want to check that it gives you want you want on a watch.

    In most cases, a watchface will only run once a minute. You might be able to do something else in an "always active" (1hz) watchface.

    For the current HR, there's two ways to get that in a watchface on a watch with Wrist HR.

    - Activity.Info.currentHeartRate, but this may not be valid on all watches

    -The newest sample obtained from ActivityMonitor.getCurrentHeartRate (you can also use the SensorHistory version on CIQ 2.x watches). Here, the HR may only update every minute or two

    (I'd check Activity.Info and fall through to the history if current wasn't available)

    So you then have the resting and current HRs

    For inactivity, you could keep an eye on step count, and if it's not changing or only changing a very small amount, consider that inactivity. (if there's less than 5 steps over 10 minutes, consider that inactivity, for example)

    When it comes to an alert, watch faces can't access the Attention module, so no chance of doing a tone or vibration. The only option is to display something on the screen.