Seam Docs
Search…
⌃K

Get started with August Locks

August Locks
August Wifi Locks can be connected to your local wifi network with a bluetooth-enabled phone, these locks can then be remotely locked or unlocked with the Seam API. In addition to locking or unlocking the door, you can see if the door is open or closed.

Overview

To pair an august lock with our API, we'll need to sign into an August Account. We can do this by creating a Seam Webview.
For testing the August API use a sandbox API key. In the sandbox, you can login with August Sandbox accounts, see multiple locks, and perform lock and unlock actions against sandbox devices. When you're done testing with the Sandbox, switch to a real API key.
Make sure to install the relevant Seam package for your language...
Python
Javascript
Ruby
from seamapi import Seam
seam = Seam()
webview = seam.connect_webviews.create(accepted_providers=["august"])
assert webview.login_successful is False
# Send the webview URL to your user
print(webview.url)
import Seam from "seamapi";
const seam = new Seam();
const { connect_webview: connectWebview } = await seam.connectWebviews.create({
accepted_providers: ["august"],
});
console.log(connectWebview.login_successful); // false
// Send the webview URL to your user
console.log(connectWebview.url);
require "seamapi"
seam = Seam::Client.new(api_key: "MY_API_KEY")
webview = seam.connect_webviews.create(
accepted_providers: ["august"]
)
puts webview.login_successful # false
# Send the webview URL to your user
puts webview.url
We should now send the Connect Webview URL to the user, when the user signs in, we'll see a "completed" status on the webview or login_successful set to true.
Python
Javascript
Ruby
updated_webview = seam.connect_webviews.get(webview.connect_webview_id)
assert updated_webview.login_successful # true
const updatedWebview = await seam.connectWebviews.get(connectWebview.connect_webview_id)
console.log(updatedWebview.login_successful) // true
updated_webview = seam.connect_webviews.get(webview.connect_webview_id)
puts updated_webview.login_successful # true
We can now find all the devices that are associated with the connected account that was signed into. From the returned payload, we can see if a lock's door is open, and see if the lock is locked or unlocked.
Python
Javascript
Ruby
all_locks = seam.locks.list()
some_lock = all_locks[0]
assert some_lock.properties["online"] is True
assert some_lock.properties["locked"] is True
print(some_lock)
# Device(device_id='a8669e4c-76e3-4db6-a827-11a65eb360ba',
# device_type='august_lock',
# location=None,
# properties={'august_metadata': {'house_name': 'My House',
# 'lock_id': 'lock-1',
# 'lock_name': 'FRONT DOOR'},
# 'door_open': False,
# 'locked': True,
# 'online': True})
const allLocks = await seam.locks.list()
const someLock = allLocks[0]
console.log(someLock.properties.online) // true
console.log(someLock.properties.locked) // true
console.log(someLock)
/*
{
device_id: 'a8669e4c-76e3-4db6-a827-11a65eb360ba',
device_type: 'schlage_lock',
location: null,
properties: { schlage_metadata: {...} },
locked: true,
online: true
}
*/
some_lock = seam.locks.list().first
puts some_lock.properties["online"] # true
puts some_lock.properties["locked"] # true
puts some_lock
# <Seam::Device:0x00764f8
# device_id="e002825a-27ee-4d74-9be3-45564b14c931"
# device_type="smartthings_lock"
# properties={
# "locked"=>true,
# "online"=>true,
# "battery_level"=>1,
# "smartthings_metadata"=>{
# "device_id"=>"83b32603-e36a-416b-a06e-78215223df98",
# "device_name"=>"Yale Door Lock"},
# "name"=>"Yale Door Lock"}>

Locking a Door

post
/locks/lock_door
Python
Javascript
Ruby
seam.locks.lock_door(some_lock)
updated_lock = seam.locks.get(some_lock.device_id)
assert updated_lock.properties["locked"] is True
await seam.locks.lockDoor(someLock.device_id)
const updatedLock = await seam.locks.get(someLock.device_id)
console.log(updatedLock.properties.locked) // true
seam.locks.lock_door(some_lock)
updated_lock = seam.locks.get(some_lock.device_id)
puts updated_lock.properties["locked"] # true

Unlocking a Door

post
https://connect.getseam.com
/locks/unlock_door
Unlock a door
Python
Javascript
Ruby
seam.locks.unlock_door(some_lock)
updated_lock = seam.locks.get(some_lock.device_id)
assert updated_lock.properties["locked"] is False
await seam.locks.unlockDoor(someLock.device_id)
updatedLock = await seam.locks.get(someLock.device_id)
console.log(updatedLock.properties.locked) // false
seam.locks.unlock_door(some_lock)
updated_lock = seam.locks.get(some_lock.device_id)
puts updated_lock.properties["locked"] # false

Setting an Access Code

Python
Javascript
Ruby
seam.access_codes.create(
device=some_lock, code="123456", name="Personal Access Code"
)
await seam.accessCodes.create({
device_id: someLock.device_id,
code: "123456",
name: "Personal Access Code",
});
seam.access_codes.create(
device_id: some_lock.device_id,
code: '123456',
name: 'Personal Access Code'
)

Listing Access Codes

Python
Javascript
Ruby
# you can use a device or a device_id as the "device" parameter
seam.access_codes.list(device=some_lock)
# [
# AccessCode(
# access_code_id='af5272b1-2a49-4eb5-9388-2447fc7b5bd1',
# type='ongoing',
# code='123459'
# )
# ]
await seam.accessCodes.list({
device_id: someLock.device_id,
})
/*
[
{
code: '1988',
type: 'ongoing',
status: 'setting',
created_at: '2022-08-26T12:50:17.858Z',
access_code_id: '26d6138c-6524-4f3c-ac96-43cc3bea0a8d'
}
]
*/
# you can use a device or a device_id as the "device" parameter
seam.access_codes.list(some_lock)
# [<Seam::AccessCode:0x007cd58
# code="669781"
# name="My first code"
# type="ongoing"
# created_at="2022-07-06T23:26:42.223Z"
# access_code_id="f19bc8cb-15be-43af-bb52-f1a417e0ff09">]