Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: turn P3 data into statistical details #42

Open
igorsantos07 opened this issue Feb 17, 2023 · 0 comments
Open

Feature request: turn P3 data into statistical details #42

igorsantos07 opened this issue Feb 17, 2023 · 0 comments

Comments

@igorsantos07
Copy link

igorsantos07 commented Feb 17, 2023

Currently, all details coming from the Fit 3 collar are state-based, what means they show weirdly in HA and are pretty much useless. I guess that's just the HA default and information wasn't crunched in any way?
image

From what I could understand, this is what the P3 responds with:

  • basic exercise details (activityRecord), which include "strenuous exercise" (playSum), "exercise" (walkSum) and the sum of both (total). This doesn't seem that useful since it depends on the last time I opened the app to sync... So, unless there's a history of sorts (data24??), it seems it could just show useless, out-of-sync information if I don't open the app for a few days?
  • calories details (no mystery here)
  • sleep sum in seconds, both for deep and light sleep, as well as... timestamps of start/end periods?
  • there's also a mysterious data24 list of timestamps(?) as well, which I have no clue what it's about - although the only info missing from the app dashboard would be the activity graph... But I couldn't match what I saw in the API response with what I see in the app.

It would be awesome to be able to see a daily graph of activity/sleep sums... And maybe even a graph of sleep times.

I leave below some samples of API responses, if it's of any help. My timezone is supposed to be -0300, but I noticed the app is a bit confused on the matter - graph seems correctly positioned, but the app jumps into the next day during the night, while after syncing the info is still in the current day.

First day (info only about the night)
{
    "result": {
        "activityRecord": {
            "playSum": 680,
            "total": 13690,
            "walkSum": 13010
        },
        "calorieRecord": {
            "activityCalorieSum": 10,
            "basicCalorieSum": 258,
            "total": 268
        },
        "day": 20230215,
        "sleepDetail": {
            "day": 20230215,
            "deepSleep": 520,
            "deepSleeps": [
                [68630, 68950],
                [70550, 70750]
            ],
            "lightSleep": 3790,
            "lightSleeps": [
                [67370, 68630],
                [69290, 70550],
                [71080, 71390],
                [77000, 77960]
            ],
            "total": 4310
        }
    }
}
Second day (supposedly complete?)
{
    "result": {
        "activityRecord": {
            "playSum": 310,
            "total": 38570,
            "walkSum": 38260
        },
        "calorieRecord": {
            "activityCalorieSum": 28,
            "basicCalorieSum": 258,
            "total": 286
        },
        "data24": [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45798, 24807, 2928, 4106, 1776, 2859, 34864, 44353, 53066, 39029, 84468, 18048, 13188, 29747, 67661, 65369, 66251, 105015, 99271, 108712, 35912, 98412, 73353, 85927, 64961, 68534, 39455, 4590, 4908, 2954, 6986, 1512, 18422, 2766, 0, 3421, 6928, 4883, 6547, 4779, 9345, 5596, 4404, 4678, 1494, 17188, 6485, 1217, 52093, 64751, 69987, 75505, 68863, 64304, 44334, 2702, 1936, 4408, 667, 4700, 5408, 3050, 58692, 83623, 58959, 23350, 32048],
        "day": 20230216,
        "sleepDetail": {
            "day": 20230216,
            "deepSleep": 6440,
            "deepSleeps": [
                [4670, 4890],
                [6490, 6560],
                [8130, 8180],
                [9940, 10720],
                [12640, 13400],
                [15340, 15510],
                [17220, 17380],
                [18960, 19030],
                [20620, 21330],
                [30000, 30120],
                [31700, 32360],
                [34400, 34690],
                [41770, 42430],
                [50410, 50960],
                [56060, 56720],
                [58760, 58770],
                [60380, 60880]
            ],
            "lightSleep": 31100,
            "lightSleeps": [
                [3410, 4670],
                [5230, 6490],
                [6870, 8130],
                [8680, 9940],
                [10720, 12640],
                [13400, 15340],
                [15960, 17220],
                [17700, 18960],
                [19360, 20620],
                [21330, 22520],
                [28740, 30000],
                [30440, 31700],
                [32360, 34400],
                [38440, 38930],
                [40510, 41770],
                [42430, 43970],
                [49150, 50410],
                [51290, 52120],
                [54800, 56060],
                [56720, 58760],
                [59120, 60380],
                [61190, 61700],
                [66350, 67530],
                [74970, 75280],
                [76460, 76790],
                [77120, 77520]
            ],
            "total": 37540
        }
    }
}
Third day (still incomplete as of now)
{
    "result": {
        "activityRecord": {
            "playSum": 130,
            "total": 22360,
            "walkSum": 22230
        },
        "calorieRecord": {
            "activityCalorieSum": 16,
            "basicCalorieSum": 206,
            "total": 222
        },
        "data24": [40365, 5310, 3740, 15117, 15228, 57531, 47757, 77455, 50759, 28094, 9958, 5563, 4832, 4078, 44920, 15776, 8326, 1266, 7019, 1803, 1973, 3942, 6794, 2283, 25291, 63888, 79362, 76148, 58642, 27043, 2589, 53990, 77593, 50776, 47983, 57400, 100306, 31675, 62626, 16588, 7923, 5908, 46615, 83142, 93268, 98365, 100810, 85583, 79794, 89501, 75725, 52620, 30003, 30627, 106842, 33849, 1200, 4336, 2765, 3508, 2856, 16072, 53870, 49801, 67553, 58073, 7860, 0, 534, 2344, 1775, 6272, 76286, 67536, 53439, 1801, 9991, 14429, 737, 2645, 4326, 1998, 8589, 6770, 40811, 47978, 2878, 1977, 6687, 5368, 5417, 3086, 1137, 11305, 40636, 36508],
        "day": 20230217,
        "sleepDetail": {
            "day": 20230217,
            "deepSleep": 6710,
            "deepSleeps": [
                [4800, 5250],
                [6850, 7400],
                [14200, 14950],
                [16900, 17400],
                [22200, 22620],
                [24190, 24540],
                [26150, 26350],
                [27920, 28180],
                [31780, 32440],
                [34480, 34750],
                [36360, 36820],
                [52030, 52690],
                [55160, 55590],
                [59190, 59280],
                [67270, 67930]
            ],
            "lightSleep": 29950,
            "lightSleeps": [
                [3540, 4800],
                [5590, 6850],
                [7720, 8830],
                [12940, 14200],
                [14950, 16900],
                [20940, 22200],
                [22930, 24190],
                [24890, 26150],
                [26660, 27920],
                [28500, 29010],
                [30520, 31780],
                [32440, 34480],
                [35100, 36360],
                [37170, 37840],
                [39410, 40010],
                [40760, 41170],
                [41530, 42640],
                [46370, 46950],
                [49160, 50420],
                [50770, 52030],
                [52690, 53310],
                [53900, 55160],
                [57930, 59190],
                [59590, 60850],
                [61190, 62220],
                [66010, 67270],
                [67930, 68350]
            ],
            "total": 36660
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant