Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HeartRate displays object value

Hey, I'm using a Batched Heart Rate Sensor in my new custom Clock Face on Fitbit Versa and the only thing I'm getting back is this: "[object Object]"
I'm pretty new to js so maybe it's just a minor issue. Thanks for helping. Check out my code below. 

mySteps.text = ( (today.local.steps || 0) );

let hrm = new HeartRateSensor({ frequency: 1, batch: 60 });
const myHR = document.getElementById("myHR");
hrm.onreading = () => {
  for (let index = 0; index < hrm.readings.timestamp.length; index++) {
  
  }
};
hrm.start();
myHR.text = `${hrm}`;

I'm using a simple design: 

<svg class="container">
  
      <image id="steps_icon" href="steps.png" />  
      <text id="mySteps" />
  
 </svg>  

Thanks for your help. I'm just trying to get the actual Heart Rate displayed on the clock face display. 

Best Answer
0 Votes
1 REPLY 1

Just quickly, one lazy way to see inside an object is something like

 

console.log(JSON.stringify(theObject));

 

That should give you a clue about how to handle what you've got.

Peter McLennan
Gondwana Software
Best Answer