We’re following up last month’s roundup on cloud storage services with a look at how the IFTTT automation service can be used to tie cloud storage into your automation routines. Earlier this week we posted an overview of which providers work with IFTTT and how they can be used, and in today’s article we’ll take a look at some practical examples of the sort of things you can do.

Sadly, as we discovered in part 1, not all cloud services are equal in terms of what they offer to IFTTT — if you’re a user of Amazon Cloud Drive or Microsoft OneDrive, for example, you’ll find there’s not much you can do with these services for home automation purposes. Fortunately, though, the two more versatile storage options — Dropbox and Google Drive — both offer free plans, with 2 GB and 15 GB of storage respectively, which should be more than enough to log data from your home accessories or even store things like photos or videos.

Logging Data to Dropbox and Google Drive

We’ve talked about logging home automation data in Google Drive and in Dropbox before, and these are really the only two major cloud services where you can do this. In Dropbox, you can simply have IFTTT write data to a plain text file, whereas with Google Drive, you’ll instead need to use the Google Sheets or Google Docs IFTTT services to place the data in a Google document inside your Google Drive. For instance, you can log motion data from a Wemo motion sensor with a fairly simple applet that writes to a Google Sheet or Google Docs file.

Both the Google Docs and Google Sheets services allow you to use ingredients not only for the content to go into the file, but also for the filename and folder name. You can use the name of the motion sensor or other home automation device to name your files, or you can simply enter static names if you want to log data from multiple devices in a single sheet or doc.

What about Amazon Cloud Drive and Microsoft OneDrive?

As we noted earlier, both Amazon and Microsoft’s IFTTT services are considerably more limited — they only allow you to create a new file from a URL. However, if you really want to keep your data in one of these services, you can actually work around it by writing the file to Dropbox first, and then creating another IFTTT applet that copies that file from Dropbox to your preferred storage service.

The first applet will tell IFTTT to append to a file in Dropbox — creating it if necessary — in a specific folder. In this case, we’re using a static name with the “.txt” extension — although if you have multiple motion sensors and want to create separate logs for each, you could use an ingredient for the name instead.

We then create a second applet that takes advantage of the fact that Dropbox’s IFTTT service also has a trigger that can be used to fire off an applet whenever a file is changed in a specific folder. Don’t let the description fool you here either — this will work for file changes from IFTTT, so the second applet will fire off each time the log file is updated. In this case we’re using the New text file… trigger just to ensure that we only grab text files, but you could just as easily use Dropbox’s Any file trigger if you’re only putting text files in the logging folder anyway.

Since Dropbox provides a free plan, this doesn’t cost you anything extra to set up. However, since Dropbox is only being used in the background to move data between IFTTT applets, you don’t need to install the actual Dropbox client on any of your devices, and probably won’t even need to visit the web interface once everything is working the way you want it to.

It’s also worth noting that you’ll need to use Dropbox to do this, rather than Google Drive. Even though Google offers a free plan, you can only log data to Google’s own document formats (Docs and Sheets), which don’t translate well to other cloud storage services. That said, we normally recommend Dropbox for these kinds of “middleware” solutions anyway, as it’s a much more straightforward cloud storage service.

Going the other way

Although cloud storage services are most useful for storing data from your home automation devices, it’s actually possible to go the other way and use data from Dropbox or Google Drive to trigger home automation routines. At its most basic level, much like the example shown above for connecting to OneDrive, you can have something fire off simply when a new file appears in a Dropbox folder, but we suspect that’s probably more of an edge case for most users as there’s no way to perform actions based on what’s in those files, but only on the basis that a file exists at all.

However, Google Sheets offers some more interesting possibilities, since it provides an IFTTT trigger that can actually look for a new row in a spreadsheet, or a change to a specific cell. So, for example, you could create an applet to adjust your thermostat temperature based on new rows appearing in a spreadsheet or a specific cell being updated.

While on the surface this seems like a lot of effort just to change the temperature, it can become a pretty powerful solution when integrated with other IFTTT applets or other Google Sheets compatible services. For example, you might create a Google Sheet that gets updated by another service with data from several temperature sensors in your home and calculates an average temperature, which could then be used — either directly or in another calculation — to set the temperature that you want. That could then be read by IFTTT to actually send the adjustment to your Nest thermostat — and as the example above shows, you can even set a temperature range using the data from two cells. It’s an advanced solution that’s not for everyone, but it’s a great demonstration of the kind of power that IFTTT brings to the table.

Comments