In the second episode of "Hack Your Home," we add a bit more control to the Photon and PowerSwitch Tail II (PST) with IFTTT. Additionally, we create a manual override circuit that can be used to switch the appliance on if the Photon stops working.
To build the project seen in this episode, follow the instructions below.
Step 1: Prepare HardwareBuild the hardware as shown in the diagram. Note that the PST +in is connected to 3.3 V from the Photon and -in is connected to the transistor's collector.
Head to build.particle.io and create a new app. Copy in the code listed in the Attachments section.
Step 3: Sunset IFTTT RecipeHead to ifttt.com and create an account. Click My Recipes and Create a Recipe. Click the underlined this and search for "weather." Click Weather, and click Connect. Search for the nearest major city. Select it, click Connect, and Done.
Click Continue to the Next Step. Click Sunset and Create Trigger. Click on the underlined that. Search for "Particle," click it, and select Connect. Sign in with your Particle credentials. Click OK and Done.
Select Call a Function. In Then Call, select Switch on <Your Photon's Name>. In with Input, replace everything with the word on.
Click Create Action and Create Recipe.
Install the DO Button from iTunes or the Google Play Store. Open it, and log in using your IFTTT credentials. Create a new recipe. Click on Channels and search for "Particle." Click it, and select Create a New Recipe.
Click Call a Function. Name it something like "Turn lamp off." Select Switch on <Your Photon's Name> from Then Call. In with Input, replace everything with the word off. Click Add.
Plug in an appliance, like a lamp, into the PST. Around sunset, IFTTT should trigger and send a notification to your Photon, which will turn the lamp on. Press the DO Button on your phone to turn it off.
Adding a manual override switch is a natural upgrade, and controlling an appliance using IFTTT is fairly straightforward. Try making another recipe that controls your appliance!
Here, I updated the DO Button to turn on my desktop from my phone.
Comments