{"id":50255498,"url":"https://github.com/ndesgranges/zepp-health-ha","last_synced_at":"2026-05-27T05:38:12.091Z","repository":{"id":359878764,"uuid":"1247850785","full_name":"ndesgranges/zepp-health-ha","owner":"ndesgranges","description":"Home Assistant custom integration to import Zepp data from an on-android-device database","archived":false,"fork":false,"pushed_at":"2026-05-23T22:55:35.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-23T23:23:04.055Z","etag":null,"topics":["amazfit","hacs","home-assistant","home-assistant-integration","zepp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ndesgranges.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-23T21:39:19.000Z","updated_at":"2026-05-23T22:55:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ndesgranges/zepp-health-ha","commit_stats":null,"previous_names":["ndesgranges/zepp-health-ha"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ndesgranges/zepp-health-ha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndesgranges%2Fzepp-health-ha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndesgranges%2Fzepp-health-ha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndesgranges%2Fzepp-health-ha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndesgranges%2Fzepp-health-ha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndesgranges","download_url":"https://codeload.github.com/ndesgranges/zepp-health-ha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndesgranges%2Fzepp-health-ha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33553127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazfit","hacs","home-assistant","home-assistant-integration","zepp"],"created_at":"2026-05-27T05:38:11.150Z","updated_at":"2026-05-27T05:38:12.064Z","avatar_url":"https://github.com/ndesgranges.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![zepp-health-ha icon](custom_components/zepp_health/brand/icon.png)\n\n# Zepp Health Import for Home Assistant\n\n![GitHub branch check runs](https://img.shields.io/github/check-runs/ndesgranges/zepp-health-ha/master?style=for-the-badge)\n\n[![GitHub Release](https://img.shields.io/github/v/release/ndesgranges/zepp-health-ha?display_name=tag\u0026style=for-the-badge\n)](https://github.com/ndesgranges/zepp-health-ha/releases)\n\n\n[![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)\n\nImport **full historical health data** from Zepp (Amazfit/Huami) watches into Home Assistant's long-term statistics. All data appears in the built-in history graphs, statistics panels, and is usable in automations.\n\n## Metrics\n\n| Category | Sensors |\n|----------|---------|\n| **Training Load** | ATL (Acute/Fatigue), CTL (Chronic/Fitness), TSB (Form/Freshness), Daily Score |\n| **BioCharge** | Score, Wake BioCharge, Max/Min, Energy Consumed |\n| **Readiness** | Overall Score, Sleep/HRV/RHR/Recovery/Regularity components |\n| **Sleep** | Total, Deep, Light, REM, Awake minutes, Score, Sleep HR, Latency, Regularity |\n| **Heart** | HRV (RMSSD), Resting HR (from sleep) |\n| **Activity** | Daily Steps, Distance, Calories, PAI (daily + weekly) |\n| **SpO2** | Blood Oxygen Score |\n\n## Prerequisites\n\nYou need to extract the data from your watch databases first:\n\n1. **Root \u0026 ADB access** to pull databases from the Zepp app:\n   ```bash\n   adb pull /data/data/com.huami.watch.hmwatchmanager/databases ./zepp-databases\n   ```\n\n2. **Run the extraction script** (included in this repo under `scripts/`):\n   ```bash\n   python3 scripts/extract_zepp_health.py --db-dir ./zepp-databases\n   ```\n   This produces a `zepp_health_export.json` file.\n\n## Installation\n\n### HACS (Recommended)\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=ndesgranges\u0026repository=zepp-health-ha\u0026category=integration)\n\nOR\n\n1. Install HACS if you don't have it already\n2. Open HACS in Home Assistant\n3. On the top right side, click the three dot and click `Custom repositories`\n4. Where asked for a URL, paste the link of this repository:\nhttps://github.com/ndesgranges/zepp-health-ha\n5. Where asked for a type, select `integration`\n6. Click the download button. ⬇️\n\n### Manual\n\nCopy the `custom_components/zepp_health/` folder into your HA `config/custom_components/` directory.\n\n## Setup\n\n1. Go to **Settings → Devices \u0026 Services → Add Integration**\n2. Search for **Zepp Health Import**\n3. Choose **Upload JSON file** and select your `zepp_health_export.json`\n4. All historical data will be imported automatically\n\n## Updating Data\n\nAfter pulling fresh databases and re-running the extraction script:\n\n1. Go to **Developer Tools → Services**\n2. Call `zepp_health.import_file`\n3. Upload the new `zepp_health_export.json`\n4. All new data points are imported and sensors update\n\nAlternatively, call `zepp_health.import_history` to re-import from the previously uploaded file.\n\n## How It Works\n\n- On setup (or `import_file` call), the integration reads the full JSON export\n- Each metric's time series is imported as **long-term statistics** via `async_import_statistics`\n- These appear in HA's built-in history panel, energy dashboard, and statistics graphs\n- Sensor entities show the latest values and are available for automations/dashboards\n\n## Database Mapping\n\nThe extraction script reads from these Zepp databases:\n\n| Database | Data |\n|----------|------|\n| `phndata-*.db` | ATL, CTL, TSB, recovery factor |\n| `companion-aa.db` | Sleep stages, steps, daily sport load |\n| `HealthMatrix_*.db` | BioCharge, readiness, HRV, PAI, SpO2 |\n| `RestHeartDb` | Resting heart rate |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndesgranges%2Fzepp-health-ha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndesgranges%2Fzepp-health-ha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndesgranges%2Fzepp-health-ha/lists"}