diff --git a/source/_integrations/google_drive.markdown b/source/_integrations/google_drive.markdown index e2cc4715a472..30c3b29e020a 100644 --- a/source/_integrations/google_drive.markdown +++ b/source/_integrations/google_drive.markdown @@ -23,7 +23,7 @@ related: title: Google Developer Console --- -This {% term integration %} allows you to connect your [Google Drive](https://drive.google.com) with Home Assistant Backups. When you set up this integration, your Google Drive will have a new folder called Home Assistant where all the backups will be stored. You can rename this folder to whatever you like in Google Drive at any point in time. If you delete the folder, it will automatically be re-created as long as you have the {% term integration %} enabled. +This {% term integration %} allows you to connect your [Google Drive](https://drive.google.com) with Home Assistant Backups. When you set up this integration, your Google Drive will have a new folder called `Home Assistant` where all the backups will be stored. You can rename this folder to whatever you like in Google Drive at any point in time. If you delete the folder, it will automatically be re-created as long as you have the {% term integration %} enabled. For a video walkthrough of the setup instructions, see this video from 13:50 to 19:20 @@ -40,6 +40,48 @@ These are not the same as *Device Auth* credentials previously recommended for [ {% include integrations/google_oauth.md %} +## Sensors +The integration provides the following sensors, which are updated every 6 hours: + +- **Total available storage**: The storage limit, if applicable. This will be unknown if the user has unlimited storage. +- **Used storage**: The total storage usage across all Google services. +- **Used storage in Drive**: The usage by all files in Google Drive. This entity is disabled by default. +- **Used storage in Drive Trash**: The usage by trashed files in Google Drive. This entity is disabled by default. +- **Total size of backups**: The sum of the size of all backups for the current Home Assistant's installation. + +For users that are part of an organization with pooled storage, information about the available storage and used storage across all services is for the organization, rather than the individual user. + +## Examples + +Get started with these automation examples. + +### Send alert when drive is near storage limit + +Send an alert when the drive usage is close to the storage limit and needs clean up. + +{% details "Example YAML configuration" %} + +{% raw %} + +```yaml +alias: Alert when Google Account is close to storage limit +description: Send notification to phone when drive needs clean up. +triggers: + - trigger: numeric_state + entity_id: sensor.example_gmail_com_used_storage + above: "{{ states('sensor.example_gmail_com_total_available_storage') | float * 0.9 }}" +actions: + - action: notify.mobile_app_iphone + data: + title: Google Account is almost full! + message: > + Google Account has used up {{ states('sensor.example_gmail_com_used_storage') }}GB of {{ + states('sensor.example_gmail_com_total_available_storage') | float }}GB. +``` + +{% endraw %} +{% enddetails %} + ## Removing the integration {% include integrations/remove_device_service.md %} @@ -53,3 +95,4 @@ These are not the same as *Device Auth* credentials previously recommended for [ ## Troubleshooting If you have an error with your credentials, you can delete them in the [Application Credentials](/integrations/application_credentials/) user interface. +