Dropbox integration

So I must have something bad, because it is not working.

Yes, you are trying to run before you can walk.

Put your Dropbox automation in automations.yaml as advised already, set HA log level to debug, and see what errors you get.

Once everything works, then try to move it out of automations.yaml.

Ok, so as I have been wrote above, 5 hours ago, added to configuration.yaml, editor shows an error

duplicated mapping key at line 74, column -449:
    automation:
    ^

I’ve been checked configuration.yaml in Settings-Server control, this checking has not find any error. Restarted and run Automation. Backup has been created but nothing in Dropbox. Only log from Supervisor-System-System log-Supervisor

20-05-03 14:23:25 INFO (MainThread) [supervisor.api.security] /snapshots access from 7be23ff5_dropbox_sync

I’ve been looking debug log at Ha pages and found only theme named Running AppDaemon and something about Hello world app, Docker and pip3.

duplicated mapping key at line 74, column -449:
    automation:
    ^

You have somewhere twice automation: in configuration.yaml

Add this to configuration.yaml :

logger:
  default: debug

And remove the extra automation:

Yes. First is from default - automations.yaml. Second one is added code, which you want to be added.

In automations.yaml there should be no

automation:

I copied from above, with corrections :

configuration.yaml :


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml


android_ip_webcam:
  - host: 192.168.15.107
    port: 80
    sensors:
      - audio_connections
      - battery_level
      - battery_temp
      - battery_voltage
      - light
      - motion
      - pressure
      - proximity
      - sound
      - video_connections
    switches:
      - exposure_lock
      - ffc
      - focus
      - gps_active
      - night_vision
      - overlay
      - torch
      - whitebalance_lock
      - video_recording
  - host: 192.168.15.107
    port: 8080
    sensors:
      - light
    switches:
      - torch
      
logger:
  default: debug


automations.yaml :

# Dropbox backup automation


  - alias: System - Dropbox
    initial_state: 'on'
    trigger:
      platform: time
      at: '3:00:00'
    action:
      - service: hassio.snapshot_full
        data_template:
          name: Automated Backup {{ now().strftime('%Y-%m-%d') }}
      - delay: '00:05:00'
      - service: hassio.addon_stdin
        data_template:
          addon: "7be23ff5_dropbox_sync"
          input: {"command":"upload"}
          

I have automations.yaml with size 0 bytes now

In which log I should looking for Dropbox errors?

Read above : this should be your automations.yaml :

# Dropbox backup automation


  - alias: System - Dropbox
    initial_state: 'on'
    trigger:
      platform: time
      at: '3:00:00'
    action:
      - service: hassio.snapshot_full
        data_template:
          name: Automated Backup {{ now().strftime('%Y-%m-%d') }}
      - delay: '00:05:00'
      - service: hassio.addon_stdin
        data_template:
          addon: "7be23ff5_dropbox_sync"
          input: {"command":"upload"}
          


1 Like

In the log of the add-on.

Oh, and I just noticed (you still can’t read instructions ), your delay is still 0:05:00:

You want to upload to dropbox before the backup is finished. How do you expect that to work ?

Backup has been created in 30 seconds. I can download file after this period. There no new lines in logs from backup. But I can prolong period, I have no problem with it.

This is from plugin log.

{"command": "upload"}
[Info] Received message with command upload
[Info] Uploading all .tar files in /backup (skipping those already in Dropbox)
Error loading data from /etc/uploader.conf...
It is recommended to run ./dropbox_uploader.sh unlink
[Info] keep_last option is set, cleaning up files...

I’ve been tried to run from ssh, this is result.

~ $ ./dropbox_uploader.sh unlink
-bash: ./dropbox_uploader.sh: No such file or directory

Have you completed the necessary steps for Dropbox and obtained the oauth token? If it’s creating the backup but failing to upload to Dropbox I assume that must be a credential or configuration problem.

When you click on the add-on you should see something like this under the Config tab (has to be changed to your info of course).

oauth_access_token: PASTE_YOUR_VERY_LONG_TOKEN_HERE_AND_HIT_SAVE
output: /HA-Backups/
keep_last: 3

Make sure the first line has your correct credentials and hit save.

Yes, only not sure correct backup path, because application has access only to own path.

Well I think that’s likely the problem you’re facing - you might either have the wrong backup path specified in the addon configuration, wrong oauth token, or the wrong permissions on the Dropbox side. None of us can really help you with those parts.

The Home Assistant side of things appears to be working, the automation made the snapshot and attempted to upload it. But failed due to Dropbox.

If you copied this part from the add-on documentation: "<YOUR_TOKEN>" make sure that you removed the < and > characters from that as well. It should just be your token between quotes.

You could also try uninstalling the add-on and re-installing.

Problem is, to which path is uploader script installed, run it and try unlink Dropbox integration and link it again, because of missing /etc/uploader.conf file.

You do not have to run any SSH commands or deal with uploader script path using this add-on, it’s all done completely through the user interface. I’m pretty sure you just have the wrong values in the add-on configuration.

Can you go here and click your app: https://www.dropbox.com/developers/apps/

Toward the top of the page is a short “App key” that is 15 characters long. Make sure that you’re NOT using that one and that you’re NOT using the “App secret” key either which is also 15 characters. It has to be the generated access token underneath. Your token is supposed to be very long, like 64 characters.

Make sure that is the case. You can also go to “Analytics” tab on the same Dropbox website and check “API calls per day” chart at the bottom… If it says 0 that means you have probably misconfigured the details.

I found tip today morning and I’ve been tested it now. Hass.io Add-on: Upload hassio snapshots to Dropbox
This was the problem. After deleting characters <>, Dropbox backup has been sent. Folder path is always from the starting folder to which has access. So it works now.

Thank you for your help in this.

1 Like