#Improve Unlock Front Door

1 messages · Page 1 of 1 (latest)

hard raven
#

I currently have a script that unlocks my front door, allowing me to use a widget in the iOS Control Center for quick access. However, I want to add an extra layer of security to prevent accidental presses.

Ideal Features:

  1. Home Zone – If the person triggering the unlock script and they are within the home zone, the door unlocks as usual. If they are outside the home zone, they receive a prompt: “Are you sure you want to unlock the door?” With an option “Yes” or “No”

  2. An extra bonus Geofence Restriction for example If the user is outside the country, the unlock action is blocked entirely.

This would provide an extra safeguard while still keeping the convenience of the widget. Has anyone implemented something similar, or have any other features ideas I should add?

What is best way to achieve this?

crystal flower
#

I don’t think the script can always know the location of the user. Maybe use an Apple Shortcut instead?

devout shadow
crystal flower
#

Yea, but that cannot be done in a definitive way. User ID won’t necessarily correlate to the device triggering the script. So, yea, it knows the user, but not the location.

I’d you assume that a user maps to a single device and that device has an accurate location, then you could resolve that.

If using a voice assistant, the device itself is identified, but not with the app.

You know, maybe I was being too pedantic with my description. I think you could probably do what you’re looking for with trackers associated with a person/user, and then use the ID like @devout shadow suggested. Probably all you need.

devout shadow
#

i do something like this by using a command line sensor to pull, from the person file in .storage, devices associated with the mobile app integration, and then when i set them up just named them it consistently between the notify device and the device tracker, then i can use a simple template to send a notify action based on the associate device tracker

#

but i also wouldnt recommend messing with this file unless you understand that there's sensitive info in the .storage folder

#

that said, it has everything youd need to make this happen if you wanted to get that deep into it, and ive already done it myself 😅

winter root
#

You can also directly associate notify actions with people using customize

https://community.home-assistant.io/t/notify-person/159876/24?u=mekaneck

winter root
#

You can associate them with device trackers using the same technique

crystal flower
#

Hmm. That’s interesting. A Person record can already be associated with a tracker. I’m pretty sure it’s accessible from the attributes. From there you can get the device from the entity, then loop through entities on that device and filter for a notify entity.

devout shadow
#

yeah this way looks way easier to set up but less dynamic as a result

winter root
crystal flower
#

Yea. Maybe not. Notify actions are kind of a pain for things like that. I was trying to blueprint a notification, but it’s more or less pointless because I can’t make the device a variable since it’s the actual action name.

devout shadow
#

afaik the only place a person is inherently associated with their tracker is in .storage/people, nothing is available elsewhere. as far as associating a device tracker with a notify action it's fairly trivial assuming you use consistent naming schemes, though certainly susceptible to breaking changes