Automated tasmota backups
A smart home consists of dozens of smart devices — and backing them up is essential to restore them quickly in case of failure.
My smart home heavily relies on tasmota[arch] powered smart devices to work properly. While the tasmota software itself is rock stable and barely leads to any downtimes, the hardware it is running on isn’t quite. What do you do if you don’t have any tasmota backup and the device breaks? Would you be able to restore the configuration of dozens or even hundreds of devices just by remembering?
As you would do with any other critical part of your IT infrastructure, the simplest solution is to backup your tasmota device and restore it if required.
How to do a tasmota backup
Tasmota exposes an API that can be used to dump the settings of the device. There is a tool decode-config[arch] provided by the tasmota team, that allows you to backup a single device.
Automate tasmota backups
My requirements for automated tasmota backups are:
- Fully automated
- Independent of my workstation (backup as a service)
- Versioned (multiple timestamped backups for each device)
So I created tasmockup[arch] (Tasmota + Backup). Tasmockup[arch] is a wrapper for decode-config that backs up all configured tasmota devices at a fixed schedule. It is available as a docker container that can easily be deployed to any environment.
I am using tasmockup to do automated tasmota backups for all of my devices. The tasmockup container is hosted on my server which anyway already runs homeassistant and other smart home services. Tasmockup does a daily backup of all tasmota devices in my network and versions the backups with a unix timestamp.
Click here to check out Tasmockup on GitHub[arch]
Configuration
The configuration is quite simple. As per the time of writing this article, you specify which devices need to be backed up and mount a docker volume to store the backups on:
1docker run -t -i -e DEVICES="192.168.0.2;superSecret 192.168.0.3;AnotherSecret" -v tasmota-backups:/data gorootde/tasmockupYou can find a detailed description of how to configure tasmockup in the README.md[arch] on GitHub.
Restoring
Backups can easily be restored using the tasmota WebUI. Just navigate to Backup Configuration / Restore Configuration and upload your backup.