Create Calorie Tracking app w/ health integration#4142
Create Calorie Tracking app w/ health integration#4142RKBoss6 wants to merge 92 commits intoespruino:masterfrom
Conversation
Add metadata for Calorie Tracker application
Expanded the README to include the calorie calculation formula and its components, enhancing user understanding of the app's functionality.
…date boot.js to match
…nshot for health, add gender for myprofile
Refactor logic for setting resting heart rate and round max heart rate calculation.
Added instructions for taking Resting Heart Rate (RHR) measurements, including tips for optimal conditions and app navigation.
…nto caloriesApp
…nto caloriesApp
Added prompt to set MyProfile data if missing for calorie calculations.
|
Should we try to get this one over the finish line? I'll probably have some time to look closer again sunday morning :) |
|
Yes, that sounds good! I won't have that much time to do it for a while, but I can take a look at it in bits and pieces and get it done gradually :) |
|
Ok, no stress 🙂 |
|
@thyttan do you happen to have another smartwatch lying around that can track calories already? I want to compare the accuracy of the tracker, so I will wear both for a day and see the difference in calories, with an old garmin lying around. If you can, can you do the same? That way we can test for different ages, values, etc... |
|
Nope, don't have a Gramin or similar I'm afraid. |
|
Ok, no worries! I'll collect some data to see if it's accurate |
| throw new Error("Invalid or missing heart rate data"); | ||
| } | ||
|
|
||
| // Age-adjusted MET values for better accuracy across age groups |
There was a problem hiding this comment.
I'd like to read a source on age-adjusting metabolic rate values. Do you have one?
There was a problem hiding this comment.
Actually I'm not sure - I ran it through AI to see if it would scale appropriately for different ages, and it told me this. I'm not sure whether it makes a difference, as I haven't tested this fully yet, but I'll get to testing hopefully soon.
There was a problem hiding this comment.
Ok. If you don't find a source backing it up I think we should pull it out and not have age affect the calculation.
There was a problem hiding this comment.
I'll wait to pull it out until after i've tested with a garmin, so if any formula changes need to be made, I'll do it all in one swoop :)
There was a problem hiding this comment.
What kind of changes are you thinking about doing if the Garmin and this app show very different values?
There was a problem hiding this comment.
Just noting that by better you mean 'more like Garmin'. Which is probably an ok comparison given they have more resources to get it right. But at the same time they don't represent some perfect ground truth (which we'll never have of course).
There was a problem hiding this comment.
I think I'm just going to leave this with the accuracy checks for another PR to improve this. It will take lots of time to change the formula entirely, and would rather change it with other accuracy improvements.
There was a problem hiding this comment.
Yeah that's ok for the most part. But I don't want to merge the age multiplier stuff if we don't have evidence backing it up. I may pull it out myself before merging.
There was a problem hiding this comment.
I just removed the age adjust functionality - I kept the age multiplier, so we can tweak/work on it more later without having to reconstruct the formula.
There was a problem hiding this comment.
OK - but where have you learned about age adjusted metabolic rate?
|
It seems the calories goal drop down notification will persist indefinitely if not dismissed. I think it would be good if it timed out after a minute or two, or even just 10 seconds. What do you think? |
|
@RKBoss6 Should we get this over the finish line? Since we spent a bit on time working on it it would feel nice 🙂 |
|
Yes of course! I've been quite busy and haven't gotten time to test it with a baseline watch, so I think we save that for another day, and just get this app over the finish line! Thanks for putting up with this for so long @thyttan! |
I had based this on the health app, which afaict does the same thing - it feels nicer having it persistent until you dismiss it, showing it's read rather than you not knowing if it times out. Users can disable it in settings... |
|
Alright @thyttan , I think this is finally good to go! On my end it looks like I addressed all your comments and fixed them, so if it's good to you, we can get this merged! |
|
Awesome work! I'll take a look 😎 |
Creates an app for calorie tracking that resolves #4092, that counts calories burned in a day and splits it by BMR, Active, and total calories. Uses MyProfile to get user health data, and hooks onto health events for new data. Also modifies myprofile to use RHR readings as an additional piece of data, with its own measurement UI.
Check it out at my app loader