A Home Assistant custom integration that syncs sleep data from the Google Health API into Home Assistant sensors. It is intended for Fitbit/Google wearable sleep data exposed through Google Health, avoiding the deprecated Fitbit Web API.
This is an unofficial project and is not affiliated with, endorsed by, sponsored by, or associated with Google, Google Health, Fitbit, or Home Assistant.
-
Open HACS in Home Assistant.
-
Go to Integrations.
-
Open the three-dot menu and choose Custom repositories.
-
Add this repository URL:
https://github.com/esotericzhang/GoogleHealthHomeAssistant -
Select category Integration.
-
Download Google Health Sleep.
-
Restart Home Assistant.
Copy:
custom_components/google_health_fitbit_sleep
to:
config/custom_components/google_health_fitbit_sleep
Then restart Home Assistant.
-
Enable the Google Health API in Google Cloud.
-
Create an OAuth 2.0 client ID and secret.
-
Add this authorized redirect URI to the OAuth client:
https://my.home-assistant.io/redirect/oauthUse this even when Home Assistant is hosted only on your local network.
-
In Home Assistant, go to Settings → Devices & services → Application Credentials and add the Google OAuth client ID and secret.
-
Add the Google Health Sleep integration from Settings → Devices & services → Add Integration.
- Latest minutes asleep
- Latest minutes awake
- Latest sleep period
- Latest sleep efficiency
- Latest deep sleep
- Latest light sleep
- Latest REM sleep
- Latest sleep start
- Latest sleep end
- Sleep records
The sleep_records sensor includes recent normalized sleep records in attributes for dashboards, templates, and plotting.
This project is licensed under the MIT License. See LICENSE.