Seafile
The Seafile integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] connects Home Assistant to your Seafile server.
Seafile is a self-hosted file sync and share server. Files are stored in libraries. This integration shows the size, number of files, and last modification time of the libraries you choose, and can store Home Assistant backups in them.
Use cases
- Keep an eye on how much storage your libraries use and get notified when one grows too large.
- Check that a library you back up to is still being updated.
- Store your Home Assistant backups on your own Seafile server.
Prerequisites
- A Seafile server that Home Assistant can reach.
- A Seafile account with access to the libraries you want to add.
Configuration
To add the Seafile 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.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Seafile.
-
Follow the instructions on screen to complete the setup.
The password of your Seafile account. It is only used to create an access token and is not stored.
If your account uses two-factor authentication, you are asked for the code from your authenticator app.
Home Assistant exchanges your password for an access token. In Seafile, this token is listed under the linked devices of your account as Home Assistant, followed by the name of your home in parentheses. Revoking it there disconnects Home Assistant.
After logging in, you can select the libraries to add. You can also skip this step and add libraries later.
Adding a library
- Go to Settings > Devices & services and select the Seafile integration.
- Select Add library.
- Select the library you want to add.
- Optionally, turn on Store backups and choose a Backup folder. See Backups.
To change the backup settings of a library later, select the
Supported functionality
Each library is added as a separate device in Home Assistant, with the following entities.
Sensors
-
Size
- Description: Total size of the files in the library.
-
Files
- Description: Number of files in the library.
-
Last modified
- Description: Time the library was last changed.
Backups
Each library with Store backups turned on is available as a backup location in Home Assistant, named after the account and the library, for example, admin@example.com (seafile.example.com) - Documents. Libraries you select while setting up the integration have backups turned off; turn them on by reconfiguring the library.
Each backup is stored in the backup folder as a .tar file, with a _meta.json file next to it that describes the backup. Don’t rename or delete only one of the two files: backups without both files are not listed.
Backups are uploaded in parts of 50 MiB, so they also work when Seafile is behind a proxy that limits the request size, such as Cloudflare.
For more information on backups, see backups.
Data updates
The Seafile integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] your Seafile server every 5 minutes.
The list of backups is cached for 5 minutes. Backups that you add or delete in Seafile directly can take up to 5 minutes to show up in Home Assistant.
Supported versions
The integration has been tested with Seafile 13 and 14 (Community Edition).
Known limitations
- Encrypted libraries are not supported and are not shown in the list of libraries.
- An account on a server can only be added once.
- There is no reauthentication yet. If the access token is no longer accepted, remove the integration and add it again.
Troubleshooting
Symptom: The sensors of a library are unavailable
The sensors of one or more libraries show as unavailable.
Description
Home Assistant can’t reach the Seafile server, or the library is no longer available to your account: it was deleted on the server, or your account lost access to it. When the server can’t be reached, the sensors of the account are unavailable as well.
Resolution
- Check that Home Assistant can reach the Seafile server, and look for connection errors in Settings > System > Logs.
- Sign in to the Seafile web interface with the same account and check that the library is still listed.
- Only if the library is gone from your account, delete its library entry from the Seafile integration page.
Symptom: A library is not listed as a backup location
The library is not shown as a location when you create a backup.
Description
Store backups is turned off for the library, or the Seafile account is not loaded.
Resolution
- On the Seafile integration page, select the
Reconfigure library button next to the library. - Turn on Store backups and select Submit.
- If the library still isn’t listed, check that the integration is loaded and its sensors are available.
Symptom: The integration fails to load with an authentication error
The integration shows an authentication error and its entities are unavailable.
Description
The access token of the integration was revoked or is no longer valid.
Resolution
Remove the integration and add it again with your current password.
Removing the integration
This integration follows standard integration removal.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- Next to the entry you want to remove, select the three dots
menu. Then, select Delete. - Depending on the integration, the entries are listed under one of the following headings:
- Devices
- Hubs
- Services
- Integration entries
- Depending on the integration, the entries are listed under one of the following headings:
- To confirm, select Delete.
- Home Assistant also deletes the devices and entities of the entry.
- If Home Assistant asks you to restart, restart Home Assistant.
- If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.
- If you keep them, Home Assistant uses them automatically when you add the integration again.
- To delete them later, refer to Deleting application credentials.
To also remove the access token from Seafile, delete the Home Assistant entry from the linked devices of your account.