First: Cool project!<p>Second: I'm probably missing something, but:<p><pre><code> Therefore, I would at least need to start a process
that would understand my intent to leave
</code></pre>
How did you solve the "intent" issue? It looks like your solution simply detects when your phone stops responding to pings, and then unlocks the doors when it resumes.<p>This doesn't seem like it would distinguish between "going for a run", "going on a car trip", "turning the phone off for 10 minutes and then back on again, but never leaving the house," etc.<p>I suppose one (fun, overkill, probably) solution would be if the phone's sensors could be queried. Once the phone "returns", your home network could query the phone and ask it if you've been exercising or not, based on your heartrate/motion since the phone was last seen by the network.
This is awesome! I love reading about projects like this. Always gets me thinking about how I can do little things like this for my life workflows.<p>> installing MyQ W-Fi connected garage doors<p>Haha you were already light-years ahead of me before you even started. I typically slide my key into a little pocket and pray it doesn't fall out. I think using events from your router is a great idea. I have recently been playing around with events you can send from routers and it has really opened up my mind to whole new avenues of creativity.
Home Assistant has home zones. You can trigger events based on being home, away, or the trigger between both states.<p>My current favorite automation is to turn off my lights when I go to sleep by plugging my phone in to charge. The basic logic is:<p>* IF it's 1AM
OR
I transition from Away to Home
OR
My mobile starts charging
CONDITIONAL
My location is AWAY
OR
the time is between 21:00 and 03:00
THEN
Turn my office, kitchen and bedroom lights off *<p>It's a bit complex to get your head around, but the basic idea is, my lights turn off at 1 AM, or I leave the house, or my phone starts charging after 9 PM. This allows me to go to bed early (I'm a night owl) by just charging my phone. It wont trigger in the day based on the conditional.
Automating such a narrow edge-case seems totally pointless. A much more likely scenario is that your battery dies while you're out, in which case you're still screwed.<p>A better tried-and-tested real world solution that covers all scenarios is a simple key safe.
I setup something similar years ago for my garage. Instead of looking for my phone though, I wanted a way to open the garage quickly without using the keypad. My kids were small and my hands were normally full. However, I did have an RFID ID card from $work in my back pocket. So, I placed an RFID reader at butt height. If it detected my ID (or my wife's, or keyfobs, etc...) it would trigger a relay to simulate pushing the button inside my garage to open the door. It was all controlled by an Arduino.<p>That was quite possibly one of the most satisfying projects I've done.<p>I've now since moved and don't have an attached garage anymore, so this is now sitting in a box in my basement. :(
I think that although his approach works, the smarter thing would be to fix a hi-definition camera pointing at his driveway entrance, and use OpenCV/ML/AI[1] to detect that it's him approaching the house and automatically open the garage door.<p>For bonus points he could then rig up a speaker to sing 'welcome home' as well...<p>For even more bonus points, anyone coming up the driveway that isn't him could be greeted by Barking-Dogs.mp3<p>---<p>[1] Or whatever that magic thing is that NCIS use every week.
OP, FWIW I think there's a trigger available in iOS Shortcuts that kicks off if you join a particular network. You could probably use that trigger + a web request and achieve your 'event driven' desire just FYI :)
Love this writeup, though I have to admit I'm slightly disappointed. From the headline I had expected to read how the author rigged his home security system to keep the doors locked. And to only unlock after his phone/fitbit logs him as completing his distance goal for the day.
My solution was just stopping my keys from jingling and poking me while running, I put my keys in a rigid key holder/organizer thing like a Swiss knife for keys
This is a fun project, nice job putting it together! I tried to do a similar thing with an app and my home made security system, but I didn't refine it enough to be reliable.<p>But I don't think it solves the problem that prompted it :P if your phone dies on your run, it won't connect to your network and the Flask app won't capture the packets needed. Still, making this hands off is a great step from needing to open an app.
Just keep your phone warm in a Crotch Pot while you run and you'll be fine.<p><a href="https://www.gossamergear.com/products/the-crotch-pot?variant=30497157388" rel="nofollow">https://www.gossamergear.com/products/the-crotch-pot?variant...</a>
So if you turn off your phone for 5 minutes while staying at home and turn it on again, does your garage door open?<p>EDIT: Or do you need to go press a button on a webpage before going out for a run to make this work? The last part seems to suggest so.
My feelings about these kinds of projects are a bit mixed. I certainly understand why, writing code that controls something in the real world is so much fun. However I actively avoid any kind of smart device in my home, beyond my vacuum cleaner. Having a computer control lighting, heating or access to my home is out of the question, I simply don't want to deal with it. I trust keys, switches and knobs.
<i>Knowing I had left for a run was key to knowing when I had returned from a run, rather than a trip in the car for example.</i><p>Maybe I'm having a brain fart, but I don't see how his solution has accomplished this.<p>Frankly it'd be way easier for the phone to use its GPS and accelerometer to decide he's on a run and just open the door when it reconnects to the wifi.
Very cool (not cold) solution! I would like to set up a similar system, which should be possible - I've recently bought a hubitat hub (highly recommended at $100) which uses groovy for scripting, and uses an installed app on my phone with geofencing to detect presence.
I'm a runner who has also gotten locked out, and my solution was to install a keypad deadbolt on my front door ($100 at Home Depot). Never had a problem since.
There are now locks for your front door that can be opened using a numeric code or a fingerprint or even an nfc fob.<p>Likely any of those would be more robust.
Did I miss where he tells how he did this part?<p><pre><code> Knowing I had left for a run was key to knowing when I had returned from a run, rather than a trip in the car for example.
</code></pre>
From what I see he's assuming a run starts after the phone doesn't respond to ping requests for 5 minutes. How does that imply a run over a car trip?
I like this idea in principle and think it could be turned into a great alternative to a hide-a-key, or used to let a pet in though a small door. A typical garage door spring is rated to last 10k cycles, make of that what you will.
Highly entertaining. I totally understand the problem of the phone shutting down in extreme temperatures. I have to say I'm pretty impressed that you're running in those temps, though.<p>Also thanks for pymyq. Neat home automation library.
So... root cause: Phone ran out of battery. Solution: Does not address root cause at all.<p>I mean, it's cool, and quite likely an improvement over the previous thing, but I predict there'll be a follow-up article within the year :)
This is very clever and useful. I wonder if this could be done with a GPS watch rather than the phone. AFAIK, GPS watches typically send out Bluetooth signals but probably don't connect to Wi-Fi.
I tried to use Ping in home assistant for basic "is home" presence detection. It wasn't very reliable since the phones' wi-fi connections would drop in prolonged sleep states.
For extra fun, you could set up some speakers and have them start playing some appropriate piece of music as you approach. Some sort of triumphal march, perhaps?
I'm really disappointed by all the comments here. OP showed a clever way he gets his garage door to open when he gets home from a run. It's an interesting look into home automation from scratch and exactly the kind of content I come to HN for.<p>This isn't posted in NY Times. He's not advocating everyone should go out and do this because of how much better it's made his life. He's not even claiming that it's necessarily better than putting a keypad on his garage. He just hacked together something cool and we should applaud people trying these kinds of things.
I run 5 days a week. I run with a group ~3 minutes from home, but for years ran from my front door.<p>My phone is too bulky, I have a spare home key. I just… take the key with me.<p>I installed a keypad lock on my last home and that was great but the batteries died once and only had enough juice to lock me out.<p>I really like projects like this but for some reason this one seems silly… hopefully it was at least fun to do