A tool to allow you to extract and access your backed up data from Home Assistant Automatic Backups
2.6K
Since recent versions of Home Assistant, Backups are greatly imporved, automated and securely encrypted. However, if, as an advanced user you wish to extract data from these backup files, there is no simple way to do so.
This tool is here to help you with data extraction.
What you will need :
To download this file you will have to :
Settings->System->Backups

To get your encryption key, either you have (RECOMMENDED) stored it somewhere safe or :
Settings->System->Backups->CONFIGURE BACKUP SETTINGS
Download emergency kit to download your backup encryption emergency kitShow my encryption key to copy it and use it as isFirst you need to prepare your data : Create data directories and copy files :
mkdir -p ./input ./output
cp Automatic_backup.*.tar ./input/
cp home_assistant_backup_emergency_kit*txt ./input/
This project uses uvā to manage its Python environment. Requires Python 3.11+ (uv will fetch a suitable interpreter for you if needed).
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/acaranta/home_assistant_backup_decryption.git
cd home_assistant_backup_decryption
uv run hass_backup_decrypt.py -i ./input -o ./output
docker build -t acaranta/home_assistant_backup_decryption .
docker run --rm -ti \
-v $(pwd)/input:/input:ro \
-v $(pwd)/output:/output \
--user=$(id -u):$(id -g) \
acaranta/home_assistant_backup_decryption
The script has several options available that you can review using
uv run hass_backup_decrypt.py --help
# or
docker run --rm -ti acaranta/home_assistant_backup_decryption --help
š Home Assistant Backup Decryption Tool
=======================================
usage: hass_backup_decrypt.py [-h] [-i INPUT] [-o OUTPUT] [-k KEY]
Home Assistant Backup Decryption Tool
options:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input directory containing backup files (default: /input)
-o OUTPUT, --output OUTPUT
Output directory for decrypted files (default: /output)
-k KEY, --key KEY Encryption key (Format XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX)
NB : if the emergency kit is not found, and if you do not provide the encryption key as an option, you will be prompted to manually input it.
SecureTarFile.__init__() got an unexpected keyword argument 'key'TarFile.extractall() got an unexpected keyword argument 'filter'Both were caused by running against dependency versions the script did not support
(see issue #1ā ),
and are fixed since version 0.2.0. The script now adapts to whichever
securetarā release is installed (the key argument
was renamed to password in securetar 2025.12.0), and only uses extractall(filter=...) on
Python versions that support it (3.12+, or the 3.11.4 / 3.10.12 backports ā Debian 12 ships
Python 3.11.2, which does not). If you hit either message, update to the latest version.
Run the test suite with :
uv run pytest
The script idea comes from the script developped by cogneatoā (idea and some part of the code). But using as close as possible the same logic and modules (like securetarā ) and keep as close as possible to the decryption methods used in HA itselfā .
Content type
Image
Digest
sha256:9084c6db4ā¦
Size
47.5 MB
Last updated
4 days ago
docker pull acaranta/home_assistant_backup_decryption