I want to install an electronic lock on my office/workshop that only a specific individual(s) can unlock. I want it to lock every time the door is closed and the room is empty but I do not want to have to use a key or pin code every time I open it.

So I am thinking of designing a system that detects close proximity to the door for authorized users, and unlocks it. Allowing authorized users to walk up and open the door. The system would also need to know when an authorized user was actually in the room, and keep the door unlocked until they leave. This should be manageable with motion sensors and computer terminal usage (registering that someone is using the computer equals someone is in the room).

What kind of solution would be necessary to accomplish this?

  • I presume that an authorized individual is one who has a specific hardware token in their pocket (as opposed to e.g. facial recognition)? You'll be more on the beaten track if you hold that token to a reader near the door. A fingerprint reader would be another common possibility (with different security compromises). Does the door have to be locked against an unauthorized user wanting to leave the room? Commented Nov 9, 2014 at 9:41

4 Answers 4


I never implemented something like this but I did implement something similar with other uses. I also asked a question here for automating parts of the home based on user that entered. It can be implemented using OpenHab with the NetworkHealth binding : https://github.com/openhab/openhab/wiki/Network-Health-Binding.

There is no need to issue different hardware tokens for each users but rather have them always keep their mobile phone's WiFi on. You must know the IP their phone has in the network so as to store them in OpenHab like this:

Switch Phone_WIFI   "Phone 1"   (Status, Network)   { nh="" }
Switch Phone2_WIFI   "Phone 2"   (Status, Network)   { nh="" }

More details for OpenHAB: the binding will check the connection status of a given device with it's IP Address, then you can use a rule such as :

rule "Allowed user home - Unlock Door"
    Item Phone_WIFI received update ON
    // turn on all lights
    postUpdate(Door_lock, OFF)


and a similar code for when they leave the proximity range for

Item Phone_WIFI received update OFF

I have not tested the received update OFF code as of yet and not 100% sure it works. Also be aware as proximity and range is an issue because with several different methods (bluetooth or WiFi) the range might be longer or shorter than what you desire so router placement or bluetooth device must be very correctly placed so as the door does not unlock while you are still entering the driveway (unless that is not a problem for you).

  • 1
    Likely not solving the inside/outside dillema, but seen that answer elsewhere ;)
    – Romain BOURDY
    Commented Nov 10, 2014 at 19:22
  • :) Well it is thanks to you. I could not link my question because it's a different matter but it also applies here so from that I derived this :D
    – John Demetriou
    Commented Nov 11, 2014 at 7:36
  • I think I might have some use for this on other applications, thanks :D
    – hebron
    Commented Nov 11, 2014 at 9:12
  • WiFi might be problematic in this case, as the range is greater than what the OP seems to be looking for. I would also suggest that IP address is problematic for security applications, because anyone can set their device to the one needed to unlock the door. If the application is to keep the kids out of the office, it may be fine; I would not use it (for example) on the front door.
    – TomG
    Commented Nov 15, 2014 at 15:15

A Bluetooth solution (where the smartphone acts as the key) may be the way to go for you.

You can check out this page, which has a lot of options, although I must make a disclaimer that I have never done this type of thing.


I do not have any experience with proximity sensors but there are quite a few options available, and I am sure you will get better responses in that regard here from forum members.

Once you find a sensor that will work for you, the Fibaro RGBW Controller can accept analog proximity sensors that when triggered would send a Z-Wave signal to a Z-Wave controller thus opening/closing the a door lock and/or deadbolt. You would require a Primary Z-Wave controller to do this, as well as a Z-Wave Doorlock or Deadbolt.

Hope that helps!


Just found this Kwikset IoT lock. Differentiate inside/outside. * Touch to lock/open * Bluetooth phone or hardware token * Guest key possible.


  • These look cool, but the user reviews are not great.
    – hebron
    Commented Nov 11, 2014 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.