A simple module for locking, unlocking, and getting the status of August smart locks via the August Connect WiFi bridge.
You'll need:
- A set up & configured August Smart Lock + August Connect WiFi bridge
- The password to the August account you'll be using with this client
- A valid August API key¹
npm i august-connect
Set up the following environment variables:
AUGUST_API_KEY
- a valid August API key¹ – please refer notes at the bottom of this readme for moreAUGUST_INSTALLID
- any string; suggest using something reasonably long, random, and unique; changing this will break things and require re-validationAUGUST_PASSWORD
- your August passwordAUGUST_ID_TYPE
-email
orphone
AUGUST_ID
- the corresponding account email or a phone number (phone format is+[countrycode][number]
with no other symbols, i.e.+12345678901
)
To work with august-connect
locally, I suggest setting up your variables with dotenv.
Require august-connect
in your project:
let august = require('august-connect')
Before you can use august-connect
, we'll have to obtain a valid session token. This means inputting a six digit code that August will send to your email
or phone
ID. Here's how:
- First, initiate the request for a validation code by calling:
august.validate()
- Then, complete your validation request by adding the six digit code (as a string) as the param:
august.validate('123456')
- Finally, remove
august.validate()
from your code because you won't need it anymore
Now you should have a valid session! If you change your AUGUST_INSTALLID
, or don't make use of this session for 120 days, you'll have to repeat this process again to validate another session.
august.locks(callback)
- returns object of locks your account has access toaugust.status([lockID][, callback])
- returns status of a single lock- If your account only has access to a single lock, you can opt not to specify a
lockID
- Just for reference, lock states:
status.kAugLockState_Locked
== lock is lockedstatus.kAugLockState_Unlocked
== lock is unlocked
- If your account only has access to a single lock, you can opt not to specify a
august.lock([lockID][, callback])
- lock a single lock- If your account only has access to a single lock, you can opt not to specify a
lockID
- If your account has access multiple locks, you must specify a lockID; this is to prevent locking the wrong lock, which would be not good
- If your account only has access to a single lock, you can opt not to specify a
august.unlock([lockID][, callback])
- unlock a single lock- If your account only has access to a single lock, you can opt not to specify a
lockID
- Same as above, your account has access multiple locks, you must specify a lockID; this is to prevent unlocking the wrong lock, which would be not good
- If your account only has access to a single lock, you can opt not to specify a
const August = require('august-connect')
August.lock()
const August = require('august-connect')
August.lock('7EDFA965E0AE0CE19772AFA435364295', d => console.log(d))
const August = require('august-connect')
August.unlock('7EDFA965E0AE0CE19772AFA435364295')
const August = require('august-connect')
August.status('7EDFA965E0AE0CE19772AFA435364295',
function isItLocked(lock) {
return lock.status === 'kAugLockState_Locked'
}
)
- Tests, especially for the August API (PRs welcome!)
- Support for returning promises probably
- Better handling of some obscure API error states
- idk, what else should this do?
Big ups to Nolan Brown and Joe Lu's py-august project for paving the way!
¹ august-connect
uses August's unpublished API, and August has been known to occasionally recycle their client API keys. Hard-coding a August API key into august-connect
would not reliable, so you'll need to acquire a key of your own. I suggest using Nolan Brown's August API reverse engineering guide to get one – or there's always Google!
- This module was tested with a 1st-generation August Smart Lock
- If you have a 2nd or 3rd-gen Pro (or regular), I'd love to know that it works!
- This module does not provide an interface to August locks via BLE
- This module is not intended to provide complete coverage of the August API, only the bare minimum necessary to operate the August Smart Lock
- Unfortunately, August does not publish their API for consumer usage, so this may break at any time; August name etc. trademark Assa Abloy (who make some truly locks, by the way!)
- I am in no way responsible for any safety issues that arise from the use of this module!