Biometric Devices
Biometric Devices manages the fingerprint, card and face devices that record attendance without anyone touching the top-bar button. This page was written from the code of the biometric app and the live device list. Nothing was saved, tested, fetched or changed.

The Biometric Devices page, one card per device.
Attendance → Biometric Devices manages the fingerprint, card and face devices that record attendance without anyone touching the navbar button. It sits second in the sidebar, right after Dashboard, and appears only when all three of these are true:
- the optional
biometricapp is installed, - Activate Biometric Attendance is switched on in Attendance Rules for the company, and
- you hold
biometric.view_biometricdevices.
With the switch off, every biometric address redirects with "Please activate the biometric attendance feature in the settings menu."
Horilla only pulls from devices. It reads their punches by a manual Fetch Logs, on a schedule, or by live capture. There is no push or webhook address for a device to call.
The page
The page is card view only. Each card shows the device Name, its Device Type, and for ZKTeco and COSEC the Machine IP and Port No. Anviz shows its API Url. The page opens on Active: True, so archived devices are hidden. A coloured stripe and legend mark Not-Connected (red), Scheduled (blue) and Live Capture (orange). Despite its name, red does not mean the connection failed. It means the device is not in live capture, and clicking the legend filters nothing.
- Search looks at the device name. Filter offers Device Type, Active, Is Scheduled and Is Live, plus an add-filter builder (Name, Machine IP, Port No, Last Fetch Date, Created At).
- On each card: Test, Schedule (or Unschedule), Employee (ZKTeco and COSEC), and a Activate live capture mode switch (ZKTeco and COSEC). A checkbox selects the card for the bulk Actions → Fetch Logs.
- The card's three-dot menu has Edit, Fetch Logs, Archive (or Un-Archive) and Delete. Delete is permanent and also removes the device's employee mappings.
- Create (needs
biometric.add_biometricdevices) adds a device.

The card's three-dot menu.
Adding a device

The form after choosing a device type. Its title reads "Edit Biometric Devices" even when adding.
The form always asks for Name, Device Type and Device Direction. The other fields appear once a type is chosen:
| Device Type | Fields | Required |
|---|---|---|
| ZKTeco / eSSL Biometric | Machine Ip, Port No, Password | all three. The password must be a whole number (default 0). |
| Matrix COSEC Biometric | Machine Ip, Port No, Username, Password | all four |
| Dahua Biometric | Machine Ip, Port No, Username, Password | all four |
| Anviz Biometric | Request ID, API Url, API Key, API Secret | all four. Saving contacts the Anviz service to sign in, and fails with "Authentication failed. Please check your API Url , API Key and API Secret." if it cannot. |
| e-Time Office | API Url (filled in with the standard address), Username, Password | nothing is enforced |
Device Direction is In Device, Out Device, Alternate In/Out Device or System Direction(In/Out) Device (the default). Editing a device needs biometric.add_biometricdevices, not only the change permission. Passwords and API secrets are stored as plain text.
Test, Fetch Logs, Schedule and live capture
Each result appears as a pop-up message.
- Test checks the connection ("ZKTeco test connection successful.", or "Double-check the provided IP, Port, and Password."). On a ZKTeco or COSEC device, a successful test also maps employees automatically. Every active employee whose Badge ID equals a user ID already on the device gets a mapping. This is the only automatic mapping.
- Fetch Logs pulls the device's punches now and reports "Biometric attendance logs fetched successfully. Total records: n". The bulk Actions → Fetch Logs on ticked cards works for ZKTeco / eSSL only, and says so for other types.
- Schedule opens Schedule Biometric Device.. with an Interval Duration (HH:MM, not 00:00) and Save. The card then shows as Scheduled, and Unschedule (with a confirmation) stops it. A single job checks every device once a minute, and fetches the ones whose interval has passed, so the real shortest interval is about one minute.
- Activate live capture mode (ZKTeco and COSEC, needs
biometric.change_biometricdevices) streams punches as they happen. It turns scheduling off, and scheduling turns it off. The listener lives in the web server's process. A restart stops it while the switch still shows on.

Scheduling a device.
Employees on a device
A device only records punches for people it knows. Employee on a card opens that device's Employees page (it needs biometric.view_biometricemployees), which maps people in Horilla to users on the device.
- ZKTeco and COSEC pages read the device live. If it cannot be reached, you are sent back to the device list with "Failed to establish a connection. Please verify the accuracy of the IP Address , Port No. and Password of the device." Add opens Add Employee, where you pick employees and Horilla creates the user on the physical device. On ZKTeco the device user ID starts at 1000. On COSEC the user ID is the employee's Badge ID, and someone without a usable badge fails with no message. Delete removes the user from the device as well as the mapping. COSEC users can also be edited (name, active, VIP, validity end date, by-pass biometric) and given face recognition.
- Dahua and e-Time Office pages only hold mappings. Add (Dahua) creates a card user on the device with a Card Number, User ID, Card Status, Card Type, Password and valid dates. Map Employee links an employee to a user that already exists on the device, by User ID (Dahua) or Emp Code (e-Time Office). Delete removes only the mapping in Horilla.
- Anviz needs no mapping. Horilla matches the Badge ID to the Anviz employee number.

A Dahua device's Employees page.
How punches become attendance
Every punch goes through the same check-in and check-out as the navbar button. Shift and night-shift rules, overtime, validation, late and early flags, and the day's records all apply, and the IP restriction is skipped. The punch time comes from the device. Unmapped users are ignored without a message.
- ZKTeco / eSSL: keeps only punches newer than the device's last fetch. In Device and Out Device force every punch's direction. System and Alternate use the device's own punch type, so Alternate does not actually alternate.
- Anviz: honours all four directions, and Alternate checks in when the employee has no open check-in today, otherwise checks out.
- Matrix COSEC: the device's event code decides in or out. Device Direction is ignored.
- Dahua and e-Time Office: a punch is a check-out whenever the employee has an open check-in, otherwise a check-in. Device Direction is ignored. A forgotten check-out therefore turns the next day's first punch into a check-out.
Things worth knowing:
- Last-fetch markers are saved before the punches are processed, so a punch that fails to process is not tried again.
- The red Not-Connected marker means "not in live capture". It says nothing about whether the device answers.
- Two COSEC devices that use the same reference IDs can collide, because COSEC punches are matched without the device.
