Photon --> Google Spreadsheet (with deep sleep mode)

I am working on a project that logs sensor data on a website (I am using Google Spreadsheet). It also has to be able to run for months with only power from three AA batteries, which means the system has to be in deep sleep most of the time. I have tried several method but still couldn’t get what I want. I have looked at IFTTT logging sensor data, but it only allows me to log one variable. I also tried writing a Google Script to grab data from the cloud while having IFTTT to track whenever Photon is on add a row to the Google Spreadsheet. From there I add a onedit trigger to the Google function I written for grabbing the data. I was hoping that it will be triggered whenever IFTTT add a row to the spreadsheet…but for some reason it didn’t work. I am now considering using the webhooks… but I am pretty new to this and don’t know where to start with… Please help!

You try using IFTTT to catch a publish event (instead of variable)? You could then have a script/formula on the Google Sheet side that splits out the data in that event message into your individual data points.

1 Like

Thanks! That’s an interesting thought. I don’t quite understand what will my event be like… cause in IFTTT, the statement is “if (event name) is (event contents)”… does the event contents have to be matched with the trigger statement to run? But there will be variables from my sensor that will change from time to time…

There is also another problem with monitoring variables on IFTTT. IFTTT just run constantly every minute ignoring the trigger… like I set the trigger to be greater than 70 but it still runs when it is 40… why is that happening?

I also don’t know how to trigger the Google sheet to split out the data. onedit trigger (append row from IFTTT) just doesn’t work for me.

Just leave the (event contents) blank to capture everything. As for parsing, you can create a Script on that google sheet (Tools > Script editor) and setup some triggers within that window (Resources > Current Project Triggers). An example of how to setup the script and do some simple manipulation can be found here: Example: Logging and graphing data from your Spark Core using Google

If I understand correctly you answered my question ( partially.

If I leave the is(Event Content) window blank, than whatever string will be parsed there, will get posted in a new row in google sheets, yes?

If (yoursuggestion = true) than I only need some tutorial for a script on google sheets to parse whatever is not parsed in this particular sheet and run this once every hour, am I right? What happens when the file get’s full (2000 rows only for the IFTTT)? From what i understand IFTTT creates a new file, and this new file will not have the parseing script included, am i right?