Common tasks - installation independent
This section provides tasks that do not depend on a specific Home Assistant installation type or a specific integration. They may be referenced in other procedures.
Backups
It is important to regularly back up your Home Assistant setup. You may have spent many hours configuring your system and creating automations. Keep your configurations safe so that you can restore a system or migrate your Home Assistant to new hardware.
Backups are encrypted and stored in a compressed archive file (.tar) and by default, stored locally in the /backup
directory.
A full backup includes the following directories:
config
share
-
addons
(only manually installed or created add-ons, not those installed from the store) ssl
media
A partial backup consists of any number of the above default directories and installed add-ons.
Preparing for a backup
Before creating a backup, check if you can reduce the size of the backup. This is especially important if you want to use the backup to migrate the system to new hardware, for example from a Raspberry Pi Compute Module 4 to a Raspberry Pi Compute Module 5.
- Check if your configuration directory contains a large database file:
- Go to Settings > System > Repairs.
- From the three dot menu, select System information and under the Recorder section, look for the Estimated Database Size (MiB).
- By default, the data is kept for 10 days. If you have modified that to a longer period, check the
recorder
integration page for options to keep your database data down to a size that won’t cause issues. - Note the keep days, purge interval, and include/exclude options.
- To check how much space you’ve used in total, go to Settings > System > Repairs.
- From the three dot menu, select System information, and check under Home Assistant Supervisor > Disk used.
- If you have add-ons installed that you no longer use, uninstall those add-ons. Some add-ons require quite a bit of space.
- If you want to store the backup on your network storage instead of just locally on your system, follow the steps on adding a new network storage and select the Backup option.
Setting up an automatic backup process
The automatic backup process creates a backup on a predefined schedule and also deletes old, redundant backups.
- Go to Settings > System > Backups.
- Under Automatic backups, select Configure automatic backups.
- Enable automatic backup.
- Define the backup schedule. It is recommended to back up daily.
- Define how many backups you want to keep.
- Older backups will be automatically deleted.
- For example: if you back up daily, and select 7 backups, then the backup from 8 days ago and older will be deleted.
- Define the data you want to back up.
- It is recommended to disable media and the share folder to reduce the size of the backup.
- A large backup also takes longer to restore.
- Some add-ons may also be quite large.
- Define the location for backups.
- Backups are encrypted. To be able to restore encrypted backups, download the emergency kit and store it somewhere safe.
- To learn more, refer to the documentation on the backup emergency kit.
Defining backup locations
You might need a backup in case your system has crashed. If you only store backups on the device itself, you won’t be able to access them easily. It is recommended to keep a copy on another system and ideally also one off-site.
About the backup storage on Home Assistant Cloud
If you have Home Assistant Cloud, you can store a backup of maximum 5 GB on Home Assistant Cloud. This cloud storage space is available for all existing and new Home Assistant Cloud subscribers without additional cost. It stores one backup file: the backup that was last saved to Home Assistant Cloud. Backups are always encrypted. To restore encrypted backups, you need the encryption key stored in the backup emergency kit.
To define the backup location for automatic backups
- Go to Settings > System > Backups and under Automatic backups, select Configure automatic backups.
- Under Locations, enable all the backup locations you want to use.
- If you don’t see Home Assistant Cloud in the list, you are not logged in
. - If you don’t see a network storage, you haven’t added one. Follow the steps on adding a new network storage and select the Backup option.
- If you don’t see Home Assistant Cloud in the list, you are not logged in
Creating a manual backup
This creates a backup instantly. You can create a manual backup at any time, irrespective of any automatic backups you may have defined.
- Go to Settings > System > Backups.
- In the lower-right corner, select Backup now and select Manual backup.
- Define the data you want to back up.
- It is recommended to disable media and the share folder to reduce the size of the backup.
- A large backup also takes longer to restore.
- Some add-ons may also be quite large.
- Provide a name for the backup.
- Choose the backup locations.
- To learn more about the locations, refer to the section on defining the backup location.
- Download the backup emergency kit and store it somewhere safe. Make sure you take note of the backup name it belongs to.
- To start the backup process, select Create backup.
Downloading your local backups
There are multiple ways to download your local backup from your Home Assistant instance and store it on another device:
Option 1: Download from the backup page:
- Under Settings > System > Backups, select Show all backups.
- To select one backup, on the list, single-click or tap the backup of interest.
- To select multiple backups, select the
button.
- To select multiple backups, select the
- In the dialog, select the three dots
menu and select Download backup. - Result: The selected backup is stored in the Downloads folder of your computer.
Option 2: Copy backups from the backups folder:
- If you haven’t already done so, configure access to files on Home Assistant, using one of the methods listed there.
- For example, use the samba add-on.
- In your file explorer, access Home Assistant, open the
backup
folder and copy the file to your computer.
Downloading a backup from Home Assistant Cloud
If you were logged in to Home Assistant Cloud and had Cloud backup enabled when creating a backup, your last backup is stored on Home Assistant Cloud.
- To download the backup, log in to your Home Assistant Cloud account
. - Under Stored files, you can see the latest available backup file. Select the download button.
Deleting obsolete backups
If you defined an automatic backup and backup purge schedule, old backups are deleted automatically. However, you might still have some old backups around that you want to delete.
To delete old backups, follow these steps:
- Under Settings > System > Backups, select Show all backups.
- To delete one backup, on the list, select the backup of interest.
- Select the three dots
menu and select Delete
- Select the three dots
- To delete multiple backups, select the
button. - From the list of backups, select all the ones you want to delete and select Delete selected.
-
Consider keeping at least one recent backup for recovery purposes.
Restoring a backup
There are two ways to use a backup:
- On your current system to recover your settings.
- During onboarding, to migrate your setup to a new device or to device on which you performed a factory reset.
Estimated duration
The time it takes to restore a backup depends on your installation. Home Assistant Core and all add-ons are being reinstalled. For a larger installation, this process can take about 45 minutes.
Restoring a backup during onboarding
You can use a backup during the onboarding process to restore your configuration.
Migration: This procedure also works if you want to migrate from one device to another. In that case, use the backup of the old device on the new device. The target device can be a different device type. For example, you can migrate from a Raspberry Pi to another device.
Prerequisites
- This procedure assumes you have already completed the installation procedure on your target device and are now viewing the welcome screen as part of the onboarding.
- The login credentials of the device from which you made the backup.
- The backup emergency kit that contains the key needed to decrypt the backup.
-
Required storage capacity: If you migrate the installation to a new device, make sure the new device has more storage capacity than the existing device.
- Before migrating, on the old system, check how much storage you used.
- Go to Settings > System > Repairs > … > System Information, and under Home Assistant Supervisor, look at the Disk used value.
- The target device must have more free space than the source device.
- If your target device is a Home Assistant Yellow, note that it is the size of the eMMC that is relevant.
- The restore process mainly uses the eMMC, not the NVMe.
- The size of the backup file is no indication of the size of your installation. To know the size of your installation, you need to check the Disk used value mentioned above.
- If you are migrating to a new device:
- You do not need to transfer the backup to a USB or SD card to bring it to your device.
- You will be able to upload the backup file from the device you are accessing the onboarding from.
To restore a backup during onboarding
- If you are migrating to a new device and you had controllers or radios connected (such as a Z-Wave stick or Connect ZBT-1):
- make sure to plug them into the new device.
- After Home Assistant has been installed, on the welcome screen, select Restore from backup.
- Then, select Upload backup.
- The file explorer opens on the device on which you are viewing the Home Assistant User interface.
- You can access any connected network drive from there.
- Select the backup file, then, in the dialog, select all parts you want to restore.
- Your current system will be overwritten with the parts that you choose to restore.
- If you want to restore the complete configuration with all directories and add-ons, select everything.
- Under Backup password, enter the encryption key stored in the backup emergency kit.
- To start the process, select Restore.
- The restore may take a while, depending on the amount of data.
- To see if the restore is complete, reload the page from time to time.
- If your previous installation had certificates enabled directly for the
http
integration, when the restore is complete, it will no longer respond tohttp://
requests. In this case, usehttps://
(addeds
) instead.
- On the login screen, enter the credentials of the system from which you took the backup.
- The login password and username must match the ones you used at the time the backup was taken.
- Your dashboard should show all the elements as they were when you created the backup.
- If some devices are shown as unavailable, you may need to wake the battery-powered devices.
- If you had network storage connected on the previous system, you may need to reconnect those.
- If you had Zigbee devices, and you migrated to a new device with its own Zigbee radio built-in:
- Because this is now a different Zigbee radio, you need to migrate Zigbee.
To restore a backup on your current system
- Go to Settings > System > Backups.
- From the list of backups, select the backup from which you want to restore.
- Select what to restore:
- Your current system will be overwritten with the parts that you choose to restore.
- If you want to restore the complete configuration with all directories and add-ons, select everything.
- If you only want to restore specific elements, only select the folders and add-ons you want to restore.
- Select Restore.
- This may take a while, depending on how much there is to compress or decompress.
- Once the restore is complete, Home Assistant restarts to apply the new settings.
- You will lose the connection to the UI and it will return once the restart is completed.
- On the login screen, enter the password and username as they were at the time the backup was taken.
Enabling or disabling entities
Some entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] are disabled by default. Whether a particular entity of a device is disable or enabled by default, depends on the integration. Diagnostic entities for example are often disabled by default so that they don’t clutter Home Assistant. For example, the RSSI entity (representing the RF signal strength) provided by the ZHA integration for each Zigbee device is disabled by default.
There are different ways to enable entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more]. You can enable a single entity in the entity settings, or you can enable multiple entities at once from the list of entities.
To enable or disable a single entity
-
Go to Settings > Devices & services and select your integration card.
-
Select the device.
-
To see all the entities, you may need to expand the entity not shown section.
-
Select the entity of interest, select the cogwheel
, then select the toggle for Enable. -
Select Update.
-
Confirm the notification stating that it will take about 30 seconds for the entity to become enabled. Select OK.
To enable or disable multiple entities
-
In Home Assistant, open the table of interest.
- To enable or disable entities, go to Settings > Devices & Services > Entities.
- To enable or disable automations, go to Settings > Automations & Scenes.
-
Enable multiselect and select all the entities you want to enable or disable.
-
In the top right corner, select the three dots
menu, then select Enable or Disable.
Related topics
Defining a custom polling interval
If you want to define a specific interval at which your device is being polled for data, you can disable the default polling interval and create your own polling automation.
What is data polling?
Data 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.
Why use an automation instead of changing the integration’s polling configuration?
Creating an automation for polling gives you more flexibility on when to poll:
- Not all integrations have a configurable polling interval. The homeassistant.update_entity service, on the other hand, works with most of the integrations; no code changes are required.
- An automation allows you to poll whenever you want. For example, if you have a rate-limited solar panel provider with a maximum number of requests per day, you may want to lower/stop the polling at night but poll more frequently during the day.
If you want to define a specific interval at which your device is being polled for data, you can disable the default polling interval and create your own polling automation.
To add the automation:
- Go to Settings > Devices & services, and select your integration.
- On the integration entry, select the
. - Then, select System options and toggle the button to disable polling.
- To define your custom polling interval, create an automation.
- Go to Settings > Automations & scenes and create a new automation.
- Define any trigger and condition you like.
- Select Add action, then, select Other actions.
- Select Perform action, and from the list, select the
homeassistant.update_entity
action.
- Save your new automation to poll for data.
Removing an integration instance
If you no longer want to use a device or service in Home Assistant, you can remove the integration instance including the device or service with all its entities.
The following steps describe the general steps needed to remove an integration instance. Depending on the integration, additional steps can be needed, such as resetting the device or to delete credentials. Refer to the integration documentation to see if additional steps are needed.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three-dot
menu. Then, select Delete.