If This Then That is a great internet service that simplifies home automation. IFTTT can listen to services like GMail, Dropbox, Twitter, etc. and take actions like controlling lights in your home or even sending data to Adafruit IO. Using IFTTT you can trigger your toilet light to change color in many interesting ways. For example you can have IFTTT change the color of your toilet light based on the current weather in your area.
To setup IFTTT to show weather on the toilet light you'll first need to sign up for an IFTTT account. Then create a new recipe:
Click 'this' to pick what action will trigger the toilet light. Search for weather and you'll see IFTTT's native weather trigger channel (the blue cloud and yellow sun on the right):
Click the weather trigger channel to select it and see the available triggers. Note that you might need to first add the weather trigger channel and configure it to your location before you can continue.
For this example you want the Current condition changes to trigger which will fire when the weather in your area changes to rain, snow, clouds, or clear conditions. However read the other triggers to see what other weather actions you might use with the toilet light.
After selecting the Current condition changes to trigger you can now pick the specific condition that this trigger will action on. For example to change the light when it's raining pick the Rain condition in the Current condition drop down:
Now click Create Trigger to continue on to the 'that' configuration for this recipe:
Click 'that' and you'll see the available action channels. Search for or select the Adafruit channel. Note that you might need to do some one time setup to authorize IFTTT the first time you select Adafruit's channel.
Select Adafruit's channel and pick the Send data to Adafruit IO action:
Now select the toilet-light feed in the Feed name drop down (if you don't see the feed then make sure you've setup and changed the toilet light LED color by following all the steps in the previous page).
For the Data to save value you can specify a command to change the toilet light color. For example the command PFF000005 will pulse the toilet light red every 2 seconds. Use any command like changing to a solid color, pulsing other colors, or animating a rainbow cycle--check out the previous page for the command syntax.
Click Create Action to finish setting up the recipe.
Give the recipe a descriptive name and then click Create Recipe to finish and enable it. When the weather changes to rain you should see the toilet light pulse red!
Try setting up more recipes to change the light when weather conditions change to snow, clouds, or clear skys:
That's all there is to setting up the toilet light with IFTTT! You can hook up almost any action to control the toilet light. For example have it flash when you have too many unread emails or missed a phone call. The possibilities are almost endless!