Who is this workflow for? This workflow automates the backup of Zigbee2MQTT configurations from HomeAssistant by requesting backups at set intervals and securely storing them via SFTP. Leveraging n8n, it ensures that your Zigbee device configurations are regularly saved, facilitating quick recovery if your HomeAssistant instance requires rebuilding..

What does this workflow do?

Flow 1: Scheduled Backup Request

  • Trigger: Initiated by a Cron node set to the desired backup interval (e.g., daily at midnight).
  • Set Interval: Configure the Cron node with the specific schedule for backups.
  • Send MQTT Message: Utilize the MQTT node to publish a message requesting a Zigbee2MQTT backup. This message prompts Zigbee2MQTT to generate a backup of the current configuration.

Flow 2: Backup Reception and Storage

  • Trigger: Activated by receiving the Zigbee2MQTT backup message via MQTT.
  • Extract Zip File: Use a function or zip extraction node to unpack the received backup data.
  • Add Date-Stamp: Append the current date to the backup filename to organize backups chronologically.
  • SFTP Upload: Employ the SFTP node to transfer the backup file to a secure remote server. This step ensures that backups are stored safely and can be accessed when needed.

Setup Instructions

  • MQTT Connection:
  • Create an MQTT connection in n8n named “MQTT Account”.
  • Configure with the appropriate protocol (mqtt), host, port (1883), username, and password.
  • SFTP Connection:
  • Set up an SFTP connection named “SFTP Zigbee Backups” in n8n.
  • Provide the necessary host, port (22), username, and authentication method (password or key).

Reference

For detailed information on the MQTT integration with Zigbee2MQTT backups, refer to this article.

🤖 Why Use This Automation Workflow?

  • Automated Backups: Schedule regular backups without manual intervention, ensuring your Zigbee configurations are consistently saved.
  • Secure Storage: Transfer and store backup files securely using SFTP, protecting your data from unauthorized access.
  • Rapid Recovery: Quickly restore your Zigbee setup using the stored backups, minimizing downtime in case of system issues.

👨‍💻 Who is This Workflow For?

This workflow is ideal for HomeAssistant users who manage Zigbee devices via Zigbee2MQTT and seek a reliable method to back up their Zigbee configurations. It benefits both home automation enthusiasts and professionals who require robust backup solutions for their smart home setups.

🎯 Use Cases

  1. Routine Backup Automation: Automatically back up Zigbee2MQTT configurations daily, ensuring up-to-date copies are always available.
  2. Disaster Recovery: Quickly restore Zigbee device pairings and configurations after a system failure or HomeAssistant rebuild using the stored backups.
  3. Configuration Management: Maintain versioned backups of Zigbee settings to track changes over time and revert to previous configurations if needed.

TL;DR

This n8n workflow streamlines the backup process for your Zigbee2MQTT configurations by automating backup requests and securely storing the backups via SFTP. Implementing this automation ensures that your Zigbee setup is consistently protected, allowing for swift recovery and minimal disruption to your HomeAssistant environment.

Help us find the best n8n templates

About

A curated directory of the best n8n templates for workflow automations.