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

Empty Active Calories burned #183

Open
rousseau634 opened this issue Dec 6, 2024 · 1 comment
Open

Empty Active Calories burned #183

rousseau634 opened this issue Dec 6, 2024 · 1 comment

Comments

@rousseau634
Copy link

rousseau634 commented Dec 6, 2024

Has anyone tried to get Active Calories burned? I always get 0, I wonder if this is a problem with health connect ?

@rousseau634 rousseau634 changed the title Active Calories burned Empty Active Calories burned Dec 6, 2024
@mphill
Copy link

mphill commented Feb 1, 2025

    const calories = 100;
    const caloriesRecords: ActiveCaloriesBurnedRecord = {
        recordType: "ActiveCaloriesBurned",
        energy: {
            value: calories,
            unit: "kilocalories",
        },
        startTime: startDate.toISOString(),
        endTime: endDate.toISOString(),
    };

Using kilocalories, this shows as 100 in Health Connect; if you use calories, it will show 0.

Health Connect will set a value of 0.1 to zero when it displays it.

Either multiply your calories by 1000 or use kilocalories.

You might be requesting the wrong unit. It isn't very clear because the entire world used kilocalories and calories interchangeably

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants