You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • Ok - I will post my latest code for the health.app.js below.
    I have only tested on Bangle JS 2 for now.

    A few questions arise
    1) Regarding the retrieval of steps per day. The array that gets retrieved has a 0 at index 0.

    On Thursday 11th Nov - looks like this:

    DAY
     0  1   2    3     4     5      6     7     8     9    10
    DATA
    [0, 6, 33, 122, 2027, 7703, 11378, 7649, 4105, 3246, 5559, ....
    

    Day 11 has yet to conclude so we have 10 days of data.
    So basically the zero element is a dummy value of 0 for day data.
    When dsiplaying the chart we want to display from day 1 to last day of month.

    The hour data hour has significance for the 0 index - in that it is the first hour of the day from 00:00 - when displaying the chart we will want to display from hour 0-23.

    I think it would be more consistant to retrieve the data with the zero element always being significant - this way the chart labelling can be adjusted by an offset of 1 or 0 - rather than having to skip the first entry for day data or split into a new array starting at element 1. Hope that makes sense.

    2) Movement Data for Days is strange ?

    Basically as in the two charts below.
    Today my general movements, sitting and walking was the same as yesterday.
    Each day is getting 255 for the day - where as hour 8 this morning was 356.

    I guess what I am asking is - what is the unit of movement in an hour ?
    What is the unit for of movement for a day and how does that relate to the hours movement ?
    I am also seeing approx 90-100 movements during sleeping hours.
    Rolling over in bed should not score as movement.

    I think movement should be defined in terms of breaking the 8 steps in 8 threshold.
    So how many minutes was I actively walking in that hour ? This is a good idea as the point
    about healthy movement is that you have to stand for so many minutes per hour, feel the force of gravity on your bones etc. By breaking the step threshold we can say you were standing for that time. We should not be scoring movement when sitting on a sofa or sleeping.

    This means if you sit at a desk for an hour you score 0 BUT if you get up for 5 minutes walk to the bathroom for a toilet break you score 5. So if you stand every 20 minutes for 2 minutes you score 6 in that hour. A full hours walking scores 60. Being active for every minute of 8 hours would score 480. A full days mounting climbing for 8 hours could be made to register as 100 movement points for the day. So an average commute day is going to look around 60 minutes of activity or a 12.5 point day. This would give a good explanable baseline for activity.


    2 Attachments

    • download (1).png
    • download.png
About

Avatar for HughB @HughB started