Seam Docs
Search…
Get started with Schlage Connect Locks

Schlage Locks

Schlage Encode 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, as well as progra access code to allow keyless entry.
​

Overview

To pair a Schlage lock with our API, we'll need to sign into a Schlage account. We can do this by creating a Seam Webview.
​
Make sure to install the relevant Seam package for your language...
Python
Javascript
from seamapi import Seam
​
seam = Seam()
​
webview = seam.connect_webviews.create(accepted_providers=["schlage"])
​
assert webview.login_successful is False
​
# Send the webview URL to your user
print(webview.url)
import Seam from "seamapi"
​
const seam = Seam()
​
const webview = await seam.connect_webviews.create({
accepted_providers: ["schlage"]
})
​
console.log(webview)
/*
{
"connect_webview_id": "811b80e7-7c87-4ce1-a938-2f6936851aa9",
"url": "https://connect.getseam.com/v1/connect_webviews/view?connect_webview_id=811b80e7-7c87-4ce1-a938-2f6936851aa9&auth_token=GXtMoAaperbuNhSCByyQMroT9HMRquXK6",
"device_selection_mode": "none",
"accepted_providers": [
"schlage"
],
"created_at": "2022-01-03T21:11:27.002Z",
"login_successful": false,
"status": "pending"
}
*/
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
updated_webview = seam.connect_webviews.get(webview.connect_webview_id)
​
assert updated_webview.login_successful
const updated_webview = await seam.connect_webviews.get(webview.connect_webview_id)
​
console.log(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
from pprint import pprint
​
all_locks = seam.locks.list()
​
some_lock = all_locks[0]
​
assert some_lock.properties["online"] is True
assert some_lock.properties["locked"] is True
​
pprint(some_lock)
# Device(device_id='a8669e4c-76e3-4db6-a827-11a65eb360ba',
# device_type='schlage_lock',
# location=None,
# properties={'schlage_metadata': {...}},
# 'locked': True,
# 'online': True})
const all_locks = await seam.locks.list()
​
const some_lock = all_locks[0]
​
console.log(some_lock)
/*
{
device_id: 'a8669e4c-76e3-4db6-a827-11a65eb360ba',
device_type: 'schlage_lock',
location: null,
properties: { schlage_metadata: {...} },
locked: true,
online: true
}
*/

Locking a Door

post
/locks/lock_door
​
Python
Javascript
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.lock_door({ lock: some_lock })
​
const updated_lock = await seam.locks.get(some_lock)
​
console.log(updated_lock.properties.locked)
// true
​

Unlocking a Door

post
https://connect.getseam.com
/locks/unlock_door
Unlock a door
Python
Javascript
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.unlock_door({ lock: some_lock })
​
const updated_lock = await seam.locks.get(some_lock.device_id)
​
console.log(updated_lock.properties.locked)
// false
​
​

Create an Access Code

post
https://connect.getseam.com
/access_codes/create
Create an Access Code
Python
Javascript
access_code = seam.access_codes.create(
lock=some_lock,
code="876543",
)
​
pprint(access_code)
# AccessCode(
# access_code_id='a8669e4c-76e3-4db6-a827-11a65eb360ba',
# type='ongoing',
# code='876543',
# starts_at='2022-01-13T21:17:56.138Z'
# ends_at=None,
# location=None,
# )
const access_code = await seam.access_codes.create({
lock: some_lock,
code: "876543",
})
​
console.log(access_code)
/*
{
"access_code_id": "a8669e4c-76e3-4db6-a827-11a65eb360ba",
"code": "876543",
"type": "ongoing",
"starts_at": "2022-01-13T21:17:56.138Z",
"ends_at": null
}
*/
​

Delete an Access Code

delete
https://connect.getseam.com
/access_codes/remove
Remove an Access Code
Python
Javascript
seam.access_codes.remove(some_code)
await seam.access_codes.remove({
code: some_code
})

Setting an Access Code

Python
seam.access_codes.create(
device=some_lock, code="123456", name="Personal Access Code"
)

Listing Access Codes

Python
# 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'
# )
# ]
​