PAIesque: Your Transparent Fitness & Health Tracker

Table of Contents

1. How to Import Data from Gadgetbridge

Prerequisite: Install Gadgetbridge and set it up to sync heart rate data from your device.

To import your activity and health data into this app, you first need to configure Gadgetbridge to automatically export its database file.

Step 1: Set the Export Location

This tells Gadgetbridge where to save the file.

Step 2: Enable Automatic Export

Step 3: Run the First Export (Required for First Use)

You're All Set! Return to this app and select the Gadgetbridge.db file.

2. What is This Fitness Score?

This app calculates a transparent, heart-rate-reserve-based cardiovascular fitness score. It is inspired by the scientific principles behind PAI (Personal Activity Intelligence), a metric developed by researchers at the NTNU Cardiac Exercise Research Group (CERG).

This app uses the same 100-point weekly target as the PAI metric. This specific threshold is central to the health guidance derived from the underlying research. The value originates from extensive long-term studies, most notably the large-scale HUNT study in Norway. Analyses of the study data showed that maintaining a weekly score of 100 points or more was the level of activity optimally associated with a significant reduction in the risk of mortality from cardiovascular diseases. Therefore, aiming for a 7-day score of 100 or more is the key health goal when using this metric.

Unlike commercial "black box" scores, this app uses a fully disclosed formula based on the established Karvonen Heart Rate Reserve (HRR) method.

Key Differences from Commercial Products:

Important Note:
This is an independent, community-developed application. The fitness score it provides is based on public scientific principles but is distinct from the official, proprietary Personal Activity Intelligence (PAI®) metric. It is not affiliated with or endorsed by NTNU.

3. How The Score Works For You

In short: Stay active consistently to maintain a healthy weekly score!

4. For the Technically Curious: The Score

This implementation follows the research principles published by the NTNU Cardiac Exercise Research Group (CERG), which are also the foundation for the PAI metric. The method is based on translating heart rate data into a quantifiable score using your Heart Rate Reserve (HRR).

The Science Behind the Score

Core Principle:
The algorithm translates physiological stress on the cardiovascular system (heart rate over time) into a quantified score. This is based on the established Karvonen (HRR) method, a standard in exercise science for personalizing intensity, and is similar in concept to foundational training load models like TRIMP.

1. Intensity (The Foundation):

For any given heart rate (HR), the intensity is calculated as a fraction of your Heart Rate Reserve (HRR = Max HR - Resting HR).

Intensity = (HR - Resting HR) / (Max HR - Resting HR)

2. Points per Minute (The Conversion):

This intensity is then mapped to points earned per minute.

Your total score is the rolling 7-day sum of all points earned.

Since this implementation follows the core PAI research methodology—using the same Heart Rate Reserve foundation, intensity bands, and the 100-point weekly target—the resulting fitness score is designed to be functionally equivalent to the official PAI metric. In theory and in practice, for the same heart rate data and user profile, the scores generated by this app and a commercial PAI product like Mia Health are intended to be very similar. The primary difference lies not in the resulting value, but in this application's open and transparent approach to the calculation, its device-agnostic nature, and its local, private data processing.

5. What is Resting Heart Rate (RHR)?

Resting Heart Rate (RHR) is your heart rate when you're completely at rest, typically measured in beats per minute (bpm). It's a key indicator of your cardiovascular fitness and overall health.

6. How RHR Calculation Works

The app calculates your Resting Heart Rate using an adaptive algorithm that improves accuracy based on your data quality and personal baseline.

Key Features:

The Technical Process:

Core Calculation Steps:

1. Filter to measurement window: Collect heart rates between your configured start and end times

validHRs = heart rates between [start_time, end_time]

2. Apply personalized filtering: Use your historical baseline to exclude outliers

validHRs = validHRs within [personalizedMin, personalizedMax]

3. Calculate adaptive percentile: The algorithm automatically selects the optimal percentile based on your data quality:

if (count >= 300): percentile = 5
else if (count >= 150): percentile = 8
else if (count >= 75): percentile = 10
else: percentile = 15

Why Adaptive Percentiles?

Personalized Baseline System

Configuration & Limitations

8. Frequently Asked Questions

Q: My fitness scores seem too low or inaccurate. What could be wrong?

A: This is usually caused by incorrect personal health settings. Check your Settings (heart monitor icon) to ensure your Maximum Heart Rate and Resting Heart Rate are accurate. These values determine your personal heart rate zones (via the HRR formula) for the score calculation.

Q: My watch records data, but I'm not earning many points.

A: The score requires frequent heart rate measurements during activities. Enable real-time heart rate monitoring in your device settings or manufacturer's app (like Huawei Health) for more accurate activity tracking. The score only accrues when your heart rate is above 50% of your Heart Rate Reserve.

Q: Why does my RHR seem higher than expected?

A: RHR naturally fluctuates due to stress, hydration, sleep quality, and recent exercise. Our adaptive algorithm filters these variations, but consistent measurement during your typical rest period will improve accuracy.

Q: I changed my RHR measurement time - will this affect historical data?

A: Yes - the app automatically recalculates ALL historical RHR values using your new measurement window. This ensures consistent methodology across your entire dataset for more reliable trend analysis.

Q: How does this app's score compare to Garmin's "Intensity Minutes" or Fitbit's "Zone Minutes"?

A: They all use Heart Rate Reserve (HRR) to personalize intensity. The key difference is purpose: Garmin/Fitbit aim to track time spent meeting weekly activity guidelines (e.g., 150 mins). This app's score, like the research behind PAI, is designed to model the cardiovascular health benefit of your activity over a rolling week, rewarding higher intensities more.