All Projects → danielwelch → hassio-dropbox-sync

danielwelch / hassio-dropbox-sync

Licence: Apache-2.0 license
Back up your Hass.io snapshots and other local files to Dropbox

Programming Languages

shell
77523 projects
python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to hassio-dropbox-sync

addon-shinobi
Shinobi Pro - Community Hass.io Add-on for Home Assistant
Stars: ✭ 22 (-77.78%)
Mutual labels:  home-assistant, hassio-addons
Awesome Home Assistant
A curated list of amazingly awesome Home Assistant resources.
Stars: ✭ 3,487 (+3422.22%)
Mutual labels:  home-assistant, hassio-addons
home-assistant-addons
Alex's Home Assistant Add-ons
Stars: ✭ 28 (-71.72%)
Mutual labels:  home-assistant, hassio-addons
tesla
Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Stars: ✭ 145 (+46.46%)
Mutual labels:  home-assistant
visonic
Visonic Custom Component for integration with Home Assistant
Stars: ✭ 57 (-42.42%)
Mutual labels:  home-assistant
ha-card-weather-conditions
Weather condition card (Lovelace) for Home Assistant.
Stars: ✭ 101 (+2.02%)
Mutual labels:  home-assistant
smart-home
🏡 My smart home setup built on top of Home Assistant
Stars: ✭ 140 (+41.41%)
Mutual labels:  home-assistant
sensor.avanza stock
Custom component to get stock data from Avanza for Home Assistant
Stars: ✭ 30 (-69.7%)
Mutual labels:  home-assistant
OTGW-firmware
A ESP8266 devkit firmware for the Nodoshop version of the Opentherm Gateway (OTGW)
Stars: ✭ 88 (-11.11%)
Mutual labels:  home-assistant
hass-hue-icons
Additional vector icons for home assistant to model Philips Hue bulbs and fixtures.
Stars: ✭ 161 (+62.63%)
Mutual labels:  home-assistant
eufy security
Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
Stars: ✭ 242 (+144.44%)
Mutual labels:  home-assistant
PandaNote
iOS markdown Note App / iOS的markdown笔记应用
Stars: ✭ 32 (-67.68%)
Mutual labels:  dropbox
home-assistant-extension
📌 Home Assistant browser extension
Stars: ✭ 143 (+44.44%)
Mutual labels:  home-assistant
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (-69.7%)
Mutual labels:  home-assistant
ynab
YNAB component for Home Assistant
Stars: ✭ 26 (-73.74%)
Mutual labels:  home-assistant
netdisco
🔎 Python library to scan local network for services and devices.
Stars: ✭ 252 (+154.55%)
Mutual labels:  home-assistant
rtlamr2mqtt
Docker container to send rtlamr readings to a mqtt broker
Stars: ✭ 86 (-13.13%)
Mutual labels:  home-assistant
ESP32-R4sGate-for-Redmond
ESP32 Ready4Sky (R4S) Gateway for Redmond+ devices
Stars: ✭ 117 (+18.18%)
Mutual labels:  home-assistant
Calendarific
Calendarific holiday sensor for Home Assistant
Stars: ✭ 14 (-85.86%)
Mutual labels:  home-assistant
home-assistant-homeseer-helpers
Various scripts, customizations, and documentation for working with HomeSeer products in Home Assistant
Stars: ✭ 18 (-81.82%)
Mutual labels:  home-assistant

Hass.io Add-on: Dropbox Sync

Back up your Hass.io snapshots to Dropbox.

About

This add-on allows you to upload your Hass.io snapshots to your Dropbox, keeping your snapshots safe and available in case of hardware failure. Uploads are triggered via a service call, making it easy to automate periodic backups or trigger uploads to Dropbox via script as you would with any other Home Assistant service.

This add-on uses the Dropbox-Uploader bash script to upload files to Dropbox. It requires that you generate an access token via the Dropbox Web UI, which must be added to this add-on's configuration via the Hass.io UI (see below for further details).

Installation

  1. Add the add-ons repository to your Hass.io instance: https://github.com/danielwelch/hassio-addons
  2. Install the Dropbox Sync add-on
  3. Configure the add-on with your Dropbox OAuth Token and desired output directory (see configuration below)

Usage

Dropbox Sync uploads all snapshot files (specifically, all .tar files) in the Hass.io /backup directory to a specified path in your Dropbox. This target path is specified via the output option. Once the add-on is started, it is listening for service calls.

After the add-on is configured and started, trigger an upload by calling the hassio.addon_stdin service with the following service data:

{"addon":"7be23ff5_dropbox_sync","input":{"command":"upload"}}

This triggers the dropbox_uploader.sh script with the provided access token. You can use Home Assistant automations or scripts to run uploads at certain time intervals, under certain conditions, etc.

Dropbox Sync will only upload new snapshots to the specified path, and will skip snapshots already in the target Dropbox path.

The keep last option allows the add-on to clean up the local backup directory, deleting the local copies of the snapshots after they have been uploaded to Dropbox. If keep_last is set to some integer x, only the latest x snapshots will be stored locally; all other (older) snapshots will be deleted from local storage. All snapshots are always uploaded to Dropbox, regardless of this option.

The filetypes option allows the add-on to upload arbitrary filetypes from the Hass.io /share directory to Dropbox. Set this option to a string of extensions seperated by | to upload matching files to Dropbox. For example, setting this option to "jpg|png" will upload all files in the /share folder ending in .jpg or .png. These files will be uploaded to the directory specified by the output option.

Note: The hash 7be23ff5 that is prepended to the dropbox_sync add-on slug above is required. See below for an explanation.

Configuration

To access your personal Dropobox, this add-on (and the Dropbox-Uploader script more generally) requires an access token. Follow these steps to create an Access Token:

  1. Go to https://www.dropbox.com/developers/apps
  2. Click the "Create App" button
  3. Follow the prompts to set permissions and choose a unique name for your "app" token.

Once you have created the token, copy it into this add-on's configuration under the oauth_access_token label.

Parameter Required Description
oauth_access_token Yes The "app" access token you generated above via the Dropbox UI.
output Yes The target directory in your Dropbox to which you want to upload. If left empty, defaults to /, which represents the top level of directory of your Dropbox.
keep_last No If set, the number of snapshots to keep locally. If there are more than this number of snapshots stored locally, the older snapshots will be deleted from local storage after being uploaded to Dropbox. If not set, no snapshots are deleted from local storage.
filetypes No File extensions of files to upload from /share directory, seperated by | (ex: `"jpg

Example Configuration:

{
  "oauth_access_token": "<YOUR_TOKEN>",
  "output": "/hasssio-backups/"
}

Suggestions and Issues

If you have suggestions or use-cases not covered by this add-on, please leave a comment on the forum topic. Otherwise, you may file an issue here. The flexibility of the service call and JSON service data means that this add-on could be expanded to include new features or options relatively easily.


Repository slugs in Hassio

Hass.io add-on service calls such as start, stop, and stdin require an add-on identifier in the form {REPO_HASH}_{ADDON_SLUG}. The repository identifier is generated by hashing the full URL of an installed repository. For example, the slug necessary to use this add-on at all is generated in Hass.io via the following code:

import hashlib

key = "https://github.com/danielwelch/hassio-addons"
my_repo_id = hashlib.sha1(key.lower().encode()).hexdigest()[:8]

I'd like to at least improve the documentation surrounding this on homeassistant.io; ideally, I think the hash for each installed repository should be displayed in the service description for services that rely on it. This would make it easy for users to compose service calls from within Home Assisant.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].