How to use a cell phone (Android for now) as a "key" for the house

So I had set up HA with Alarm on my gf’s old house. The problem was she would more often than not forget to set it, even if she would get a telegram message reminding her no one was home and the Alarm was off. Then the few times she would turn on the Alarm she would forget to turn it off when she got home. Her neighbors got a bit upset with her as the siren was pretty loud and would take her a few seconds to pull cell phone out, unlock her phone, open the app, and enter code.

So her ask this time around is to have sortha like an alarm, but that it turns on/off by itself. I am using the term “alarm” very loosely here. The way our house is setup, we only have two main ways for intruders to come in. First would be through the back fence/wall. I have that part under control as we rarely climb that wall ourselves. I plan to set up sprinkler system, siren, motion detectors, etc. So that part would “always” stay “on” regardless if we are home or not. Few times I need to climb the wall I can just turn the automation off while I do what I need to do.

The other way intruders could come in is through the main front door, or the side door in the front of the house that leads to the yard. And that is where I need to figure out best way for HA to know someone in the household is the one getting in, vs and intruder.

At one point I was thinking via double take with facial recognition, but soon found out that is not reliable at all. Think main problem is that I am using 1080 cameras, and even though they end up about 4 to 5 feet from peoples face the quality doesn’t seem to be good enough for it to get a good scan. Plan on getting a 4k camera soon, and dig more into Double Take facial recognition see if it can become reliable enough in the future.

Currently I am playing with Bermuda Trilangulation using ESP BLE Proxies. However there seems to be many variables invovled there. In order to get it to somewhat work I have to turn the bluetooth transmit power relatively high, which drains the battery not terrifyingly fast, but enough to notice the difference. My gf often has her cell phone with less than 20% so adding the BLE trasmitter to it at high levels not the best option. Plus even with higher transmit power it doesn’t seem to be stable enough. Haven’t done much testing, but the 4 to 5 times I’ve walked around the sensor set by the curb/sidewalk I don’t get clean results. For example today, I walked to/from the BLE Proxy about 10 times, and about 7 or 8 times it did show me at the right location, but a few times while showing me the right location it went to “unkown”. Two or three times I went from kitchen to the outside, and after getting out of range of kitchen it showed me unknown, and even if I walked right next to the senor on the curb it didn’t pick me up until I turned bluetooth off on my phone then back on.

Now I am contemplating a 3rd option. Not sure if it works for all android phones or not, but for our 3 phones in the household when they connect the router assigns them a static IP. Thinking of maybe using the “ping” method, maybe once every 30 seconds to see the status of the phones. The idea would be to set up automation that when ping goes from no reply to reply, to turn off door automations for 3 minutes. I would make sure there is strong wifi connection at the curb to insure cell phones would connect promptly as we walk by. Haven’t tested this yet, so no idea of how reliable it might be.

Could you guys suggest a better approach?

I don’t have my sirens hooked up yet. At the moment I have mmWave sensors in the front yard, and when someone walks into the porch area a speaker says “Hello, we are letting them know you are here, please wait”, then Alexa announces inside that someone is at the front door, then a picture is sent to us via whatsapp, followed by a short video. However this happens even when “we” come home. The goal would be that when of us comes in, the automation wouldn’t trigger, but when someone not form the household walks up the automation does trigger.

I do have it set up so what when we open the door to leave the house, the automation turns off. so we don’t get notified someone is at the door when in fact we are leaving the house.

I think you’re overthinking this.

Just install the HA companion app on both your mobiles and use that for person tracking

2 Likes

is it stable? What does is track when the phone connects, via GPS? or basically different methods? I do have the companion app installed in all phones.

In the past I think I came across posts that mentioned the companion app tracker takes minutes to update.

Stable or not, it will give open up tons of options for you:

  • Native location tracking (most tricky, but there’s a high frequency option you can tweak)
  • Native connection sensors for WLAN
  • If all else above fails, there’s the NFC tag route. If you have a phone with NFC, just buy a cheap NFC sticker (or 10) off Aliexpress and stick it outside your door and cover it with paint.

Our phones don’t have NFC, so that one is out of the equation for now.

Native connection for WLAN, similar to ping I would imagine. So might look at that.

The location tracking, not familiar with. Will do some reading on it and figure out what high frequency option is all about.

Thank you for feedback

1 Like

On the device, Companion App Settings, Sensors. Scroll down to this.


These are the settings being discussed and need to be enabled.

I have an automation that when we leave a zone, turn on High accuracy mode. When I enter a zone, it turns it off. High accuracy mode does use more battery.

When my phone enters Home zone and is connected to Android Auto in my truck, it opens the garage door. The door actually starts opening when I hit the end of my driveway by the mailbox.

You could do something similar to shut off the alarm.

Also, when leaving Home zone, if number of persons at home is 0, set the alarm.

Just leave the key under the doormat. Anyone with a photo of her face could then unlock the door.

No triangulation will be accurate and consistent enough to trust with door locks.

There is no guarantee that the phone’s IP won’t change. You can’t use a static IP via the router because phones are now starting to randomize the MAC address. Maybe in the future there will be a way to detect the IMIE (International Mobile Equipment Identity).

Suggestion. This is not totally passive, but is almost foolproof. Put an RFID tag near the entrance. She would need to hold her phone within a cm or two near the tag. Maybe one for entry and one for exit. I haven’t much experience with them other than turning my light on/off jst by holding the phone over the tag.

Stevemann, thank you for the great feedback.

At the moment I don’t use doorlocks, don’t trust them enough. The trust is not someone without permission being able to open them, but rather the thing failing and not opening when it needs to like if power goes out, HA server goes down, etc. Still using regular keys.

My main goal is to find a reliable way for my system to know when someone in the household just walked up to the front porch and is ready to open the door either with a key, or the door just being unlocked already.

A bit more background, we do live in a relatively secure area. There is only one way to get into the circuit, and we have security guards at the main entrance. That is why we have gotten in the bad habbit of usually leaving the front door unlocked during the day.

The RFID tag sounds promising, but doesn’t it require NFC for it to work? Worst case scenario I could place an RF reader in the door, and get some RFID tags to put on keys or cell phone?

I’ve been using bt to do this for years now. Camera motion at front door initiates a scan, if the phone was marked away it opens the door.

I use monitor for bt scanning, mainly because it allows you to use a randomized mac. Most other bt solutions require setting the phone to constantly broadcast a static address.