[New Custom Integration] Microsoft 365 OneDrive for Business Backups

Hey everyone!

I’m excited to share a new custom integration I’ve developed: Microsoft 365 OneDrive for Business Backups.

This only supports Business accounts as there is already an integration for OneDrive Consumer.

For a while, I’ve wanted a simple and seamless way to use my Business M365 account that I use personally, as a proper, native backup location in Home Assistant. Now, you can!

This integration allows you to add “Microsoft 365 OneDrive” directly to your backup providers list, making cloud backups a one-click process.

Key Features

  • Native Backup Target: “Microsoft 365 OneDrive” appears directly in the Home Assistant backup UI. No more manual scripts or complex workarounds.
  • Full Backup Management: Supports uploading, downloading, listing, and deleting backups right from the HA interface.
  • Protected & Secure: Backups are correctly marked as “protected” to align with Home Assistant’s security standards.
  • Automatic Cleanup: Set a maximum number of backups to keep, and the integration will automatically remove the oldest ones.
  • Large File Support: Automatically handles large backup files (>4MB) with resumable, chunked uploads, so even a spotty connection won’t stop your backup.
  • Automation-Friendly: Includes a service (hass-onedrive-m365.upload_latest_backup) so you can trigger uploads in your automations.
  • OneDrive Storage Sensor: Comes with a sensor to monitor your OneDrive storage usage (total, used, free, and percentage).

Screenshots

Here’s what it looks like in action:

Creating a backup and selecting OneDrive as the location:

I’m limited to only one image since this is my first post, see more at the github repo.

Installation

The easiest way to install is with HACS.

  1. Add the Custom Repository:
  • Go to HACS > Integrations > Click the 3 dots in the top right.
  • Select “Custom repositories” and add this URL:
https://github.com/ghostinator/hass-onedrive-m365

Select the category “Integration”.

  • Install: Search for “Microsoft 365 OneDrive” and click install.
  • Restart Home Assistant.

Configuration

There are two main steps to get it running:

  1. Azure AD Application: You’ll need to create an Azure AD application to grant Home Assistant access to your OneDrive. This is a standard process for Microsoft 365 integrations. I’ve written detailed, step-by-step instructions in the repository’s README.
    Click here for Azure AD Setup Instructions
  2. Add the Integration in Home Assistant: Once you have your credentials from Azure, go to Settings > Devices & Services > Add Integration, search for “Microsoft 365 OneDrive”, and enter your details.

Feedback and Contributions

This is a new integration, so I would love to hear your feedback! If you run into any issues or have ideas for new features, please open an issue on GitHub.

Future updates:
Add ability to choose folder in OneDrive to backup to
Add logo for icon

You can find the full source code and documentation on GitHub:

https://github.com/ghostinator/hass-onedrive-m365

Thanks for checking it out! Let me know what you think.

3 Likes

Will definitely check it out… Have a lot of storage space over there I can use. :sunglasses:

1 Like