# Setting up a HikVision terminal

> Step-by-step for connecting a DS-K1T-series face/fingerprint terminal to Timed so scans automatically clock employees.

Timed receives access-control events from HikVision terminals (the DS-K1T series and similar MinMoe face terminals) and turns each scan into a clock-in or clock-out automatically.

You'll need:

- A HikVision DS-K1T341 (or similar) terminal
- Network access to the device's web admin
- A Timed user with the **Manage company settings** permission

## Step 1 — Find the device serial number

On the device touchscreen or web admin: **Configuration → System → System Settings → Basic Information**, then copy the value labelled **Device Serial No.** (something like `DS-K1T341CMW20240101AAWR1234567`).

## Step 2 — Register the device in Timed

1. Sign in as a manager-owner.
2. Open **Integrations → HikVision** in the sidebar.
3. Click **Add Device** and fill in:
   - **Display Name** (e.g. "Front Door Terminal")
   - **Device Serial Number** from Step 1
   - **Location** the device is at (clock records will be tagged with it)
4. Click **Create Device**, then **Show setup** on the new row to reveal the **Webhook URL** and **Webhook Secret**.

## Step 3 — Configure HTTP Listening on the device

1. Open the device web admin (default IP `192.168.1.64`, login `admin`). Use Hikvision's free SADP Tool if you don't know the IP.
2. Go to **Configuration → Network → Advanced Settings → HTTP Listening**.
3. Set the **Destination URL** to the webhook URL from Timed.
4. (Recommended) If your firmware supports custom HTTP headers, add a header named `X-Webhook-Secret` with the secret from Timed.

## Step 4 — Enable attendance status reporting

So that scans report as Clock In / Clock Out instead of generic access events:

1. **Configuration → Access Control → Authentication Settings**
2. Enable **Display Attendance Status** (or **Attendance Mode**)
3. Set the mode to **Manual** — staff tap "Check In" or "Check Out" before scanning.

## Step 5 — Enrol users on the device

Each person who'll clock in via the device needs to be enrolled. On the device: **User → Add**. Set the **Employee ID** to the same value as the employee's **payroll number** in Timed. This is what links the scan to the right person.

## Step 6 — Verify

1. Back in Timed, on the HikVision Integration page, click **Test** next to the device.
2. Enter a payroll number you've enrolled, pick "Clock In", and **Send Test Event**. You should see a green confirmation.
3. Have a real user scan at the terminal — within a second or two, click **Events** on the device row to see the live event marked `processed`.

## Troubleshooting

| Issue | Fix |
|---|---|
| Device shows no response | Check the device has internet access and the URL is exactly right. |
| Test event shows "skipped — no employee found" | Payroll number on the device doesn't match what's in Timed (case- and zero-padding-sensitive). |
| Events arrive but no clock records appear | Attendance mode (Step 4) isn't enabled. The system falls back to auto-toggle in that case, which works but loses semantics. |
| Need to rotate the secret | Click **Regenerate** in Timed, then update the device admin. |