Health sync

Steps · Sleep · BPM · Active KCAL

iPhone companion · Apple Health

The companion source is ready for installation through Xcode. It reads Steps, Sleep, Heart Rate and Active Energy with HealthKit and syncs to this tracker. It is not installed on your iPhone yet.

  1. Download the project on a Mac and open PersonalTrackerHealth.xcodeproj in full Xcode.
  2. Choose your Apple signing team with HealthKit capability, connect your iPhone and run the app. See the included README for setup.
  3. Prepare the Health-only token below, copy it, then open Tracker Health on iPhone.
  4. Paste the token, press Simpan token & izinkan Apple Health, grant read permissions, then press Sinkronkan sekarang.
Download iPhone project (.zip)

Open installed iPhone app

This download is source code, not an installable IPA or an App Store app. Compilation, Apple signing, installation and the first HealthKit test still require full Xcode and your iPhone. Preparing a token alone does not connect Health.

Android Health Connect is not available yet; it requires an Android companion app.

Back to Settings

Prepare Health connection

Use this Health-only token in the iPhone companion app or the existing Shortcut. Steps, Sleep, latest heart rate and active calories are accepted. Mood and Exercise Minutes are not synced.

Check samples in Apple Health under Steps, Sleep, Heart Rate and Active Energy. Permissions alone do not prove data is available.

Sign in on Home first, then prepare your Health-only token.

1. Install the template

Download Shortcut v5
  1. Download on iPhone, open with Shortcuts and add Sync Huawei Health v5.
  2. Replace PASTE_HEALTH_TOKEN_HERE in the first Text action only with Copy Health token above. The endpoint is already filled in. Do not edit If or Show actions.
  3. Allow read access for Steps, Sleep, Heart Rate and Active Energy. No Health write access is needed. Do not share the configured Shortcut; it contains your private token.

The file is signed and structurally checked on Mac. Actual iPhone Health access, source names and units still need your first manual test.

2. Test the four metrics

Open Huawei Health and wait for watch sync, then run the Shortcut while unlocked. Keep timezone Asia/Jakarta. Compare the same Huawei source data in Apple Health with Home:

  • Steps: today's total, not added again on each upload.
  • Sleep: previous noon to current noon, merging overlaps and excluding awake time.
  • Heart rate: latest Huawei reading today, not a sum or average. Unit must be count/min or BPM. Home shows the measurement time in WIB, not the upload time.
  • Active KCAL: today's active energy in kcal, not resting energy or MealSnap food calories. BPM and kcal are displayed rounded to whole values.

Unknown units and missing sources are skipped rather than guessed. A missing metric stays unchanged and displays Not synced if no upload has arrived. A watch can record data without Huawei sharing it to Apple Health.

3. Automate after testing

After verifying: Shortcuts → Automation → App → Huawei Health → Is Closed → Run Immediately → run Sync Huawei Health v5. Update an existing automation to select v5 instead of the older Shortcut.

Health reads while locked and background execution are limited by iOS. This is not guaranteed real-time sync. Wait for Huawei Health to finish syncing before leaving.

Repeated uploads replace totals; older captures and older BPM measurements are ignored. Mood and Exercise Minutes are not accepted.

Return to Home

Shortcut v5 sends individual KCAL decimals for server-side calculation. Sleep prefers Huawei records and falls back to other Apple Health sources; overlaps are merged, never added twice. Unknown sleep states are rejected rather than estimated.