[SOLVED] Device info from Core sensor (Get Battery)

Hi,
I would like to extract the battery life from my Core Body Temperature Sensor.
It does not show up on the device list in the fit-file.
Does anyone know a workaround?

And does anyone know how to interpret the info under the CIQ device info field?

Why not ask core themselves?

I did, but since there are so many knowledgable people on this forum I wanted to try here as well.

I got the following answer from CORE:
We don’t log the battery state during the activity, we only log the battery level at the end of the activity into the CIQ_device_info. Here is how you can parse the CIQ_device_info:

  • b0: ANT+ device type “CORE”,

  • b1: wearing position “Armpit”

  • b2-b5: 4 LSB of the BLE MAC ADDRESS

  • b6, b7: manufacturer id lsb, msb (0x012F)

  • b8: battery status (1 New - 2 Good - 3 Ok - 4 Low - 5 Critical - 6 RFU - 7 Inv.)

  • b9, b10: SW revision supplemental, main: 8, 6 → ‘0.8.6’

  • b11: HW revision

  • b12, b13, product LSB, MSB (0,1)

Good. You’ve got the mapping which makes it even better as there’s no need to figure out what is what.

B8 = 02 = Good

Thanks.
Now getting this to a custom activity field is my next problem, and a little beyond my knowledge.

Yeah. Same.
But I managed to take one of the custom fields and alter accordingly. Trial and error.

@david I can extract this info from the fit file, pictured below.

But it is not showing the complete string, as shown below:

How can I extract this string and then extract spot number 9 in the array?

I edited your “Core Battery Test” field. This is the script:

{
  let status
  for (let s of icu.fit.session) {
    let di = s.CIQ_device_info?.value
    if (di) {
      let v = di[8]
      if (v) status = ["New","Good","Ok","Low","Critical","RFU","Inv"][v - 1]
    }
  }
  status
}
3 Likes

Thank you :star_struck:

1 Like