← Back to home

Apple Health → Home Assistant

Sync Apple Health Data to Home Assistant

Turn your health metrics into Home Assistant sensor entities — then build automations that respond to your sleep quality, HRV, activity, and more.

What You Can Build

Once your Apple Health data flows into Home Assistant as live sensor states, your smart home can actually respond to how your body feels:

Step-by-Step Setup

The app pushes health data to Home Assistant's /api/states/sensor.<prefix>_<metric> endpoint using a long-lived access token. Each metric becomes a sensor entity with a state value and attributes including unit, friendly_name, and source.

  1. Download Health Data Export from the App Store on your iPhone.
  2. Open Settings → Sync and choose Home Assistant as your sync destination.
  3. Enter your Home Assistant URL — for example http://homeassistant.local:8123.
  4. Generate a long-lived access token in HA: go to Profile → Long-Lived Access Tokens → Create Token, then copy the token.
  5. Paste the token into the app's Home Assistant settings field.
  6. Set your entity prefix — for example health. Sensors will appear as sensor.health_steps, sensor.health_sleep, etc. The prefix is fully configurable.
  7. Tap Test Connection to verify, then enable Auto-Sync to keep your sensors updated on a schedule.

What Sensors Get Created

Each health metric becomes a named sensor entity in Home Assistant. The state holds the current value; attributes carry the unit, friendly name, and data source.

Sensor Entity State Value Unit
sensor.<prefix>_stepsDaily step countsteps
sensor.<prefix>_sleepSleep durationhours
sensor.<prefix>_resting_heart_rateResting HRbpm
sensor.<prefix>_hrvHRV (SDNN)ms
sensor.<prefix>_active_energyCalories burnedkcal
sensor.<prefix>_weightBody weightkg

Example Automation YAML

Once your sensors are live, drop this into your Home Assistant automations to activate a recovery scene whenever last night's sleep was under 6 hours:

automation:
  - alias: "Recovery Mode when Sleep < 6h"
    trigger:
      platform: state
      entity_id: sensor.health_sleep
    condition:
      condition: numeric_state
      entity_id: sensor.health_sleep
      below: 6
    action:
      service: scene.turn_on
      target:
        entity_id: scene.recovery_mode

Replace health with whatever entity prefix you configured in the app. The same pattern works for any numeric sensor — HRV, resting heart rate, steps, or active energy.

Dashboard Card Tip

Add a Gauge card or Entity card in your Lovelace dashboard pointing at any health sensor — for example sensor.health_hrv or sensor.health_steps. The Gauge card works especially well for metrics like HRV or resting heart rate where you want a quick visual against a target range. For timeline views, the History Graph card shows you how a metric moved across the day.

Start Syncing Apple Health to Home Assistant

Download Health Data Export, point it at your Home Assistant instance, and your health metrics are live sensors in minutes.

Download on the App Store

100% Private · Data stays on your device

Related guides