Skip to content

Export nightly skin temperature to Health Connect / HealthKit #245

Description

@Aurelian-Shuttleworth

Disclaimer: this issue was drafted with AI assistance (Claude). The research below — file paths, line references, and record-type behavior — was verified against the current main branch of this repo and the Health Connect documentation, but please sanity-check the specifics before acting on them.

Is your feature request related to a problem?

Edge computes a nightly skin temperature (raw ADC mean in derivation_engine.dart as skin_temp_adc, plus a skin_temp_z z-score), but it never leaves the app. For recovery pipelines that read from Health Connect, skin temperature is the one classic recovery signal missing from Edge's export set.

Research done before filing (so the maintainer doesn't have to):

  • The export policy lives in lib/health/health_export.dart (~line 1–15 header): the "honesty rule" deliberately excludes proprietary scores and "relative-only signals (SpO₂ / skin-temp)" from export.
  • The export loop is HealthExporter._exportDay (~line 629): per-day, delete-then-write idempotent, gated on health_export_through. Records currently written: RestingHeartRateRecord, HeartRateVariabilityRmssdRecord, RespiratoryRateRecord, ActiveCaloriesBurnedRecord, BasalMetabolicRateRecord, HeartRateRecord (per-minute, via lib/health/health_heart_rate_batch.dart + native HealthConnectHeartRateWriter.kt), SleepSessionRecord with stages, and ExerciseSessionRecord (start/end/kcal only).
  • AndroidManifest.xml declares Health Connect permissions for HR, RestingHR, HRV, RespiratoryRate, ActiveCalories, BasalMetabolicRate, Steps (legacy purge), Sleep, Exercise — no temperature permission today.
  • I searched this repo's full issue tracker and discussions for "skin temperature", "temperature", and "export" — no existing issue covers this.

Describe the solution you'd like

Export the nightly raw skin temperature mean as a Health Connect TemperatureRecord (measurement location: skin), once per finalized sleep window, following the same day-window idempotent pattern as the other records. Health Connect has a native TemperatureRecord type, so this doesn't require inventing a type or exporting a derived score.

Why I think this is compatible with the honesty rule: the raw nightly mean is an honest absolute-ish measurement — it's the z-score (skin_temp_z) that's relative/baseline-dependent, and that's the part that would stay app-only. Exporting the absolute value lets downstream apps compute their own baselines, the same way they already must for HRV and RHR.

Describe alternatives you've considered

  • Keep it app-only (current state). Works, but blocks skin temperature from any Health Connect consumer.
  • Export the z-score instead — rejected as it embeds Edge's baseline choice into external systems, which seems less aligned with the honesty rule than exporting the raw mean.

Additional context

Downstream path if accepted: Health Connect → Google Health cloud sync will most likely surface this as the core-body-temperature data type (measurement-location-tagged), not the Fitbit/Pixel-style daily-sleep-temperature-derivations — so consumers should expect an absolute temperature series rather than a baseline-relative derivation. On iOS, HealthKit's HKQuantityTypeIdentifierBodyTemperature would be the equivalent write.

Use case motivating the ask: Home Assistant users reading the Google Health API currently get HRV, RHR, respiratory rate, and sleep from Edge; skin temperature would complete a standard four-signal recovery calculation (HRV/RHR/sleep/temp z-scores) without a WHOOP subscription.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions