Skip to main content

Control Kwikset Kevo locks

Project description

This is a fork of the below with fixes and performance improvements.

This is a Python3 fork of the original module for controlling Kwikset Kevo locks written by CSeelye.

Per Cseelye:

Kwikset does not provide an official API for their Kevo locks; I reverse engineered this module from the mykevo.com web app.

To use this module you will need to have a Kevo Plus installed and a registered account on mykevo.com. You will need your mykevo.com credentials to use this module.

This module is published to pypi so you can install it simply via pip install pykevocontrol

Usage

The Kevo.GetLocks() function will attempt to scrape the mykevo.com web site to find your locks; as of this writing it can find all of your locks, but scraping the HTML might break at any time if Kwikset changes the website. This is broken as of 9 Sep 2019 due to recent CAPTCHA changes on the Kevo web site, however the KevoLock.FromLockID() method still works.

from pykevoplus import Kevo
locks = Kevo.GetLocks("username@email.com", "password123")
for lock in locks:
    print(repr(lock))

Output:

KevoLock(name=Front Door, id=cca7cd1d-c1d5-43ce-a087-c73b974b3529, state=Locked)
KevoLock(name=Back Door, id=c60130cd-8139-4688-8ba3-199276a65ad6, state=Locked)

A better way is to explicitly instantiate a KevoLock object using the UUID of the lock. You can get the lock IDs manually by logging into mykevo.com, click Details for the lock, click Settings, the lock ID is on the right.

from pykevoplus import KevoLock
lock = KevoLock.FromLockID("cca7cd1d-c1d5-43ce-a087-c73b974b3529", "username@email.com", "password123")

Locking and Unlocking

from pykevoplus import KevoLock
lock = KevoLock.FromLockID(lock_id, username, password)
lock.Unlock()
print(lock.GetBoltState())
lock.Lock()
print(lock.GetBoltState())

Output:

Unlocked
Locked

Multiple operations in the same session

The KevoLockSession context manager allows you to perform multiple operations on a lock with a single auth session

from pykevoplus import KevoLock, KevoLockSession
lock = KevoLock.FromLockID(lock_id, username, password)
with KevoLockSession(lock):
    lock.Unlock()
    lock.Lock()

Known Issues

  • Error handling is extremely basic and needs much more work. Communication errors as well as lock bolt errors need to be addressed

  • Alpha support for Python3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykevoplusnew-3.0.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

pykevoplusnew-3.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pykevoplusnew-3.0.0.tar.gz.

File metadata

  • Download URL: pykevoplusnew-3.0.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.11

File hashes

Hashes for pykevoplusnew-3.0.0.tar.gz
Algorithm Hash digest
SHA256 522fbcc57e3ffd6759937aaa20afbdc8a8519980c69942d3e3a31b032227e0da
MD5 425057ba8b27a501b5153a0b75eed46a
BLAKE2b-256 e6173efef290633c60cd51acbb7d0b826e9991dde4ff49dbad16736029219b9b

See more details on using hashes here.

Provenance

File details

Details for the file pykevoplusnew-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pykevoplusnew-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46424d39185bd9e59857cc5b1fd386fb21ba68ff1048698b6f824440595e52d7
MD5 a88726c13c79269a9195713fa4cdd8e0
BLAKE2b-256 5faa8150f965c445b6f924b13f1a7b246c107f6b2dca8c764712200872ed00f4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page