Home Assistant Community

Created new add-on to backup snapshots to Google Drive

hassio-addon
Tags: #<Tag:0x00007fcf4b047168>
#82

Wow, it’s working great. Only one issue happens to me. Whenever I restart Home Assistant, I receive always the last MQTT event from googlebackup/result. I have an automation with that event, and it always launches when I restart Home Assistant.

Here is the log, just restarted without invoking rest_command.googlebackup:

2019-02-19 11:24:13 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to googlebackup/result
2019-02-19 11:24:13 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on googlebackup/result: b'{"backupTimestamp": "2019-02-19T10:20:46.157264", "fromPattern": "/backup/*.tar", "backupDirID": "xxxxxxxxxxxxxxxxxxxx", "fileCount": 7, "alreadyCount": 7, "backedUpCount": 0, "deletedCount": 0, "deletedFromGoogle": 0}'
2019-02-19 11:24:13 WARNING (ThreadPoolExecutor-1_0) [pycec] Not initialized. Waiting for init.

Do you think that is caused by the addon?

Regards

#83

Hah! The last event is there on startup because I intentionally set it to “retain = True”. I had “retain = False” at first, but I noticed the most recent backup would not appear unless it had happened since the last restart. I thought “oh, people won’t like that”, so I changed it to “retain = True”. So, I guess I’m not a good predictor of what people want.

Plus, I did a little more reading this morning (after seeing your reaction), and I’ve learned that “retain” is really more appropriate for something like a temperature sensor, or a door sensor that reports the current state of something. I’ll change retain to False in an update just as soon as I get some time.

#84

Totally in agreement with this thought. Thank you @samccauley :grinning:

#85

This has been amazingly helpful. Thank you! backups working perfectly. :slight_smile:

#86

Hi

I recently installed this addon but i cant reach the web ui (set on port 8055) !

the error i get is connection refused, even if i change the port or change the link from myDomain.duckdns.org/gb to 192.16X.XXX.XXX:[port]/gb

and the error i get if i start the automation is the same exposed from @sermayoral in the 71 post

any guess?

thanks

#87

Use 192.16X.XXX.XXX:[port]/gb or hassio.local:[port]/gb from your web browser to access the UI for setting up authorization with Google Drive.
Use 192.16X.XXX.XXX:[port]/gb/doBackup to perform a backup manually from your web browser.
Use localhost:[port]/gb/doBackup in your rest_command setup to facilitate backup automations.

The web UI will not be accessible from outside your network unless you’ve configured port forwarding for that specific port on your router.

Double check your IP address by trying this from a command line:
ping 192.16X.XXX.XXX

Try stopping and restarting the add-on.

Below is my configuration for the rest_command and automation. Notice the timeout value of ‘300’ given as a string in single quotes, not as an integer without any quotes.

I have my automation setup like this:

- id: '1541263656718'
  alias: Run Google Backup
  trigger:
  - at: 02:00:00
    platform: time
  condition:
  - condition: time
    weekday:
    - mon
    - wed
    - fri
  action:
  - service: rest_command.google_backup

The automation uses a REST command that I setup like this:

rest_command:
  google_backup:
    url: 'http://localhost:8055/gb/doBackup'
    timeout: '300'
#89

thanks for the reply @samccauley !!

this are the steps i made:

  • accessed the front end trough the ip 192.168.X.XXX:8123

  • open the tab Hassio

  • open the “Backup Hassio to Google Drive” addon

  • start the addon

  • click the web ui button that automatically open a web page --> http://192.168.X.XXX:8055/gb

same error --> ERR_CONNECTION_REFUSED

iìve tried to modify the ip with the https:// form but nothing…

i’ve noticed this in the log section:
GB_DEBUG = false
Segmentation fault (core dumped)

i still dont get what the hell i made wrong… it’s basically a mini web server on the 8055 port but i cant access it !!!

#90

Can you show me what the configuration you have on the add-on looks like, please?

#91

sure:

#92

Oh! I just saw the segmentation fault. Sorry, I missed that earlier. You’re probably running 64 bit version of hassos. There seems to be an issue with the Python 3 and Alpine 3.9 on 64 bit architectures. The issue doesn’t present on 32 bit systems. I’ll have to create an alternative build for people running on 64 bit. I’m not sure how soon I’ll be able to do that, but I hope to do it soon.

Hass.io Add-on: Xbox One
#93

yup, 64bit version! sorry… i didn’t mention that

sooooo i’m not that dumb :joy:

i’ll wait the 64 version!!!

#94

Please give version 1.5.2 of my add-on a try on 64 bit hassos. I believe I may have the segmentation fault problem taken care of.

2 Likes
#95

I was able to install and authorize access on my 64 bit hassos. Thanks!

1 Like
#96

Perfect, it works!

Good job :wink:

1 Like
#97

great add-on! Just installed and all is working perfectly!

1 Like
#98

Thank you.

#99

I just used the google backup in an automation and it worked great. Nice addition to Home Assistant.

1 Like
#100

Hi
I have installed the addon and it seems to work but.

The TAR files don´t end up in the right folder in my google Drive. And the names are stranged.

I have one automation that makes a backup and names the files automated backup date.

But then when the files they get names like 2588bc.tar

How to fix these problems?

Regards

#101

The tar name is standard for snapshots… not much can be done about that.

#102

Thanks but i mean the file names. Not the format.