To do this we'll need to add a query and filter code to an existing Applet.
However, the Location service doesn't have a query for your current state in relation to a particular geofence (ie. whether you are inside or outside of it). We can create our own "query" with the Applet below:
Input your home address when connecting this Applet, and it will start logging your current state as either "entered" or "exited" to a Google Sheet. You can then call upon this information later using the Google Sheets - current value of a cell query.
Here's an example of this query in practice...
I've created an Applet to brew me a coffee at 10 am every weekday:
However, I want to skip the Applet if I'm not at home.
First, if I haven't already, I'll enable 'Am I Home?' and set the home location to my house. This will log either "entered" or "exited" to a Google Sheet called 'Am I Home'
I now need to add a query to my coffee-making Applet. I'll configure the query to check for cell A1 and enter the spreadsheet URL for the 'Am I Home?' Google Sheet (The sheet will have been automatically created in your Google Drive under IFTTT/Values).
Finally, we need to add some filter code to skip the action if the cell reads "exited". This will be:
let ingredient = GoogleSheets.cellValue[0].Value;
let searchTerm = 'Exited';
if (ingredient.indexOf(searchTerm) !== -1) {
Smarter.brewCoffee.skip();
}
The final Applet looks like this:
Great! This Applet will now check for the value of the cell stored in my Google Sheet, and either run or skip depending on if i'm home or not!
You can use the 'Am I Home?' Google Sheet and query to make any Applet skip if you aren't home. That's gonna save you a lot of energy (and wasted espresso)!