Code Monkey home page Code Monkey logo

augustpy's Introduction

augustpy

Because the August Connect is far too expensive. Heavily inspired by the abandoned augustctl project and its many forks.

Setup

These instructions are currently for Linux only. The Raspberry Pi 3 and newer are supported, as well as the Zero W.

Automated setup

Simply run setup.sh to install requirements and configure permissions. Root access is required.

Manual setup

  1. Setup basic packages:
  $ sudo apt-get install python3 python3-pip libglib2.0-dev
  1. Clone repo to desired location and enter the folder.

  2. Install Python requirements:

  $ pip3 install -r requirements.txt
  1. [Recommended] To use Bluetooth LE scanning functionality as non-root, give direct permissions to bluepy-helper:
  $ sudo setcap 'cap_net_raw,cap_net_admin+eip' $(echo "$(pip3 show bluepy | grep Location: | cut -c 11-)/bluepy/bluepy-helper")

Configuration

Communication with the lock is encrypted using a hidden key stored within the August app. In order to control and monitor your August lock with this program, you must first find this key.

Android Phone

Root is required to access the data. If your phone is not rooted, you may be able to setup a rooted Android virtual machine, install the August app on it and extract the necessary data from there.

If the phone is rooted, you can copy the settings file /data/data/com.august.luna/shared_prefs/PeripheralInfoCache.xml from your phone to your computer. Apps such as Solid Explorer can do this, or you may use adb shell.

Open PeripheralInfoCache.xml and find the bluetoothAddress, handshakeKey and handshakeKeyIndex strings. You should find something like this:

"bluetoothAddress":"0A:1B:2C:3D:4E:5F","handshakeKey":"ABCDEF0123456789ABCDEF0123456789","handshakeKeyIndex":1

Copy the values found between the " delimiters (here, 0A:1B:2C:3D:4E:5F, ABCDEF0123456789ABCDEF0123456789 and 1, respectively).

iPhone

The key and offset can be found in plist located at:

User Applications/August/Library/Preferences/com.august.iossapp.plist

This can be retrieved by using a file explorer like http://www.i-funbox.com/ifunboxmac/, and opening the plist in Xcode.

Putting it all together

Paste the values you've found in a file named config.json in the folder you wish to execute augustpy from, like so:

{"bluetoothAddress": "0A:1B:2C:3D:4E:5F", "handshakeKey": "ABCDEF0123456789ABCDEF0123456789", "handshakeKeyIndex": 1}

If you have more than one lock, you may instead define an array of locks, like so:

[
  {"name": "front", "bluetoothAddress": "0A:1B:2C:3D:4E:5F", "handshakeKey": "ABCDEF0123456789ABCDEF0123456789", "handshakeKeyIndex": 1},
  {"name": "back", "bluetoothAddress": "6A:7B:8C:9D:0E:1F", "handshakeKey": "ABCDEF0123456789ABCDEF0123456789", "handshakeKeyIndex": 1}
]

augustpy's People

Contributors

friendly0fire avatar

Stargazers

Kevin Kwok avatar  avatar Sheng avatar Val Packett avatar Karl Li avatar Brian Johnson avatar  avatar Tommy Goode avatar  avatar

Watchers

James Cloos avatar

augustpy's Issues

Can't find keys in latest ios app (11.0.1)

(edit: also on a jailbroken iphone using August app 10.17.1 and using iFunBox)

Using iExplorer and looking at a full backup, I find AppDomain-com.august.iossapp/Library/Preferences/com.august.iossapp.plist - but within that plist is nothing about bluetooth addresses or keys.

I've checked out a number of other plist files in the same hierarchy but without luck.

Does anyone have an idea on how to find these values?

Connection issue with the August Lock Pro gen3

Hello,

I love what you did with the python interface, unfortunately I couldn't get it to work on my end. I got the offline key and index with a rooted android phone, however when I issue the command "sudo python3 cli.py front --unlock", I get the following error messages:

Writing command: xxxxxxxxxxxx
Encrypted command: yyyyyyyyyyyyy
Traceback (most recent call last):
File "cli.py", line 38, in
lock.connect()
File "/home/pi/augustpy/augustpy/lock.py", line 55, in connect
response = self.secure_session.execute(cmd)
File "/home/pi/augustpy/augustpy/session.py", line 96, in execute
return self._write(command)
File "/home/pi/augustpy/augustpy/session.py", line 89, in _write
self.peripheral.waitForNotifications(10) is False:
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 560, in waitForNotifications
resp = self._getResp(['ntfy','ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 362, in _waitResp
raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected

Any clue what might be going on? Thanks!

Error with August Lock Pro gen3

Hello @Friendly0Fire

I try use your program but have an error as below. Please help me fix it!. Thanks

python3 cli.py front --status
Traceback (most recent call last):
File "cli.py", line 38, in
lock.connect()
File "/scripts/augustpy/augustpy/lock.py", line 28, in connect
self.peripheral = btle.Peripheral(self.address)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 78:9C:85:05:41:E0, addr type: public

Get push notification from the lock

Is there a way to get push notifications from the lock?

It seems that rickdsanchez is using notifications in his fork. Is there a way to get instant notifications from the lock, so I get an instant update if the lock is locked/unlocked/doorbell (I have a Yale Doorman L3 with build in doorbell).

Sorry not much of a python programmer my self ๐Ÿ˜”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.