Add HealthKit Reproductive Health sensors (menstrual cycle data) #4498
Unanswered
proffalken
asked this question in
iOS & macOS
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the feature
HealthKit has a "Reproductive Health" category of data types (HKCategoryTypeIdentifier.menstrualFlow, .intermenstrualBleeding, .ovulationTestResult, .sexualActivity, .contraceptive, .pregnancyTestResult, .progesteroneTestResult) that's already populated for a huge number of users today, either by Apple's own Cycle Tracking feature in the Health app or by third-party period-tracking apps (Flo, Clue, etc.) that write into HealthKit. None of it is currently readable through the companion app's Health sensors, even though it sits in the same place as the metrics that already are (steps, heart rate, weight, and so on).
Because there's no path to it in-app, anyone who wants this data in Home Assistant has to reach for a separate, unofficial integration built outside HealthKit entirely — e.g. Cyclist (https://github.com/ringleader/cyclist) or HA_menstrual_gauge (https://github.com/nremey/HA_menstrual_gauge) — which means re-entering or re-syncing data that's already sitting in Health, instead of just toggling on a sensor the way you would for any other HealthKit metric.
Add a new sensor category (e.g. "Reproductive Health") to the existing HealthKit sensor catalog, read-only, opted in the same way every other Health sensor is — nothing requested from HealthKit unless the user explicitly enables it. At minimum: menstrual flow and cycle start/end. Ideally also intermenstrual bleeding and ovulation test results, since they're part of the same HealthKit category and commonly used together for cycle-based automations.
Use cases
I'm raising this on principle rather than a personal need — it stood out that the app tracks a long list of health metrics but has no path to reproductive health data, despite HealthKit already supporting it. But the practical uses are the same as any other Health sensor: the obvious one is shopping-list automation, e.g. auto-adding period supplies a day or two ahead of a predicted start date, the same way people already automate grocery restocking from other sensor data. Beyond that: cycle-aware reminders/notifications, and surfacing the data on a shared household dashboard the way heart rate or sleep already are.
Examples
Two community projects already prove this is buildable and wanted — Cyclist (https://github.com/ringleader/cyclist) and HA_menstrual_gauge (https://github.com/nremey/HA_menstrual_gauge) — both built entirely outside HealthKit because there's no official path to the data. Apple's own Health app has treated this as a first-class category (Cycle Tracking) since iOS 13; the ask here is just for the companion app to read what's already there, the same way it reads every other HealthKit category.
Anything else?
Implementation-wise this isn't a drop-in catalog entry like the existing metrics. Everything in HealthKitMetric today is built around HKQuantityType (steps, heart rate, weight — continuous numeric samples with a unit and an aggregation). Reproductive health data is stored as HKCategoryType — discrete values (e.g. .none/.light/.medium/.heavy for flow) — which needs its own query path (HKObjectType.categoryType(forIdentifier:) + HKSampleQuery against category samples) and its own value-to-state mapping, distinct from the numeric scale/decimalPlaces model the current sensors use. There's already internal precedent for reasoning about this: the TODO in HealthKitMetric+All.swift calls out Sleep for the same reason — "HealthKit models it as a category type, not a quantity type, so it needs its own query and state shape." Given how sensitive this category of data is, it should stay strictly opt-in and be called out explicitly (rather than lumped silently into "enable all Health sensors") in whatever settings UI ships it.
All reactions