See first:
You can combine queries with filter code to create extra "if" conditions, allowing you to be specific about when exactly you want your Applet to run. Here are some examples.
Sometimes you'll want to create conditions using data that can't be accessed via queries. We can create out own "query" for this information using a seperate Applet and Google Sheets.
Assuming the data you're seeking can be accessed via a trigger, you can send it to a Google Sheet via the update a cell in a spreadsheet action, and then use the current value of a cell query to access it within any other Applet.
For example...
The location service doesn't have a query for whether you are home or not.
We can create our own "query" for this information so that any Applet can use it in filter code. We just have to create a seperate Applet using the you enter or exit an area trigger and combine it with the update a cell in a spreadsheet action. Then, any other Applet can essentially query "am I home?" by checking the value of that cell. You can then use the check for a keyword function in filter code to instruct the Applet on whether or not to run based on what value is returned.
For a full breakdown of this example, see: How to skip and Applet if you are not home.
What to do
1. Determine whether the information you want to access is reachable via IFTTT triggers.
For example, I can learn whether my lights are currently on or off via EcoBee's triggers: light switch is turned on and light switch is turned off, but I can't learn what color the lights are.
Start by picking the trigger you want to use.
2. Create a folder in your Google Drive called IFTTT values
You can leave it empty for now.
3. Create an Applet using the trigger you've identified, and add the Google Sheets - update a cell in a spreadsheet action. Configure the action as follows:
Replace {NameTheData} with whatever you want the spreadsheet to be called. Also replace {IngredientFromTrigger} with one of the ingredients from the trigger.
In my example using EcoBee's "lights on/off" triggers, I would name the Spreadsheet "Are my lights on?" and then use the {{State}} ingredient, which will update the cell to "On" when the lights are turned on.
4. Finish creating the Applet.
Once the Applet is enabled, wait for the trigger behaviour to occur, and then a Spreadsheet will automatically be created with the information you want to access.
Inside the spreadsheet, cell A1 will have been updated.
Using the query
You can now use your DIY query just like any other query. Just use the Google sheets current value of a cell query, and configure it as follows... (Replace {URL} with the URL of the spreadsheet with the information you want to access)
Now, you can either user filter code to create filters based on the value returned...
Or, you can use that value in the action.
Further examples...
Here is what it may look like if you have multiple value-stores going at once:
Alternatively, you could include all the value-stores in a single spreadsheet:
Note: This method would require your to define the specific cell to update in your first Applet, and then match that when defining which cell to check the current value of.
Summary
By maintaining value-stores using Google Sheets, you can unlock the ability to fine tune your Applets, requesting and utilising information you normally wouldn't be able to access.