Pushing data from the photon into google sheets

I gave up on IFTTT. I was bored with what it could do in about 5 minutes. The method described in the tutorial by GusGonnet is far better, and worth the effort. I use it A LOT.

Follow his tutorial carefully. Follow every link because there are additional instructions there. Read the comments too, The trials of others will make you stronger.
You will need to make these things, and pretty much in this order.

  1. A Google Sheet with labels at the top of each column where your data will go.
  2. A Google Java script which controls the behavior of the Sheet. The tutorial links to a page which shows how to do this. The script will be deployed as a web app which gets hit by your webhook.
  3. Particle firmware which publishes JSON strings like this:
    {
    variable name : value
    other variable: value2
    }
  4. A webhook which hits your Google Web App, is web form type, with query parameters like this:
    {
    GoogleSheetLabel1: {{variable name}}
    GoogleSheetLabel2: {{other variable}}
    }

Then value, and value2 are written to the Google Sheet in a POST.
This is what a publish string from my power monitor looks like:

{"data":"{"Date":"20180116", "Time":"14:50", "Volts":"238.70", "Amps":"2.17", "Watts":"516.21", "WattHrs":"8494.18"}","ttl":60,"published_at":"2018-01-16T22:49:58.634Z","coreid":"52003aBLAH373132","name":"QHour"}

1 Like