sensor.heart_rate_greg
72 bpm
The current reading is the entity state.
Documentation
See what each kind of entity contains, where detailed information is stored, and how to use it in dashboards and automations.
The basics
Most health metrics are simple numeric sensors. The state is the value you will normally display or use in an automation, such as steps, heart rate or sleep duration.
sensor.heart_rate_greg
72 bpm
The current reading is the entity state.
sensor.last_apple_workout_greg
Outdoor Run · 34 min · 5.2 km
The state is a summary. Individual values are attributes.
Entities normally follow sensor.<metric>_<user>. For example, the user greg receives sensor.steps_greg. Replace greg in the examples below with the suffix shown in your own Home Assistant entity ID.
In Home Assistant, open Developer tools → States, search for the entity, and look below its state. Attributes can also be read in templates with state_attr().
{{ state_attr('sensor.last_apple_workout_greg', 'distance_km') }}
Workouts
sensor.last_apple_workout_<user> contains the most recently synced Apple Workout. Its state is a readable summary assembled from the details that workout provides.
Distance, energy and heart-rate parts are omitted when the workout does not contain them. A strength workout, for example, may have duration and energy but no distance.
| Attribute | What it contains |
|---|---|
workout_id | The workout’s stable Apple Health identifier. |
workout_type | A friendly activity name such as Outdoor Run, Strength Training or Yoga. |
start_time | The workout start time. |
end_time | The workout end time. |
duration_s | Duration in seconds. |
duration_min | Rounded duration in minutes. |
active_energy_kcal | Active energy in kilocalories, when available. |
distance_m | Distance in metres, when available. |
distance_km | Distance in kilometres, when available. |
average_heart_rate_bpm | Average heart rate, when available. |
max_heart_rate_bpm | Maximum heart rate, when available. |
source | The app or device that recorded the workout, such as Apple Watch. |
route_available | Whether the workout indicates an outdoor route is available. Route coordinates are not exposed. |
summary | A shorter human-readable workout summary. |
last_synced | When Health Assistant Link last sent the workout. |
Distance: {{ state_attr('sensor.last_apple_workout_greg', 'distance_km') }} km
Average HR: {{ state_attr('sensor.last_apple_workout_greg', 'average_heart_rate_bpm') }} bpm
Started: {{ state_attr('sensor.last_apple_workout_greg', 'start_time') }}
Current behaviour: this entity holds the latest workout. It is not a browsable workout-history or calendar entity.
Sleep
Sleep is split across several entities so you can use simple totals and detailed stages independently.
| Entity | What it contains |
|---|---|
sleep_duration | Total sleep duration in hours. |
sleep_rem_hours | REM sleep duration in hours. |
sleep_core_hours | Apple Core, or light, sleep duration in hours. |
sleep_deep_hours | Deep sleep duration in hours. |
sleep_awake_hours | Time awake during the sleep session, in hours. |
sleep_unspecified_hours | Sleep Apple recorded without a Core, Deep or REM stage. |
asleep_time | The start of sleep as a Home Assistant timestamp. |
wake_time | The end of sleep as a Home Assistant timestamp. |
sleep_details | A stage-by-stage history series used to draw a hypnogram. |
sleep_details is meant to be read across its Home Assistant history, not as a single current number. The ready-made Sleep Details tile converts those stage codes into the familiar sleep chart.
The timestamp is the entity state. These entities also provide seconds_since_midnight, formatted_time, recorded_local_time and recorded_at attributes for cards and automations.
Medications · iOS 26+
Medication entities follow sensor.medication_<stable-id>_<user>. Their state gives today’s adherence at a glance:
| Attribute | What it contains |
|---|---|
name | The medication’s display name. |
taken | Number of doses recorded as taken today. |
scheduled | Expected number of doses today, or 0 when no total is available. |
skipped | Number of doses recorded as skipped today. |
has_schedule | Whether Apple Health has a schedule for the medication. |
summary | Readable text such as “2 of 3 taken”. |
dose_taken | Total quantity taken today, when available. |
dose_scheduled | Total quantity scheduled today, when available. |
unit | The dose unit, when available. |
latest_status | The latest Apple Health dose-event status, when available. |
{{ state_attr('sensor.medication_your_id_greg', 'summary') }}
{{ state_attr('sensor.medication_your_id_greg', 'dose_taken') }}
{{ state_attr('sensor.medication_your_id_greg', 'unit') }}
Two-way sync
Health Assistant Link can read a numeric Home Assistant entity and save its value as a supported Apple Health quantity. Each pairing connects one Home Assistant entity to one Apple Health metric.
In Health Assistant Link, select the HA to Apple tab.
If prompted, create a Long-Lived Access Token from your Home Assistant profile under Security, then paste it into the app. This lets the app read the entities you choose.
Metrics that cannot be safely written from a single numeric value are disabled in the list.
Select the numeric entity whose value should be written to that Apple Health metric.
Accept the permission request for the selected metric. The pairing then runs during permitted syncs.
Health Bridge’s own entities cannot be selected as the source for a reverse pairing. Use an entity created by another integration, helper, template or device.
For readings such as weight, temperature or blood pressure, the full numeric entity state is written when Home Assistant reports a newer update.
Cumulative metrics such as steps, energy, distance and nutrition are written incrementally to avoid duplicated totals.
Human-scale Home Assistant percentages such as 21.5 are converted to Apple Health’s fractional format automatically.
The pairing uses the number in the entity state. Choose or create an entity whose value already matches the selected Apple Health metric’s expected unit.
| Apple Health target | Expected Home Assistant value |
|---|---|
| Body weight and lean body mass | Kilograms |
| Distance, height and waist | Metres |
| Water | Millilitres |
| Heart and respiratory rates | Counts per minute, such as bpm |
| Blood pressure | mmHg |
| Blood glucose | mg/dL |
| Temperature | Degrees Celsius |
| Percentages | 0–100; conversion is automatic |
The Home Assistant unit label is shown when choosing an entity, but it is not used to convert the number. If the units differ, create a Home Assistant template sensor with the correct value first.
Enabled pairings are checked during permitted syncs. Only new Home Assistant updates are written, helping prevent duplicate Apple Health samples while preserving when the source value changed.
Values and history
For ordinary metrics, the entity state is the latest synced value. The recorded_at attribute preserves when Apple Health says that reading occurred, which can differ from the time Home Assistant received it.
Metrics such as steps, active calories, distance and nutrition normally represent today’s accumulated total.
Metrics such as heart rate, weight, blood oxygen and temperature normally represent the latest available sample.
When enabled, recent numeric readings are added to detailed Home Assistant history with their original timestamps. Manual backfill can cover up to 14 days.
Backfilled readings appear in detailed entity history. They do not rewrite Home Assistant’s already-completed long-term statistics periods.
steps, distance, active_calories, exercise_time, stand_time, flights_climbed, walking metrics, cycling distance, swimming distance and wheelchair metrics.
Heart rate, resting heart rate, HRV, blood oxygen, respiratory rate, blood pressure, blood glucose, temperature, weight, body fat, lean body mass, VO₂ max and more.
Sleep duration and stages, asleep and wake times, sleep details, mindful minutes, cardio recovery and physical effort.
Energy, water, protein, carbohydrates, fat, fibre, sugar, caffeine, vitamins and minerals. These are generally today’s accumulated totals.
UV index, UV exposure, time in daylight, headphone audio exposure and environmental audio exposure.