Mi-Fit-and-Zepp-workout-exporter icon indicating copy to clipboard operation
Mi-Fit-and-Zepp-workout-exporter copied to clipboard

Export other data besides the workouts

Open maximmasiutin opened this issue 1 year ago • 3 comments

Thank you very much for your application! Could you please expand the application by adding functionality to export other data besides the workouts. Such additional data worth exporting is weight measurements, etc. Thank you again!

maximmasiutin avatar Dec 31 '23 08:12 maximmasiutin

I agree with you. In Zepp and Mi-Fit application, there is no possibility to have data of swimming pool activity. We have access to summary data but not timing of every lap... I will try to find this, I hope someone could find the good variable to extract

ganq76 avatar Jan 17 '24 17:01 ganq76

@maximmasiutin Unfortunately, I no longer use a Mi Band (and Zepp), which somewhat limits my motivation to continue expanding the scope of this application. After some digging, I found an old script which synchronizes weight measurements to Garmin Connect, here is the relevant endpoint if you'd like to experiment with a data exporter:

from datetime import datetime

from httpx import AsyncClient


async def get_weight_records(last_weigh_in_date: datetime, token: str, user_id: str) -> dict:
    async with AsyncClient() as client:
        resp = await client.get(
            url=f"https://api-mifit.huami.com/users/{user_id}/members/-1/weightRecords",
            headers={
                "apptoken": token,
                "appPlatform": "web",
                "appname": "com.xiaomi.hm.health",
            },
            params={"fromTime": int(last_weigh_in_date.timestamp()) + 1},
        )
        resp.raise_for_status()

    return resp.json()

I hope it helps!

rolandsz avatar Jan 18 '24 07:01 rolandsz

thanks you but I want to extract the lap or distance from a swimpool activity because I havent any GPS indication. At the end of the activity, the summary indicate the number of rotation but not the time of each rotation. I think, these data exist as the heart rate or other things, but I dont find the good variables. Do you think is it possible to extract the whole data of each workout ? Or to find the distance (or lap) parameter ?

ganq76 avatar Jan 18 '24 16:01 ganq76