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:
- Turn on a "recovery mode" scene automatically when your sleep score is low
- Show your HRV trend on a dashboard card alongside other home metrics
- Get notified if your resting heart rate spikes above your personal baseline
- Trigger a "wind down" lighting routine when your daily step goal is met
- Display today's activity ring progress on a wall panel or tablet dashboard
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.
- Download Health Data Export from the App Store on your iPhone.
- Open Settings → Sync and choose Home Assistant as your sync destination.
-
Enter your Home Assistant URL — for example
http://homeassistant.local:8123. - Generate a long-lived access token in HA: go to Profile → Long-Lived Access Tokens → Create Token, then copy the token.
- Paste the token into the app's Home Assistant settings field.
-
Set your entity prefix — for example
health. Sensors will appear assensor.health_steps,sensor.health_sleep, etc. The prefix is fully configurable. - 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>_steps | Daily step count | steps |
sensor.<prefix>_sleep | Sleep duration | hours |
sensor.<prefix>_resting_heart_rate | Resting HR | bpm |
sensor.<prefix>_hrv | HRV (SDNN) | ms |
sensor.<prefix>_active_energy | Calories burned | kcal |
sensor.<prefix>_weight | Body weight | kg |
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 Store100% Private · Data stays on your device