Blog2013 ≫ Google spreadsheet logging of home automation

Just started using this google drive api1 - with it I can log direct from my lightwaverf ruby gem2 into a google spreadsheet online. I like this, hope I can trust the google with my data. A bit closer to getting rid of my own web hosting. I'll do this for the remote control logging with the 433mhz receiver next too, absolutely no need to be logging it on @ourduino - except to make it visible to workmates...

About to publish a new version of the gem in the meantime, here is a code snippet:

session = [GoogleDrive](/wiki/#google).login self.get_config['spreadsheet']['username'], self.get_config['spreadsheet']['password']
ws = session.spreadsheet_by_key( spreadsheet ).worksheets[0]
rows = ws.num_rows
row = rows + 1
ws[ row, 1 ] = data['timestamp']
ws[ row, 2 ] = data['message']['usage']
ws[ row, 5 ] = data['message']['annotation']['title']
ws[ row, 6 ] = data['message']['annotation']['text']
ws.save( )

Maybe Clare will be more interested in this stuff now it is a spreadsheet. She loves spreadsheets...

⬅️ :: ➡️

Paul Clarke's blog - I live in Hythe near Folkestone. Wed + dad to two, I am a full-stack web engineer, + I do js / Node, some ruby, other languages ect ect. I like pubbing, parkrun, eating, home automation + other diy stuff, history, tree stuff, Television, squirrels, pirates, lego, + TIME TRAVEL.