homeassistant-peloton-sensor
homeassistant-peloton-sensor copied to clipboard
HA - Heart Rate BPM
Hello,
I noticed that the value reported in HA is up to 30bpm off/lower than what is actual.
Should this be value vs average_value? self._attributes.update({"Heart Rate Bpm":str(stats_latest["metrics"][4]["average_value"])})
Update: I changed to this and it is now back in sync: self._attributes.update({"Heart Rate Bpm":str(stats_latest["metrics"][4]["values"][-1])})
Hello,
I noticed that the value reported in HA is up to 30bpm off/lower than what is actual.
Should this be value vs average_value? self._attributes.update({"Heart Rate Bpm":str(stats_latest["metrics"][4]["average_value"])})
Update: I changed to this and it is now back in sync: self._attributes.update({"Heart Rate Bpm":str(stats_latest["metrics"][4]["values"][-1])})
I have updated this but the attribute still seems to be the same as avg, do I have to re-initialize the sensor somehow?
Hello,
I'll take a look, I'm not looking at the code or sample data at the moment but at a glance that attribute might be set by an object that reports something instantaneous which may or may not be what the user is looking for depending on when the user is looking at the data.
I'll look into using the suggested additional [-1] lookup as well as adding sensors for different averages based on the situation if that's even the case.
Thanks,
Ed
Version 0.9.0 has been released and now fully supports current/average/max values. You'll find them as standalone separate sensors. Feel free to open this issue back up if you run into anything unexpected.
Thanks!