Browsed by
Category: Wearable

Zones App for August Smart Lock on Android Wear

Zones App for August Smart Lock on Android Wear

Zones – Geofence API Launcher

If you’re wondering why after so many years there’s still no app to unlock your August Lock from your Android Wear watch, you’re not alone. But now you can unlock your August locks from your watch using the Zones app!

Just set up a geofence zone in the app with a special action url:

august://[key-offset]:[key]@[lock-id]

To get the key, offset and id, use the instructions here. Getting the keys is a little technical, but if you have an Android Wear watch you’re probably already a super nerd, so I trust you’ll get it.

Then when you’re “in the zone”, a wear notification will pop up and you can press it to unlock your door. Sweet!

You can also trigger other HTTP APIs using the app, if you’ve got any of those lying around. And if you’d like to integrate August Smart Locks into your Xamarin App, check out the plugin I wrote to provide this functionality, Plugin.Android.AugustLock. Happy unlocking!

Why is there no August Smart Lock API?

Why is there no August Smart Lock API?

Today in #ThingsIWishExisted: August Smart Lock API

I bought an August Smart Lock three years ago so I could stop carrying around door keys and have my doors magically unlock themselves. Actually that’s not really true, I really bought a crowdfunded Lockitron three years ago but the dang thing was going to be so delayed I impulse bought the August lock while in an Apple store. I later rationalized the purchase thinking that I’d compare it to the Lockitron when it eventually arrived, and return one of them. It ended up being OVER THREE YEARS before the Lockitron finally showed up, and by that time I’d moved out of my apartment in Boston to Texas where my new place had a door that no longer fit the Lockitron.

Long story short, I’ve been using the August lock for a while. The thing that sucks about it is that the August Auto-Unlock feature is pretty crappy. The dream is that I walk up to the door, it magically unlocks itself and I open it and stride through like a man from the future. The reality is that I do that about 25% of the time, I stand awkwardly in front of the door waiting for it to eventually open 50% of the time, and 25% of the time it never opens and I sigh and use the Android app to unlock the door (or I use the key I never stopped carrying). First world problems, right?

So pretty. But no API!

This wouldn’t be too much of a problem if August would create an Android Wear app for my smartwatch, so I could quickly just tap my wrist while walking up to the door to unlock it instead of fishing my phone out of my pockets, unlocking it, opening the app, waiting for it to start up and then tapping my house icon and waiting and then tapping the unlock button. Terrible! But they haven’t made an Android Wear app probably because there aren’t enough people willing to look like nerds and wear Android watches to justify the expense. Well, that’s fine, I could just write my own Android Wear app, but I’d need access to the August Smart Lock API and they don’t make it public. What’s the point of having a Smart Lock if the smart features aren’t available for tinkerers to tinker with? So frustrating.

A smart guy reverse engineered the bluetooth protocol and released a NodeJs program that could run on a Raspberry Pi to open the August lock, but running Wifi, Bluetooth and NodeJs on a Raspberry Pi was asking for trouble, and my setup crashed often enough to fail the WAT1. I ended up creating a horribly complicated system derived from the Node library which now involves an old phone, a Microsoft Azure Function and Google Firebase notifications to work with my old Geolocation Watch App to unlock the door. It’s working for now, so we’ll see if it ends up being reliable enough to pass the WAT.

UPDATE 3/18/2017: It ended up being too slow and unreliable so I ported the August bluetooth API to Xamarin (and made a plugin) so I could build this functionality into my Zones app. Works much better.

Oh, and the Lockitron that arrived 3 years late and doesn’t fit my door? It has a public API.

  1. Wife Acceptance Test
API Automation on your wrist with Zones

API Automation on your wrist with Zones

Thanks to an August Smart Lock and a Raspberry Pi with a 5V Relay jury-rigged to the building door buzzer, I’ve exposed two Web API endpoints that allow me to unlock my building complex door, and my front door. In the past I’ve run a website1 that I access on my mobile browser to buzz in. It was clunky and had very low WAF but it worked.

untitled_clipping_090916_121838_pm

After Google I/O in 2014 I got a Samsung Gear Live smartwatch which faithfully adorned my wrist until the charger pad disintegrated2 and it sailed off into device heaven. Its replacement was a Moto Sport 360 watch. I’d tried in the past to integrate my Web APIs with my smartwatch with the IFTTT app and the Maker Channel, but the latency of the app and the web request action was high enough to negatively impact WAF, so I needed a different solution.

So I made an app: Zones! It was a good opportunity to try out Xamarin, which allows you to make native-ish apps. Recently made free for Visual Studio users through an acquisition by Microsoft, it was an interesting experience. It didn’t seem 100% polished but it did the job.

With Zones, you configure Geofences and then link those to Web APIs. The APIs can either be auto-activated on entry/exit, or can make notifications appear on your phone or smartwatch so you can activate them manually. This has worked well for me– I turned off notifications on the phone and only show them on the watch. Now I can quickly unlock the building complex door while walking up to it without having to pull out my phone, unlock it and navigate to a website or app. And any other location-dependent web service I expose could be added to the app easily.

This app is meant for developers (or at least someone with access to some Web APIs), which is okay with me–I did it more to see what developing a native app with a wearable component was like, not to make any money (it’s free in the Play Store) or have a ton of people use it. Can you think of other things to use Zones for? Here’s a few I thought of:

  • Timeclock integration – Clock in and out when you’re at the office
  • Garage door opener – I don’t have a garage but if I did I’d probably try to do this
  • Toggle security alarm activation – Would have to expose a web service for this
  • Turn off all the lights – There always seems to be one light left on when you go to bed… although it’d have to be a connected IoT light for this to work.

Anyway, hope the app is useful to someone else and if not it was an interesting intro to Android APIs, now I know about Xamarin for writing Android apps in C#, Google Play Location Services, backgrounding Android services, and Android Wear APIs.

screenshot_090916_053154_pmCheck it out in the Play Store:
https://play.google.com/store/apps/details?id=us.m4rc.zones

 

  1. nicknamed “OpenSesame”
  2. probably due to excessive exposure to sweat from hiking, marathons, etc