[!CAUTION] Due to Google deprecating the Fit API (see below), Google are blocking any new developers signing up to this API. As such, any new user wanting to use this integration who has not already signed up to the Fit API will not be able to. To anyone affected by this, I'm as annoyed and disappointed as you ☹️
[!WARNING] Google is shutting down the REST API on 30th June 2025. As this integration relies on this API, it will no longer work after this time.
Additional information (and maybe solutions if they come along) can be found on Issue #250.
This integration interfaces with the Google Fit REST API to provide Google Fit data within Home Assistant.
This integration will set up the following platforms.
Platform | Name | Description | Infrequent Update |
---|---|---|---|
sensor |
active_minutes_daily |
Active Minutes. Reset daily. | ☐ |
sensor |
calories_burnt_daily |
Calories burnt (kcal). Reset daily. | ☐ |
sensor |
basal_metabolic_rate |
Base Metabolic Rate (kcal). Calories per day based on weight and activity. | ☐ |
sensor |
distance_travelled_daily |
Distance travelled (metres). Reset daily. | ☐ |
sensor |
heart_points_daily |
Heart Points earned. Reset daily. | ☐ |
sensor |
height |
Height (metres). | ☑ |
sensor |
weight |
Weight (kilograms). | ☑ |
sensor |
body_fat |
Body Fat (percentage). | ☑ |
sensor |
body_temperature |
Body Temperature (celsius). | ☑ |
sensor |
steps |
Number of steps taken. Reset daily. | ☐ |
sensor |
deep_sleep |
Deep sleep time over the past 24 hours. May not be available depending on sleep data provider. | ☐ |
sensor |
light_sleep |
Light sleep time over the past 24 hours. May not be available depending on sleep data provider. | ☐ |
sensor |
rem_sleep |
REM sleep time over the past 24 hours. May not be available depending on sleep data provider. | ☐ |
sensor |
awake_time |
Awake time during a sleep session over the past 24 hours. Not overall daily awake time. May not be available depending on sleep data provider. | ☐ |
sensor |
sleep |
Overall sleep time over the past 24 hours. | ☐ |
sensor |
blood_pressure_diastolic |
Most recent Diastolic blood pressure reading. | ☐ |
sensor |
blood_pressure_systolic |
Most recent Systolic blood pressure reading. | ☐ |
sensor |
heart_rate |
Most recent heart rate measurement. | ☐ |
sensor |
resting_heart_rate |
Most recent resting heart rate measurement. | ☐ |
sensor |
blood_glucose |
Latest blood_glucose measurement (mmol/L). | ☐ |
sensor |
hydration |
Total water consumed. Reset daily. | ☐ |
sensor |
oxygen_saturation |
The most recent blood oxygen saturation measurement. | ☐ |
Please note, there is a delay (roughly 30-60 minutes) between sensor measurements being recorded on the Google Fit app and the data then being available to query of the rest API. As such, although this integration polls the API more frequently than this it will take at least this length of time for your data to appear in Home Assistant. It is not instantaneous.
I will not try to duplicate what has already been documented countless times before as it will no doubt become out of date.
Instead, follow the instruction in the Official Home Assistant Docs for Google Mail under the "Generate Client ID and Client Secret" section, replacing instructions for 'Gmail API' with 'Fit API'.
HACS Installed in Home Assistant: Home Assistant Community Store
Google Fit
configuration.yaml
).custom_components
directory (folder) there, you need to create it.custom_components
directory (folder) create a new folder called google_fit
.custom_components/google_fit/
directory (folder) in this repository.Setup is done completely in the UI. Go to your integrations page by clicking the button below.
Click "+ Add Integration", search for "Google Fit" and follow the steps. If you have set the app you created in the Credentials configuration to publish (which you should've done to avoid re-authentication problems) then you will probably see a warning step asking if you want to proceed.
You can hit "Advanced", then "Proceed" as you are the 'developer' of the app, as you created the app and credentials in your own account.
The following options can be tweaked after setting up the integration:
Option | Description | Default |
---|---|---|
Update interval | Minutes between REST API queries. Can be increased if you're exceeding API quota | 5 (minutes) |
Infrequent Sensor Multiplier | Multiply the update interval by this for less frequently updated sensors, e.g. height. This reduces unnecessary API queries. | 12 (so default 5 mins update interval changes to an hour) |
All sensors in this integration can be grouped into two categories; cumulative or individual. This is due to how data is reported in your Google Fit account. Every piece of data is only associated with a time period and has no underlying logic for running totals.
For example, steps are reported like this in your account:
There is then some built-in logic in this integration to work out what sensor we're dealing with, and to either sum up these values over a logical time period, or to just take the latest known value, when the sensor is something like height.
If you're interested in all the underlying logic, it's contained in api.py.
The behaviour of this integration when there is no data available in your account differs depending on the sensor category.
Cumulative sensors will use 0 as their base value and this will be their value in Home Assistant if their is no data in your Google Fit account for that sensor.
Individual sensors will only report a value if they can find some data in your Google Fit account.
Otherwise, they will show Unknown
.
Besides Unknown
, there is an additional Home Assistant sensor state; Unavailable
.
This state has nothing to do with if there is or isn't data in your account. It indicates some error in the fetching of the data. Your internet has stopped working, or maybe the Google servers are down. In some cases, it may also indicate there is a bug with this integration. If that is the case, please report it as a bug.
There are no plans to ignore these data fetching issues and retain the last known sensor value. The reasoning for this is:
Use the following steps to setup additional Google Fit accounts in Home Assistant.
If you made a mistake somewhere when configuring your credentials, whether with the Google Cloud Console or within Home Assistant, you need to delete not just the integration to be prompted to reconfigure but also the 'bad' credentials.
To do this, go to the Integrations page and click the 3 dots in the top right and go to "Application Credentials". From there you can select the credentials and remove them.
If you want to contribute to this please read the Contribution guidelines