AutomationOnDrive can be used to log device state changes and errors to your google drive account. Do this under settings by enabling "Drive Logging". AutomationOnDrive will post device changes to a spreadsheet with the same location name that you've assigned for this install.
Google has set a limit on the size of spreadsheets so this log will eventually fill. To avoid this problem, you need to create a script for the log file and trigger it to run periodically. This script will create a copy of the log as a backup and emtpy the current AutomationOnDrive log, preventing any overflow errors.
Unfortunately this function can no longer be performed by the application as google has established new security requirements that prevent the archive function from operating properly.
Setup instructions:
Enable Drive Logging to send your events to google Drive sheets.
Open Google Drive
Find and open your location's log sheet in your google drive.
Select "Extensions>App Scripts". Optionally rename your untitled project.
Select the "+" button under "Libraries". Enter "1bQvIj622HYBR70NZ95WhkOmUzJpmDem_HTjANdbTRB79utN3SnVkHIeR" and click "Look up" to find the AutomationOnDrive library. Select "Add".
Select "Code.gs". Replace the text in the code window with:
function backupNow() {
AutomationOnDrive.backupNow(SpreadsheetApp.getActive().getName());
}
and save.
You can use the "run" button to test the script, an archive should be created for you.
Touch the clock (Triggers). Select "Add Trigger" from the bottom right.
Select "backupNow" as the function, use "Head" for deployment. Use the event source "Time-driven", "Day timer", "Midnight to 1am". You're free to pick any appropriate time if you prefer, weekly or monthly work just as well depending on how many events are logged. Select an appropriate notification period.
Accept the permissions needed to create the archive files (select "advanced" if necessary)
You're done, you can dismiss the reminder in the AutomationOnDrive app.
You can delete your location file and your log file at any time, AutomationOnDrive will recreate them as needed. However if you delete your log file you will need to recreate and re-enable the archive trigger.
If you change the name of your location you will need to recreate the trigger and re-register any AM Remote OnDrive connections.
You can move your location and log files into drive folders; the log archives will be created in that same folder.