Use wifi reconnection to trigger unlock of front door

Instead of dealing with how quickly your GPS is updated to trigger an event, Have it unlock door as soon as your smartphone reconnects to your home wifi. That would limit the distance down to while you are walking to your door.

There already are some community SmartApps available that can do that for you (toggling presence based on WiFi presence):

There are potential issues with that though - if your phone turns off WiFi to save battery or powers down, you will appear as no longer present. When it then reconnects/powers back up again, your door might unlock. If that happens in the middle of the night it might not be exactly what you want… :thinking: :spy:

1 Like

I just saw an IFTT recipe yesterday for accomplishing exactly that. If connect to a particular SSID, then unlock door.

yes i use that myself to unlock doors, however if you allow this in night mode when sleeping then i think you need to rethink how you do HA. Mine categorically will not unlock when in that mode

Beacons would work better in this case. Been wanting to set this up. It uses low power bluetooth so it doesn’t burn through battery nearly as much as wifi. Most phones actually turn off wifi when the screen is off.

Apple phones turn off wifi when the screen is off, android phones do not unless battery saver is on. And neither do win mo phones

If your wifi hub is not near the front door, it can often fail to unlock by the time you reach the door. I tried with wifi connected, wifi near, Bluetooth near… Ultimately I installed the AutoLocation app on my android phone and set up three geofences: home (driveway), neighborhood, town. It’s been flawless; it unlocks either as I’m in my driveway, or walking up to the door.

Android also turns it off when screen is locked. There are times when wifi wakes up and checks what is around, it is used to help with geo location since wifi is less battery intensive than GPS.

I use a Geo Fence and it works for the most part, the issue is its pretty wide, maybe quarter of a mile.

I thought about setting up one of my old windows phone with smarting so and leave in car. So when it reconnects to wifi it would sync my presence. But I don’t always leave in my car.
For now I setup a IFTT as a backup if smarthings fails again.
You would think if you lose power it would not change anything on power up. So maybe not use wifi as connection trigger but only as a way to signal presence of phone?

I actually came up with a concept for this a while ago… my idea was to have a Raspberry Pi sniff for devices on the WiFi network. When the phone’s MAC address is seen, it could send a command to SmartThings to unlock. The downside to this is that if someone is replicates the phone’s MAC address, they could get into the house. It also might be a little slow to unlock depending on the Raspberry Pi’s polling rate. The upside is that you don’t have to depend on IFTTT (If it’s down) or anything on the phone that would waste battery.

Sounds like a clever idea. Is there something that could be used for 2 factor authentication? Name of phone has to match?

not the behaviour I see with my android devices. Both my android devices and windows phone maintain there WiFi connectivity. But maybe that’s because don’t have marshmallow devices. Doze was the feature that turns off wifi on android. So i was technically right for android with the exception of marshmallow devices. Not sure if you can disable doze killing WiFi. I know you can’t disable the equivalent on IOS

That’s a good idea! Maybe if you use a static IP it could search for the phone’s name, MAC address, and assigned IP address.

There is also a setting “Keep Wifi On during Sleep” that may be checked. Found an article from 2011 so its been around for at least that long. Wifi and GPS are the 2 biggest drains (behind Screen on) on phones. Doze was made to prevent apps from waking up wifi (and other services like GPS) and killing the battery life.

I have done this test a few times. Leave my phone with screen off for 30 or so minutes, open live logging, and unlock my phone. I usually see a message in the IDE about my android just arriving. That is part of the reason I am hesitant of using a mobile device to unlock doors on events.

I was doing some research last night on beacons and iOS has a beaconThings app that integrates into SmartThings.

May try to set something like this up on Android this summer. Signul is out there but uses IFTT for ST integration and needs batteries.

http://signul.io/

If I knew you had a rule that unlocked your house based on wi-fi detection, what’s to stop me cloning your wi-fi, and attaching a small base station to your car?

You’d drive off, and I’d have full access to your valuables.

Just sayin’…

@PailOckenden please do attempt that. Im running a lot more wireless security than most on the wifi network that controls the locks. You’ve got to get past two layers If you can get to the point where you can complete the negotation to get the mac registered on the wireless interface, you deserve to get in… Just sayin’ and as for the base station attaching to my car? What’s that all about? Makes no sense!

People don’t have issues with keys but a good 80% of people leave thier keys within fishing distance of the letterbox…i prefer the odds mine is more secure

That’s actually funny that you mention beacons, because my first concept had beacons that unlocked the door! That would work well, especially if it had two factor authentication (Phone detects beacon -> communicates with Raspberry Pi -> Raspberry Pi checks for phone on WiFi -> Door unlocks). The beacons can also lock the door when you walk away from them.

Fairly inexpensive too , $30-50. Plan on building a smart mirror by the door, a short range beacon there would make sense.

I was thinking it means you’d stay ‘connected’ to your home network as you drove away.

yup but it’s not my phone that unlocks the door it’s my basestation and if my phone was connected to yours it would already be away according to my basestation and the doors would be locked