
Z-Wave lock to help a small office or home
- Tutorial

If you own a small office for 10-15 people, then you would like to know when your employees are coming, if the cleaning lady came in the evening. It would not be superfluous to lock the castle so that none of Poseidon's witnesses accidentally make their way, as well as issue temporary codes for visitors.
There are many professional ACS, where you can use the card to open the door, but in this case, you need to insert a special mechanism into the door, supply wires, and install the reader in the wall. It is not very cheap and sometimes it is impossible to install such a system, for example, if the tenant does not allow making changes in the decoration or in a building of historical value.
Z-Wave smart home devices come to the rescue!
Access Control Devices
- Battery- operated Vision lock , installed in place of an existing door lock. The lock always reports a change in its state, no matter how you open it: a radio command, code or key.
Vision Lock Features:- The ability to open the Z-Wave command (AES128 encryption), using the code panel and a regular key
- If you open it with a key or a latch, it informs the controller about its “open / closed” status
- Informs the controller on the code number with which the door was opened
- Keeps an event log. If you entered the code incorrectly, you will know about it
- 13 codes
- 4xAA battery operation up to a year (depending on how often the lock is used)
Complete with the Z-Wave RaZberry controller and opening sensor, it is possible to use the functions of Auto-Closing, Remote Control, Event Logging and many others. - The battery-powered Fibaro Door / Window Sensor detects whether the door is open or closed. The sensor consists of two halves: a reed switch and a magnet, which are glued to double-sided tape on the door and the door jamb. Each time the two halves are disconnected / connected, the sensor sends a message to the controller. With its help, it is possible to implement the AutoClose script or to turn on an indication of an unclosed door.
Features of the Fibaro Door / Window Sensor opening sensor:- Reed switch and magnet
- Informs the controller if the door is open or closed.
- DS18B20 temperature sensor connection possible
- It reports to the controller if the sensor is peeled off (there is a tamper switch on the back side)
- 1 / 2AA battery operation up to two years
- The RaZberry smart home controller with a 5th generation Z-Wave board is the brain of the entire system, supports working with all Z-Wave devices in the world (more than 1300), allows you to write automation on JS, and in our case it controls the lock using applications that are configured in 3 clicks.
Characteristics of the RaZberry controller:- The power of the Raspberry Pi B +
- Support ALL ALL Z-Wave devices in the world
- Automation is created using embedded applications.
- Ability to write unique automation in JS
Access Control Features
We will assign the following functions to our access control system:
- Know which employee arrived at what time
- Auto Lock
- Automatically issue a temporary code to a cleaning lady for a short time
- Open the lock remotely from the phone or key fob
- Indication of not closed door
So, after we installed the lock and the opening sensor, added them to the Z-Wave network, it remains only to use a couple of applications to configure access control.

Type of devices in RaZberry’s Web interface
" Lock automatic closing " - in its settings we select the lock and the opening sensor. If the door is open, the lock will not close; if you have closed and quickly opened, the lock will not close. The lock will be closed only after the door is closed and the delay time specified in the application has passed.

" Castle Magazine“- during each operation with the lock, an event will be logged, for example:“ Vasya opened the door with the code ”,“ The lock is opened with the key ”,“ The code is entered incorrectly ”, etc. In the settings, specify the lock, add employees (set the code the employee can be from ExpertUI), we specify how to save events - JSON (local file) or HTTP (the event can be sent to a remote server in the database). The log is read from the local JSON file.


The log design will be improved and filters and other buns will be added. The Castle Magazine application will soon be It is available in the list " Online Application "
" Temporary code for cleaners"- we’ll do it ourselves with the help of the schedule and the JS command. First we need to create two scenes of the“ JS device "with the launch of the commands to set the lock code and remove the lock code.
The command to set the code 5555 in cell 12, where 2 is the number of the lock on the Z- network Wave
zway.devices[2].UserCode.Set(12,"5555",1)
The command to remove the code 5555 from cell 12, where 2 is the number of the lock in the Z-Wave network.
zway.devices[2].UserCode.Set(12,"5555",0)

In the schedule we set the day of the week and the time when the scene with the command to set the lock code should be executed.
Every day at 00:00 a code for a cleaning lady is activated. The withdrawal schedule is done similarly.

You can develop a topic with a schedule further and, for example, reset all codes at night to prevent access to the office at night.
Also in the office you can place an LED sign with the inscription “Close the door”, which is connected to the outlet module and turn it on if the door is open for more than 10 seconds.
You can issue a keychain to your secretary and then she will not have to get up to open the door.
If you have your own unique automation tasks, then you can easily solve them with the help of Z-Wave equipment. And since the RaZberry controller supports integration with other IoT devices via HTTP commands, you can use various WiFi smart devices together with Z-Wave!
Recommended retail prices for devices used in the article:
- The lock with the Vision Security handle - 22 220 rubles.
- Fibaro Opening Sensor - 5440 rub.
- Z-Wave RaZberry controller - 13090 rub.
The lock and motion sensor can easily be replaced with other models, for example, there is a version of the lock without a handle , and the opening sensor can be used hidden from Aeon .