An easy way for guests to use your smart lock
As you can see above, all it takes is opening the app and pressing a button to unlock your apartment building from anywhere.
After setting this all up, though, I wasn't satisfied — I wanted to make the unlocking process as simple as possible. If you do what I did — use SwitchBot to buzz people in, and Sesame to unlock your door — that's two apps that guests would have to use, which is asking a lot.
Before I give instructions for creating the webpage, I wanted to mention that both Sesame and SwitchBot don’t require any internal alterations to your door and intercom — they both mount on top, so your landlord probably won’t notice, or care.
The most important part is line 4 of the JavaScript:
xhttp.open("GET", "https://maker.ifttt.com/trigger/[insert-trigger-name-here]/with/key/[insert-key-value-here]",true);
The URL in this line is what makes the magic happen. I'll break it down for you — here’s the first portion:
“https://maker.ifttt.com/…”
This is the call to the API, where all the data is stored. You can learn more about how the API works in the developers section of the site.
The next portion is the “trigger”:
“…/trigger/[insert-trigger-name-here]/…”
The trigger is the "event" that sets the applet in motion. With webhooks, the trigger is always a request from another website. So when I press the "Buzz me in" button from my website, that’s the trigger.
When you create a webhooks applet, you have to give the event a name, like "buzz_me_in". So if that's what you decide on, this portion of the URL would read:
“…/trigger/buzz_me_in/…”
The last part is called the “key”:
“…/with/key/[insert-key-value-here]…”
The key is like your Social Security number — it’s a bunch of numbers (and letters) unique to you, that should be kept private.
To find your key, go to the “webhooks” page on IFTTT and connect your account. Then click on “Settings” in the upper-right corner. On the next screen, you should see a URL that looks like this:
“https://maker.ifttt.com/use/[insert-key-value-here]”
Copy the key value at the end and paste it into line 4 of the JavaScript. Here it is again, if you need it:
xhttp.open("GET", "https://maker.ifttt.com/trigger/[insert-trigger-name-here]/with/key/[insert-key-value-here]",true);
That's all it takes to run an IFTTT applet on a webpage, and give access to your apartment to anyone with a browser.
Replicate these steps for the other triggers — unlocking your apartment door, locking the door, etc. — by using the code above, and feel free to email me with any questions.