HealthKit sensors without any samples are registered and stay unavailable (iPhone without glucose/temperature data, iPad)

Aperta
#6,327 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
swift
Ambito
mobile

Direzione di ricerca

Start by locating the HealthKit sensor registration and sample availability handling in the iOS app; the issue does not name the files or tests. Check how supported HealthKit types are registered when they have no samples or read access, then decide which expected behavior fits the project. Done means types with no applicable data no longer appear as permanently unavailable, with relevant behavior covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

iOS device, version and app version

  • iPhone (iPhone19,2), iOS 27.3, app 2026.11.0 (2026.3388)
  • iPad Pro 12.9" (iPad8,11), iPadOS 27.3, app 2026.11.0 (2026.3388)

Home Assistant Core Version

2026.12.0b2

Describe the bug

The HealthKit sensors are registered for every supported type, also when the device has no samples of that type (or no Health data at all). Those sensors then stay unavailable forever:

  • iPhone: basal_body_temperature, body_temperature, blood_glucose (no device that measures these is paired, so HealthKit has no samples)
  • iPad: all 17 health sensors (heart_rate, weight, vo2_max, blood_pressure_*, respiratory_rate, blood_oxygen, in_bed, …) — the iPad is not a health data source

unavailable is the state for "cannot reach the device", so these show the warning mark and end up in every "unavailable entities" list, next to real problems.

To Reproduce

  1. Install the app on an iPhone without, for example, a glucose meter, or on an iPad.
  2. Grant Health access (or not).
  3. The sensors for types without samples are created and stay unavailable.

Expected behavior

One of:

  • only register a HealthKit sensor once the type has at least one sample (and/or read access was granted), or
  • report unknown instead of unavailable when there is simply no sample yet.

Additional context

Related: #6293 (hinge/pose sensors registered on a non-foldable iPhone/iPad, same pattern). General discussion about "not applicable" vs "unavailable": home-assistant/feature-requests discussion #5752.

Lingua principale
Swift
Stelle
2.4k
Fork
583
Merge medio
1g 10h
PR unite (30g)
82

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di home-assistant/iOS

Tutte le issue di home-assistant/iOS

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.