Trying to find a way to display the sensors used on my different activities. Sensors as in HRMs, power meters, watch/computer, temperature, running power etc.
According to a thread on the garmin-forums the information seems to be in the fit file ( Sensors used - Garmin Connect Web - Mobile Apps & Web - Garmin Forums ), but when looking in the JsFitSDK class (Server side data model for scripts) (?) there seems to be a lot of different potential sources for this information, and i’m a little lost.
Has anyone done this? Is there something that I have overlooked? Is it possible to do this with custom activity fields? Or is it a potential feature request?
Hoping for an end result something like this displayed on the acitivity:
Sensors used in this activity:
The power meter data is already visible on the activity data page. I have created a custom activity field for the HR monitor. Click “Custom” under the activity timeline chart:
The script for the HR Monitor field looks like this (you can edit your copy to get this code). If you know the device type for the other sensors you need you can probably adapt this script easily to find them:
{
let hrm
for (let di of icu.fit.device_info) {
if (di.device_type?.value !== 120 /* HEART_RATE */) continue
console.log("di " + di)
let manufacturer = di.manufacturer?.valueName
if (!manufacturer) continue
let product = di.product?.value
if (product) {
if (manufacturer === "GARMIN") product = icu.fitSdk.enumValueName('GARMIN_PRODUCT', product)
else if (manufacturer === "FAVERO") product = icu.fitSdk.enumValueName('FAVERO_PRODUCT', product)
}
let serial = di.serial_number?.value
hrm = manufacturer + (product ? " " + product : "") + (serial ? " " + serial : "")
}
hrm
}
Has anybody figured out how to get this HR Monitor field to pick up an HR sensor?
It does not seem to work for me with a Polar or Magene unit. I probably do not understand what should be modified in the script
This is how device_info section looks like, don’t see any mention of Polar (I was using Polar H9 in this activity paired to a Forerunner 265)
The bluetooth_low_energy entry is probably the Polar but how to tell with certainty?
Note: I would presume that there’s 2 entries for each device cos It looks like one is start of workout and 1 at end of workout and the one with end of workout only thing I see different is the Battery_status and some other “field_x” which I’ve no idea what.
From what I can tell, your Screenshot shows (not sure what is 4259 as it’s not avialable in the Garmin FitSDK)
Thanks for looking into this.
I believe the issue is with having paired the straps using BLE instead of ANT+ and maybe BLE does not pass on the device information correctly.
My real aim here is to try to detect the cases when the external HRM is not used and the smartwatch automatically switches to use the internal sensor, which we know is garbage for intervals
Why not try to do some “at desk” experiments? That’s essentially what I do when I experiment and try stuffs. Just connect the HRM as ANT+, start a 10s “at desk” activity and just upload the FIT file and see what it says. maybe you’ll see “120” when it’s ANT+