Logging values to Google docs

Would it be possible to log values to a Google Docs spreadsheet? That would create a nice alternative for the slow out of the box graphing functionality inside Homeassistant. Simply every xx minutes write the value of a sensor and a timestamp to a Google spreadsheet.
I was actually a bit surprised that this functionality wasn’t available yet.

Just use the IFTTT component. easy peasy.

Home Assistant -> maker channel -> google sheets.

What about the other way around. A way to read from Google Sheets?

I don’t know about reading values into HA, but I’ve set up my home assistant to display a graph from google sheets on the states panel, using the camera component and a published graph. It automatically updates and everything!

camera:
  - platform: generic
    still_image_url: https://docs.google.com/spreadsheets/d/1-sUu4kkJKrAodU_8x2IaiOceCD9Uc8a7jdIDwjf8Uho/pubchart?oid=1527554062&format=image
    name: "Some name for your sheet"
4 Likes

Sheets has an APi so you can just POST values straight into a sheet from HA using https://home-assistant.io/components/rest_command/

See https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append

@Jer78 , I wrote a post doing that (and then displaying the data with matplotlib). But I’m not an expert in coding, APIs, software, and related things; so maybe it is not the simplest/safest solution to set up.

Cool. Thanks I’ll check it out

Just come across the gspread package https://github.com/burnash/gspread which is a python wrapper for the google docs API and would make adding a google spreadsheets component a lot less work…?

1 Like