OneDrive

This integration allows you to use OneDrive for Home Assistant Backups.

Backups will be created in a folder called Home Assistant\backups_<id> in the App Folder of your OneDrive. id is part of your Home Assistant instance’s unique id to allow backups from multiple instances to the same OneDrive account. The integration only has access to an application specific Home Assistant folder in the App Folder and cannot access any other parts of your OneDrive.

Important

Because of an issue in the Graph API, the application-specific folder is often called Graph instead of Home Assistant.

Configuration

To add the OneDrive service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & Services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select OneDrive.

  • Follow the instructions on screen to complete the setup.

Client ID

Application ID of the app registration to be used with the integration. Uses Home Assistant provided by default.

Client secret

Application secret for the app registration. Uses Home Assistant provided by default.

Requested permissions by the integration

The integration will request the following permissions on your OneDrive for the integration to work:

  • Files.ReadWrite.AppFolder: Grants the application permission to read and write in its own, app-specific folder inside your OneDrive
  • offline_access: Grants the application permission to refresh its authentication token without requiring your manual intervention
  • openid: Grants the application permission to read basic information, e.g. if you have a OneDrive
Lists of permissions that the application will request.

Getting application credentials

This integration comes with a predefined set of application credentials through Home Assistant account linking. Nobody will ever have access to your data except you, as the app does not have permission to do anything on its own. It only works with a signed-in user (it only has delegated not application permissions). However, if you want to use your own credentials, follow this guide to create your own client ID and secret.

Note

If you set the integration up with the default credentials and switch to custom credentials later, your backup folder will change inside your OneDrive, and you will have to manually copy existing backups from the old folder to the new one.

Tip

You will need an Azure tenant with an active Azure subscription to create your own client credentials.

Known limitations

  • Only personal OneDrives are supported at the moment.

Removing the integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three-dot menu. Then, select Delete.