HOW-TO: Import Hub/Device Data Into Google Spreadsheet

Before I embark on writing up this process, I'd like to know if any audience members are excited (or even interested) by the prospect of pulling information from your Hubitat C7 directly into Google Sheets, using a simple, automated process.

I'm hoping to craft this tutorial in the same vein as my well-received HOW-TO Store data in Google Sheets directly from RM5 – let's call that the "push" method – only this time using function calls from within the Spreadsheet itself (the "pull" method).

7 Likes

I would be highly interessted. Please tell me more. :smile:

1 Like

I'm fairly excited by this. Sounds ace!

1 Like

THIS POST WILL EVOLVE IN "CHAPTERS" SINCE IT IS A LEARN-AND-SHARE PROJECT

THEORY

  • Hubitat can publish information about its Devices through the Maker API.
  • The information is shared via private (hub-specific) URLs in JSON format.
  • Google Sheets has the ability to import and parse data from a given URL.
  • It is possible to refresh the imported data on a prescribed time schedule.
  • A custom Apps Script can be employed to format JSON data into a table.
  • Users can make appropriate selection(s) from that table to build reports.
  • Advanced users can easily log, chart, graph, export or send notifications.

Just to mention, there are two apps that exist to do this. Both were developed on SmartThings and ported over to HE.

Chuck Schwer's Google Docs Logger

@krlaframboise's Simple Event Logger
Original ST thread: [OBSOLETE] Simple Event Logger - Community Created SmartApps - SmartThings Community
Hubitat version with installation instructions: krlaframboise-Hubitat/apps/krlaframboise/simple-event-logger.src at simple-event · loverso-hubitat/krlaframboise-Hubitat · GitHub

3 Likes

Well, that's refreshing (and I dare say not at all surprising) to hear! I'd like to assume -- without actually installing and testing that user app myself -- that it exposes all of a given (or multiple) device's attributes, so they can be hand picked cell-by-cell for use in formulae, reports, etc. If so, that's essentially the same road I was heading down (albeit with nothing needed to be installed on the HE side, since I was aiming for a "pull" solution vs the "push" method this app surely employs).

Hi @LibraSun.

I've been using your push method at HOW-TO Store data in Google Sheets directly from RM5, as well as @krlaframboise's app.

Did you ever get the "pull" method working from google sheets?

Yes and no (thanks for asking).

The weak link in the process turns out to be Rule Machine 5.1, who's basic action GET HTTP refuses to populate a variable (for me), despite extensive testing. To date, nobody has been able to show me a working example, so I cannot incorporate it into my planned tutorial about extracting values from Google spreadsheets.

So I gave up trying after a while.

1 Like

Bummer. Thanks for the update.

I wonder if that’s the right term?

Inquiry is rarely, if ever, dissuaded here. It’s not like this online forum dedicated to home automation is the CIA, or the Nixon administration or something.

4 Likes

webcore route ?

Finally published the sequel to this thread
here, for pulling data out of Sheets into RM. Expect me to revise and add screenshots once able.

Enjoy!

Sorry to ressurect an old thread @jlv but I'm looking for help with @krlaframboise Simple event Logger deployment, I've followed the instructions (which are somewhat out of date now when it comes to options in G.Sheets etc) and think I got everything setup ok, but alas the spreadsheet does not populate when the app runs and seemingly that's to do with an authorisation issue. The log error states:

Unexpected error from Google Sheets Web App: Forbidden

...I'm assuming that maybe it's to do with the web app url and authorisation to view it - I have currently set the G.Sheets deployment to run as 'me' and be accessible by 'anyone' but when I test the web app url I get a 'you need access' message, so maybe the same thing is happening when Hubitat is running the app?

I'm also not sure whether i need to do anything more with the Oath element, I don't really understand it but the app told me a token had been generated so assume it is ok and I've done all I need to do there?

Anyway, any suggestions on how to resolve would be appreciated. Thank you in advance.