Dropbox integration

Glad you got it working! :slight_smile: Just two small tips:

  1. The five minute delay you have been using for testing purposes should be increased to something longer, like 20-30 min just to be safe. Backups are happening quickly for you right now, but as your database grows in size the backups could take longer. And you don’t want to upload an incomplete backup to Dropbox.

  2. When you use the keep_last feature of this add-on, it deletes the older backups locally from your Pi 4’s SD card, but it will NOT delete them from your Dropbox account. The Dropbox folder will have every backup you’ve made and it will be up to you to delete those manually. So just keep that in mind otherwise you could run out of space on your Dropbox.

1 Like

Hi folks

I have done all the steps and used the suggested automation. However, I get the following error

Anyone experiencing the same?

Uploading “/backup/0a8c0278.tar” to “/HomeAssistantBackup/0a8c0278.tar”… FAILED
An error occurred requesting /upload
Uploading “/backup/339f1aa2.tar” to “/HomeAssistantBackup/339f1aa2.tar”… FAILED
An error occurred requesting /upload
Uploading “/backup/5df09d74.tar” to “/HomeAssistantBackup/5df09d74.tar”… FAILED
An error occurred requesting /upload
Uploading “/backup/8ab1d59e.tar” to “/HomeAssistantBackup/8ab1d59e.tar”… FAILED
An error occurred requesting /upload
Uploading “/backup/e03872e0.tar” to “/HomeAssistantBackup/e03872e0.tar”… FAILED

I have the same issue and cant get it to work :frowning:

But from what I can find, this addon is discontinued so, that’s to bad :frowning:

Would REALLY like to backup to Dropbox…

Maybe it’s because of the Dropbox API?
I can only select this one

I recently installed this add-on to my home assistant instance and it is working as expected. Some things to note:

  • It makes sense to use the Scoped App (App Folder) permission level. Using this scope means setting the add-on’s output setting to / writes backups to app/[App-folder-name].
  • In the Oauth 2 section of https://www.dropbox.com/developers/apps be sure to generate an access token to use with Access token expiration set to no expiration vs the default of Short-lived which is only 4 hours long. When the access token is expired, you will see failures similar to FAILED An error occurred requesting /upload

Hope this helps someone!

Thank you for sharing this automation. Automations are the next thing I need to figure out how to write from scratch. Really appreciate this.

Do you have any idea why I’m not getting the following error in Supervisor?

21-12-31 10:27:19 ERROR (SyncWorker_7) [supervisor.docker.interface] Container addon_core_zwave_js is not running

I really do not understand what addon_core_zwave_js has to do with anything, but it started after this Dropbox add-on was installed. Any ideas?

@diffhome Also, thanks for the clarification on the folders. I initially put the Dropbox folder name in the add-on folder field, but it makes sense that it should be / since there are only permissions for that specific folder designated on the Dropbox app creation page.

@SeanM Maybe you have an idea?

This Add-on is no longer working for me due to it not supporting the use of short lived tokens that Dropbox moved to.

I’ve developed my own Add-on to replace it:

1 Like

I just installed the Dropbox backup addon by diffhome posted above. Can confirm it works. Thank you!

1 Like

Hi,
I have now added “matthewhadley” addon to backup to Dropbox.
If I do service call for both the Snapshot and the Dropbox transfer it works.
Snapshot service call:

service: hassio.backup
data_template:
  name: Ha_Backup_{{ now().strftime('%Y-%m-%d') }}

Dropbox backup service call:

service: hassio.addon_stdin
data:
  addon: 719b45ef_dropback
  input: sync

But I can’t get it to work from my “automation.yaml” file
What I’m doing wrong?

#Automated backups, snapshots every wednesday night to Dropbox
- alias: System - Weekly Dropbox Backups
  intital_state: "on"
  trigger:
    platform: time
    at: "03:00:00"
    condition:
      condition: time
      weekday:
        - wed
    action:
      - service: hassio.backup_full
        data_template:
          name: Ha_Backup_{{ now().strftime('%Y-%m-%d') }}
      - delay: "00:30:00"
      - service: hassio.addon_stdin
        data:
          addon: "719b45ef_dropback"
          input: "sync"

On the face of it, this looks like an indentation error - condition and action should be at the same indentation level as trigger:

#Automated backups, snapshots every wednesday night to Dropbox
- alias: System - Weekly Dropbox Backups
  intital_state: "on"
  trigger:
    platform: time
    at: "03:00:00"
  condition:
    condition: time
    weekday:
      - wed
  action:
    - service: hassio.backup_full
      data_template:
        name: Ha_Backup_{{ now().strftime('%Y-%m-%d') }}
    - delay: "00:30:00"
    - service: hassio.addon_stdin
      data:
        addon: "719b45ef_dropback"
        input: "sync"

Otherwise, your code looks identical to what I use successfully.

Yes, I discover also that the indentations were wrong. But it still not working :thinking:

By ‘not working’ , do you mean the automation is not running at all? Or that it is running, but the services are not being called? What does the automation trace say? (Settings > Automations & Scenes > click on the 3 dots next to the automation name > Traces)

EDIT: just noticed that initial_state is misspelled as ‘intital_state’

The automation is not running at all.
And this automation is not in the list, Settings > Automations & Scenes
Could it has something to do with the misspelling?
I will correct the spelling and try

This is my currently code:

- alias: "System - Weekly Dropbox Backups"
  initial_state: True
  trigger:
    platform: time
    at: "03:00:00"
  condition:
    condition: time
    weekday:
      - wed
  action:
    - service: hassio.backup_full
      data_template:
        name: Ha_Backup_{{ now().strftime('%Y-%m-%d') }}
    - delay: "00:30:00"
    - service: hassio.addon_stdin
      data:
        addon: "719b45ef_dropback"
        input: "sync"

Sorry if these questions are a bit basic, but I’m rather out of ideas:

Is it passing the configuration check?

Developer Tools > YAML tab > Check
Configuration

Once you’ve finished editing the YAML, are you reloading automations (same page) or even restarting HA?

This is the automation I use to run backups and sync to Dropbox. It was made through the UI, but here is the YAML:

alias: System Backup To Dropbox
description: ""
trigger:
  - platform: time
    at: "03:00:00"
action:
  - service: hassio.backup_full
    data:
      name: "{{ now().strftime('%Y-%m-%d') }}"
  - delay: "00:30:00"
  - service: hassio.addon_stdin
    data:
      addon: 719b45ef_dropback
      input: sync
mode: single

At 3am every day, it initiates a backup and sets a 30min delay (for the backup to complete) and then calls the Dropback sync.

Maybe you could use the automations UI to help debug what’s happening.

I don’t really know what’s were wrong but now it’s working :grinning:
Maybe the misspelling?
Thank’s a lot for the help

Hey There,

maybe someone can help:
I´m struggeling now for hours:
There might seem a problem with the token but i can´t figure out what the issue is.
i follow the documentation
get the get the one-use code…

protocoll:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[2024-01-04 21:02:37] INFO: Dropback 7.3.1
[2024-01-04 21:02:37] INFO: Initializing Dropback
[2024-01-04 21:02:37] INFO: No config file found, requesting long lived Refresh Token…
[2024-01-04 21:02:37] FATAL: Error getting Refresh Token
[2024-01-04 21:02:37] FATAL: invalid_grant code has already been used
[2024-01-04 21:02:37] FATAL: Please check App Key and App Secret configuration values and generate a new Access Token
[2024-01-04 21:02:37] FATAL: A new Access Token can be generated at:

s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

i got the App Key, App Secrret and Access Code.
what did i do wrong with the token?

the add on stopt right away

… thx in advance

This response suggests that the access code has already been used somehow, so it’s rejected.

It sounds like you’ve been careful to check the values, but you can try again to get a new access code with this URL (replace your app key value):

https://www.dropbox.com/oauth2/authorize?client_id=YOUR_APP_KEY_HERE&token_access_type=offline&response_type=code

Then re-start the add-on.

If that still fails, you can try the step above to get a new access token and then manually run this curl command and see if there’s any additional information in the response that’s helpful (replace the $values as appropriate):


curl https://api.dropbox.com/oauth2/token -d grant_type=authorization_code -u "$OAUTH_APP_KEY:$OAUTH_APP_SECRET" -d code="$OAUTH_ACCESS_CODE"