ZKTeco PUSH (ADMS) packages
The zk-push packages connect time clocks that speak ZKTeco’s PUSH protocol. The protocol is also called ADMS, and many OEM brands use it. This page is the reference for running them. It covers which package fits your clocks, the endpoint options, what the clocks report, and what each action does on a ZK clock.
The clock polls the gateway over plain HTTP (/iclock/getrequest, /iclock/cdata, /iclock/devicecmd). It uploads punches, users and logs as tab-separated text. It runs the text commands it is handed. ZK’s access-control PUSH (rtlog, rtstate) and the standalone SDK on port 4370 are different protocols. These packages do not speak them.
Hour Advantage is not affiliated with or endorsed by ZKTeco.
Versions
Section titled “Versions”| Package | Version | For clocks reporting |
|---|---|---|
[email protected] | 2.0.3 | pushver 2.0.x (flat-file firmware) |
[email protected] | 2.4.1 | pushver 2.4.x |
[email protected] | 3.4.0 | pushver 3.x |
Pick the package for the pushver your clocks report. A clock reports it on its first request. The device’s info.push_version shows it once the clock has called in. An endpoint that names zk-push@2 gets the newest 2.x line, which is 2.4, not 2.0. Name [email protected] for 2.0 clocks.
Every version declares host_api = 2 and delivery = "ack". A clock’s upload is acknowledged only after its events are stored. If they cannot be stored, the clock sends it again. How long a clock takes to answer decides nothing.
The commands that write (users, schedules, lists, options) are answered in order. The package says what that means, in M.missed (zk.lua): an answer to one says the writes handed out before it with no answer were missed. A missed write is handed out once more (resend = "writes"). If it is missed again, it is reported unanswered.
A clock that asks for its options with no CHECK in its hand has restarted, and what it held is missed (M.missed, asked of the request: [commands] missed_on = ["options"]). An unanswered REBOOT is not missed, because the restart is its answer.
Connecting a clock
Section titled “Connecting a clock”- Create an HTTP endpoint for the package. Give it its path (for example
/office) and the requiredtimezoneoption (quick start). - On the clock, set the Comm / Cloud Server address to the gateway’s host and port, with the endpoint’s path. The clock adds
/iclock/...after it. A clock that takes no path needs an endpoint with no path, alone on a listener of its own (networking). - The clock identifies itself by the
SNquery parameter. That serial is the device id.
Any load balancing works, round-robin included. Hashing on the SN query parameter keeps one clock’s traffic on one instance. That makes it easier to follow in the logs, but nothing depends on it.
Endpoint options
Section titled “Endpoint options”| Option | Type | Default | |
|---|---|---|---|
timezone | timezone | required | The clocks’ zone. Give a name such as America/Chicago (with its daylight-saving rule) or a fixed offset such as -05:00 (no daylight saving). Clocks record wall-clock time with no offset. The clock is set to this zone, and every punch is placed in it. |
punch_state | boolean | true | false: the state of a punch is not read. Use it for clocks with no in and out keys. They send the same state (0, an in) for every punch. The punch then has no direction. A policy’s direction step gives it one. |
upload_users | boolean | true | false: the clocks do not upload user records. |
upload_biometrics | boolean | true | false: the clocks do not upload fingerprint, face and palm templates. Takes effect only when the endpoint has biometrics = true. Without it the clocks are never asked for templates. |
upload_photos | boolean | true | false: the clocks do not upload attendance photos. Takes effect only with biometrics = true, as above. |
upload_operlog | boolean | true | false: no operation-log uploads. The operation log stays on while upload_users is on, because user changes travel in it. |
delay | number | 15 | Heartbeat interval, in seconds. |
error_delay | number | 60 | Retry interval after a failed upload, in seconds. |
sync_time | number | 600 on 2.0, 3600 on 2.4 and 3.4 | Clock time-sync interval, in seconds. |
max_command_bytes | number | 40960 | Most command text in one heartbeat reply. |
The gateway’s own endpoint options (biometrics, drop_events) apply as well (reference).
Time and daylight saving
Section titled “Time and daylight saving”| Version | TimeZone the clock is given | Daylight saving |
|---|---|---|
| 2.0 | The zone’s standard offset | The clock’s own rule is switched off (DaylightSavingTimeOn=0) each time it asks for its options. Each time sync is answered with the zone’s wall-clock time, labelled with the standard offset. So the clock follows a change at its next sync. |
| 2.4 | The zone’s standard offset | The zone’s rule is sent as options (DaylightSavingTimeOn, DLSTMode=1, WeekOfMonth1 to WeekOfMonth10) each time the clock asks for its options. It is sent again at a time sync when the rule for the current year differs from what was sent. A zone without daylight saving sends DaylightSavingTimeOn=0. Each time sync is answered with the zone’s wall-clock time and the offset in force when the clock asks. |
| 3.4 | The zone’s offset at the time the clock asks | None is sent. Each time sync is answered with the current wall-clock time and offset. |
A fixed offset as timezone means no daylight saving on any version.
A clock that keeps standard time
Section titled “A clock that keeps standard time”On 2.0, the gateway switches the clock’s own daylight-saving rule off and sets the clock by each time sync. On 2.4, it sends the rule. On both, a clock that ignores this and keeps standard time through daylight saving is an hour behind.
Its punches are stored as the clock reported them, an hour before they arrived. Connect tells it as a clock behind once the punches have been an hour late for more than an hour. You see three things:
clock_behindin the device’sinfo.- A
device.clock_behindevent withdaylight_saving_hourtrue. clock_behind_secondson the punches that follow.
Look at the clock’s time and its daylight-saving setting. Once they are right, the clock follows the gateway’s time sync.
One zone per endpoint
Section titled “One zone per endpoint”timezone belongs to the endpoint, not to the clock. Every clock on an endpoint is set to that zone, and every punch from it is placed in it. Clocks in different zones need separate endpoints, one for each zone. A clock moved to another endpoint takes that endpoint’s zone.
A clock put on the wrong endpoint, or on an endpoint with the wrong zone, sends punches whose instants are off by the difference between the zones. Connect keeps what it was sent. The punches already sent are not rewritten, and their ids stay.
Correct them in Attend. A supervisor’s correction is a new fact over the punch. The original stays (see the ledger). The timecards rework from the earliest instant it affects. Once the endpoint or its timezone is right, new punches arrive in the right zone.
Device keys
Section titled “Device keys”A clock given a key (hourctl device key <endpoint> <device> <key>) is sent SET OPTION PushComKey=<key> and SET OPTION IsPushComKey=1. It then adds ComKey= to every request. A key is letters and digits only, because the clock sends it in the query string unencoded. Clearing the key sends IsPushComKey=0. Until the clock presents a new key, the gateway accepts it as before.
The key switch, and the daylight-saving options of 2.0 and 2.4, go through the internal command set_gateway_option. It takes only the options the package manages itself. It writes no sync domain.
A clock sent its punches again
Section titled “A clock sent its punches again”A clock keeps its records until it gets OK, and sends them again if the reply did not reach it. The batch it sends again may hold the same records and newer ones, in a batch cut elsewhere. The package keeps a short digest of the last 500 punch lines of each clock in the device’s store (attlog_kept), and a line it has kept is not emitted again. Nothing is stored or queued for a batch with nothing new, and the clock is told OK all the same, so it goes on. The punch goes to the sinks once. A line is its own key: the same person, time, state and verify mode are the same record. A line whose time cannot be read is passed on once as unparsed, too. The number 500 is a margin and has not been checked against a real clock. A record sent again after 500 others have been kept is emitted again, with the same id, as it was before this. The id is made from the line, so a consumer that deduplicates on it still does, and Time and Attendance keeps a punch once by it. Dropping a repeat is this package’s choice: see a message sent again.
The stamp, and a clock set ahead
Section titled “The stamp, and a clock set ahead”A ZK clock keeps its place in each table it uploads by a stamp, a date and time. It sends only the rows after it. Hour Advantage keeps the stamp each upload tells it (the device’s stamps store key). It hands the stamp back in the clock’s options (ATTLOGStamp=, and the same for the operation log and the photos).
A clock asks for its options when it starts, and again when it is sent CHECK. It reads a stamp as a date. A row dated at or before it is one the server has, and is not sent.
A clock whose time is set ahead dates its rows ahead, so its stamp is a time that has not come. Handed back unchanged, it would keep back every real row until the clock’s own time reached it. That could be hours later, if the clock had been set hours ahead and is right now. Nothing would show it: the clock looks well and sends nothing.
So a stamp more than 5 minutes ahead of the present is not handed back. The clock-ahead status uses the same 5 minutes as its tolerance. The clock is made to ask:
- An upload whose stamp is ahead marks the table.
- At the clock’s next time sync (every
sync_timeseconds: 600 on 2.0, 3600 on 2.4 and 3.4), aCHECKcommand is queued, once. It is queued in the answer that sets the clock’s time. NoCHECKgoes while no time sync has come. None goes for a stamp the clock has been taken back from already. - The clock asks for its options. It is handed the latest stamp of that table that was not ahead, or none if there was none. That stamp is kept as the stamp.
- The clock sends again every row after that position. This includes the rows it sent dated ahead and the real rows it held back. A row sent again is the same event as the first time and is stored once. So nothing is lost and nothing is stored twice.
Each table goes by its own stamp. One whose stamp was not ahead keeps it. A table whose every upload was dated ahead has no earlier position to go back to, and is handed none. So the clock sends that table from the start. For the operation log, that is the clock’s users and log again, with repeats stored once.
So a clock that is put right, by its time sync or by hand, re-sends what it held back within one time sync after its time is right. One time sync is 10 minutes on 2.0 and an hour on 2.4 and 3.4, unless sync_time says otherwise. A clock that is still ahead at its time sync has its time set by the sync like any other.
What you see:
- When a punch from the future first arrives, the device’s
infocarriesclock_ahead. Onedevice.clock_aheadevent is told, as for any clock set ahead. - When the clock asks for its options after the
CHECK, onedevice.logevent of kindstamp_rewoundis told. One line is logged (“the clock’s ATTLOG position … is ahead of the present”).vendor.zknames the table, the stamp the clock had (from) and the one it was given (to,0000-00-00T00:00:00for none). If you see it, rows are about to arrive again. They are repeats, and the real punches the clock held back come with them. A clock restarted asks for its options at once, and is handed the same. - The
clock_aheadstatus clears with the first message of punches none of which is ahead. That is not the message that re-sends the rows dated ahead. So the next punch made at the right time clears it. A ZK clock tells its time only through the rows it sends. Its heartbeat and its time request carry none.
Punches made while the clock was ahead keep the time the clock gave them. They are marked clock_ahead and kept out of the punch state. They are corrected like any wrong punch (a supervisor’s correction in Attend).
How a clock is drained
Section titled “How a clock is drained”A ZK clock that is handed commands runs every one of them in order, even after one fails. It posts the results (/iclock/devicecmd) and at once asks for more (/iclock/getrequest). It does this until a reply hands it nothing (OK). Only then does it go back to waiting delay seconds. A backlog therefore goes at the speed of the clock and the gateway, not of the poll interval:
- Time. Draining takes about (number of batches) x (the clock’s time to run a batch + the gateway’s turnaround). The poll interval is waited once, before the first batch.
- Batch size. One reply carries at most
max_command_bytesof command text (each line isC:<id>:<command>) and at most 200 commands. These are the protocol’s limits for one heartbeat reply. The gateway offers the package every command waiting, and this package takes what fits. Nothing follows aREBOOTin its reply. A user record is about 100 bytes, so 200 users fit in one reply. A fingerprint template is 1-2 KB and a face template more. So a reply carries templates for only a few people. - Commands that cannot be sent. A command larger than
max_command_bytesfails with code -1006. One that contains a line break fails with code -1. Neither blocks the queue behind it. - No early stop. While a sync group still has work for the clock, the clock is not told there is nothing left, whichever instance answers it.
- Order. Commands go out by priority, oldest first within a priority. So an operator’s command is not stuck behind a large fill. A command queued while a clock is being drained goes in the next reply. But the clock asks for that reply only after it has run the batch it holds. A smaller
max_command_bytesshortens that wait and slows every large fill. - Asked again later. A step answered with
queue.retry(such as the gate ofreboot_and_wait) goes again at the clock’s first request after itsretry_inhas passed. A clock that is back at itsdelaygets it at its next poll. That is up to 15 s later when it was asked for 10 s and thedelayis 15.
Routes
Section titled “Routes”| Route | Request | 2.0 | 2.4 | 3.4 |
|---|---|---|---|---|
heartbeat | GET /getrequest: hands out queued commands (may carry the INFO summary) | yes | yes | yes |
command_result | POST /devicecmd: results of commands | yes | yes | yes |
options | GET /cdata?options=all: the clock’s start-up request. It is answered with its upload settings and positions | yes | yes | yes |
time_sync | GET /cdata?type=time | yes | yes | yes |
last_punch | GET /cdata?type=LastPunch | - | - | yes |
info_report | GET /cdata?INFO=...: the device summary | yes | - | yes |
capabilities | the clock’s capability list: POST /cdata without table (2.0, 3.4), POST /cdata?table=options (2.4) | yes | yes | yes |
upload_attlog, upload_attphoto, upload_operlog | POST /cdata?table=ATTLOG, ATTPHOTO, OPERLOG | yes | yes | yes |
upload_userinfo, upload_fingertmp, upload_facetmp, upload_userpic | user rows, fingerprint and face (algorithm 7) templates, user photos | yes | - | yes |
upload_biodata, upload_userextinfo | face (algorithm 12) and palm templates, and per-user verification settings | - | yes | yes |
upload_biotemplate, upload_reg_bio_ext_info | BIODATA rows under their older table name, and biometric consent answers | - | - | yes |
upload_workcode, upload_errorlog, upload_idcard | work codes, errors about commands, and identity cards read at the clock | - | yes | - |
Paths are relative to the endpoint’s path. A request that no route matches gets a 404 and is logged.
Events: what vendor.zk holds
Section titled “Events: what vendor.zk holds”| Event | vendor.zk |
|---|---|
punch | state and verify (the clock’s codes; state_name and verify_name are the neutral words). work_code (as sent; when it is empty or 0 the neutral work_code is absent). timezone (the zone the time was placed in). 2.4 and 3.4 add flags and temperature as sent. 3.4 adds record_flags, job_codes (six, as text) and tip_codes (three numbers). record_flags holds saved_abnormally, temperature_abnormal, no_mask and attestation_yes, when flags is four 0/1 digits. |
user | privilege (0 user, 2 enroller, 14 admin). On 3.4, 1 is an ordinary user who may not punch and is reported enabled = false. timezones (the user’s lockout schedules as the clock wrote them) and verify_mode. The card is in cards, and the access group in groups. has_password says whether a password is set. The password itself is never forwarded. A 2.0 name is cut at the first control character, to 24 characters, and before any invalid UTF-8. |
biometric | For BIODATA rows (2.4 and 3.4 faces of algorithm 12, palms): type, hand (palms), algorithm (major.minor), encoding (zk, iso, ansi or unknown). For 2.4 finger vein rows: part. |
biometric.photo | type (2.4). |
biometric.attestation | finger_result (1 given, 2 refused, 3 unanswered) and verify_time as the clock wrote it (3.4). |
device.log | code (the operation) and objects (its four operands). A deleted user (code 9) also gives a user.deleted event. Deleted fingerprints (code 10) also give a biometric.deleted event. The exception is a delete from before the clock first reached the gateway. A clock uploads its whole log on first contact, and those old deletes are not sent as new ones. Their device.log rows still are. |
device.error | origin and detail (2.4 ERRORLOG rows). |
The neutral format of a biometric event is the tag set_biometric takes back. It is one of these:
zk:fingerprint:<version>(the clock’s reported fingerprint algorithm)zk:face:7zk:face:12zk:palm:<version>zk:palm(3.4 PALM rows)zk:finger_vein
unparsed events carry the upload table in context.table. A row that names no user, or that the package does not know, is emitted as unparsed. user.extended, id_card, work_code and device.options are emitted only by these packages.
Of their events, device.log, device.error, device.options, work_code, biometric, biometric.deleted, biometric.photo, user.photo, user.extended, photo and id_card go only to a sink that names them in events (the default set).
verify_name uses user_id for what ZK calls PIN verification: the user keys in their id. A ZK “PIN” is the user id, not a secret code.
Flags such as a template’s valid and enroll_biometric’s overwrite are true / false in actions. They go to the clock as 1 / 0. A 2.4 fingerprint’s valid also takes 3, a duress finger.
Standard actions
Section titled “Standard actions”What each package does for each standard action. The x_ parameters are the package’s own:
x_verify_modeis the clock’s verify mode for the user.x_schedulesis up to three lockout schedules, 1 to 50.- Both are on
upsert_userandchange_user_id. x_hand(leftorright, defaultleft) is onset_biometricfor palms.
| Action | 2.0 | 2.4 | 3.4 |
|---|---|---|---|
upsert_user | add_user with every field. The clock replaces the whole user. | The same. The verify mode is sent as -1 (the group’s) unless x_verify_mode is given. | The same. enabled = false is privilege 1 (ordinary users only). |
set_cards | Not offered. A card alone would clear the rest of the user. Use upsert_user. | add_user with the card alone. The verify mode is sent as for upsert_user. | add_user with the card alone |
delete_user | delete_user. Fingerprints and photo go with it. The name, card and password stay in the clock’s memory until the slot is reused. | delete_user (templates and photo go with it) | delete_user, delete_user_photo, delete_bio_attestation |
change_user_id | info, add_user with the given templates and photo under the new id, check_user, delete_user, check_user_gone | query_attendance_log from punches_since (default one day ago) to now, add_user with the given templates and photo under the new id, query_user, delete_user, query_user | As 2.4, with the 3.4 deletes |
set_biometric | Fingerprints. Faces of algorithm 7. | Fingerprints. Faces of algorithm 12 and palms, one part per call (index is the part). | Fingerprints. Faces of algorithm 7 (by index) or 12 (one piece, index 0). Palms. |
delete_biometrics | Fingerprints (one or all). The face, where the clock reports a face algorithm. | Fingerprints, face, palm, or all | Fingerprints, both face algorithms, palm, or all |
enroll_biometric | - | fingerprints | fingerprints |
set_user_photo, delete_user_photo | yes | yes | yes |
query_users | one user (user_id required) | one or all | one or all |
query_punches | - | from and to required | from and to required |
clear_punches | all | all, or up to until | all |
clear_users, reboot, get_info, open_door, set_work_code, delete_work_code | yes | yes | yes |
show_message | set_message, and assign_message for one user | the same | the same |
set_schedule, delete_schedule | TIMEZONE 1 to 50, one interval a day. A day without one is 00:00-00:00. | the same | The same. Deleting one makes it 00:00-23:59. |
set_access_group, delete_access_group | - | AccGroup 1 to 99 (Verify=0, one door) | - |
set_holiday, delete_holiday | - | AccHoliday | - |
set_list_item, delete_list_item | work codes | work codes, messages | work codes, messages |
set_settings | one SET OPTION per value, through the internal command set_option | the same | the same |
wipe | see below | see below | see below |
sync_time | - | - | - |
sync_time is not offered. A ZK clock asks for the time itself, every sync_time seconds and when it starts. It has no command to set it.
wipe sends one clear command per kind of data. It never sends CLEAR DATA and never sets an option. So the clock keeps its network and Comm / Cloud Server settings and calls in again as an empty member.
| Version | Steps | What stays |
|---|---|---|
| 2.0 | clear_all_users, delete_all_fingerprints, clear_attendance_log, clear_photos, delete_all_schedules, delete_all_work_codes | messages (no command deletes one) |
| 2.4 | as 2.0, then delete_all_messages, delete_all_tip_codes | access groups, holidays, unlock combinations and job codes (deleted one at a time only) |
| 3.4 | clear_all_users, delete_all_fingerprints, delete_all_faces, delete_all_bio_attestations, clear_attendance_log, clear_photos, delete_all_schedules, delete_all_work_codes, delete_all_messages, delete_all_tip_codes | user photos that CLEAR ALL USERINFO leaves, access groups and job codes |
TFT 30 series clocks take delete_all_users (3.4) in place of clear_all_users.
Changing a user id
Section titled “Changing a user id”A ZK user cannot be renamed, so change_user_id replaces the user. It does these steps:
- It first makes sure of the old id’s punches. 2.4 and 3.4 upload the range again. 2.0 confirms the clock is online with
info. - It adds the user under the new id with everything given.
- It checks the new user.
- It deletes the old id.
- It checks that the old id is gone.
The clocks cannot give everything back. 2.0 cannot return fingerprints, and none returns passwords. The action is refused when the clock may hold templates and none are given in biometrics, unless allow_reenroll = true. Punches already on the clock stay under the old id and are uploaded under it. Keep the old id’s mapping until they are in.
The steps go out in one batch, and the clock runs every command it is handed. If adding the new user (or its check) fails, the old id is still deleted. The new user is built from the request alone (the record, the templates in biometrics, the photo in jpeg_base64). So sending the action again completes the change. Until it is sent again, the person is on the clock under neither id.
A sync group’s id change does not have this gap. It deletes the old id in a later batch, once the new user is in and checked.
On 2.0, check_user succeeds only when the clock uploads the user, and check_user_gone only when it does not. On 2.4 and 3.4 a DATA QUERY answers 0 either way. The user event the clock uploads, or its absence, is the check.
The package’s own actions
Section titled “The package’s own actions”Each of these makes a change and then checks it on the clock with a gate (gates). A gate that does not pass fails the action and holds the clock. Nothing more is handed to it until it is released (hourctl device release <endpoint> <device>). The gate’s command.result says what was found.
| Action | Steps | Writes | 2.0 | 2.4 | 3.4 |
|---|---|---|---|---|---|
add_user_verified | add_user_checked, then the gate verify_user (DATA QUERY USERINFO PIN=) | people | - | yes | yes |
set_option_verified | set_option_checked (SET OPTION), then the gate check_option (INFO) | settings | yes | yes | yes |
reboot_and_wait | reboot (REBOOT), then the gate await_restart (INFO), asked again until the clock has restarted | nothing | yes | yes | yes |
add_user_verified sends the whole record, as upsert_user does, then asks the clock for the user. The clock posts the user’s row, then the result.
| Parameter | Type | |
|---|---|---|
user_id | string, required | 1 to 9 digits. |
name | string | At most 24 characters. |
role | user, enroller or admin | Default user. |
card | string, sensitive | 1 to 10 digits. None means no card. |
password | string, sensitive | At most 8 characters. None means no password. |
group | integer, 1 to 99 | The access group (default 1). |
The gate passes when the uploaded row has the name, password, card and group sent, and the privilege where the row carries it. Otherwise its result is one of:
the clock uploaded no user 8user 8 differs on the clock in: card, password(the fields that differ)no add_user was handed out for user 8 before the check
2.0 does not offer it, because a 2.0 clock cannot read one user back.
set_option_verified sets one setting of the registry, then sends INFO, whose answer lists the clock’s options.
| Parameter | Type | |
|---|---|---|
setting | enum, required | A name of the settings registry. |
value | string, required | A whole number within the setting’s range, or true / false (1 / 0) for a boolean setting. |
The gate passes when the clock reports the option with the value sent (KeyPadBeep=1). Otherwise its result is KeyPadBeep is 0 on the clock, not 1 or the clock did not report VOLUME.
reboot_and_wait takes no parameters. REBOOT goes last in its batch. The gate’s INFO is answered “not yet” (queue.retry, retry_in = 10, result text the clock has not restarted yet). It stays that way until the clock has made its start-up request (GET /cdata?options=all) since the REBOOT was handed out. The gate then passes, and the answer updates the device’s info (firmware, counts). Other actions’ commands go meanwhile.
- Give the action an expiry. A clock that never comes back then times it out.
- A clock that answers the
INFOwith an error code fails the gate and is held. - The
REBOOTstep needs its own result too. A clock posts it before or after it restarts. One that never does leaves the step in its hand until you cancel the action with--give-up, which fails the action.
A gate compares what the clock reports with what its own action sent, without keeping passwords or card numbers in the clear. A clock can have at most 16 of these checks waiting at once. Past that, the oldest unanswered gate is judged on the clock’s result code alone, without the comparison.
The internal commands (add_user_checked, verify_user, set_option_checked, check_option, await_restart) are steps of these actions only. They cannot be sent by name.
What the commands write
Section titled “What the commands write”Every command declares the sync domains it changes on the clock. While the endpoint’s sync group keeps one of them, the command (and any action that writes it) is refused when sent straight to the clock.
| Domain | Commands |
|---|---|
| people | add_user, add_user_checked, set_user_schedule (2.4, 3.4), delete_user, clear_all_users, delete_all_users (3.4); the add_* and delete_* commands of fingerprints, faces and palms, delete_all_fingerprints, delete_all_faces (3.4); set_user_photo, delete_user_photo; set_user_extended (2.4, 3.4); set_bio_attestation, delete_bio_attestation, delete_all_bio_attestations (3.4) |
| access | set_schedule, reset_schedule, delete_schedule, delete_all_schedules, reset_timezones (3.4), set_access_group (2.4, 3.4), delete_access_group, set_holiday, delete_holiday, set_unlock_combination (2.4) |
| lists | work codes, job code groups and job codes, tip codes, set_message, delete_message, delete_all_messages, assign_message, unassign_message (2.4) |
| settings | set_option, set_option_checked (internal: the steps of set_settings and set_option_verified) |
| people, access, lists | clear_all_data (CLEAR DATA) |
| none | reads and queries (the gates verify_user, check_option and await_restart among them), reboot, info, check, unlock_door, cancel_alarm, shell, get_file, put_file, enroll_fingerprint, set_comm_key, set_gateway_option, bells, short keys, self-service entries, clear_photos (attendance photos), clear_attendance_log and the other punch queries and deletes |
hourctl pkg show zk-push lists every command of the active revision with its parameters.
Sync groups
Section titled “Sync groups”What each package declares (M.sync) for an endpoint in a sync group.
| 2.0 | 2.4 | 3.4 | |
|---|---|---|---|
| user id | digits, 1 to 9, no leading 0 | the same | the same |
| fields | name (24), role | name (24), role | name (24), role, enabled (privilege 1) |
| cards | one, up to 32 bits, format raw (the number the reader sends) | the same | the same |
| keypad PIN / password | - / up to 8 | the same | the same |
| templates | zk:fingerprint:<version>; faces zk:face:7 | fingerprints; faces zk:face:12; palms zk:palm:<version> | fingerprints; faces zk:face:7 or zk:face:12, as the clock reports; palms zk:palm:<version> and zk:palm |
| photos | jpeg | jpeg | jpeg |
| id change | a replace; settled with info; checked with check_user / check_user_gone | a replace; settled with count_attendance_log | a replace; settled with query_attendance_log |
| reports | users, deleted users (operation 9), templates, photos, user count; no inventory | the same, inventory query_users (then info, for the count that says the upload is complete) | the same, inventory query_users (then info) |
| access | schedules in slots 26-50, one interval a day | schedules in slots 26-50; holidays in 26-50; access groups in 50-99 (3 schedules, 1 door); one access group a user | schedules in slots 26-50 |
| lists | work codes | work codes, messages | work codes, messages |
| settings class | [email protected] | zk-push-tft | zk-push-tft |
| punches | not declared | not declared | pull, asks last_punch |
Templates go only to clocks that report the same algorithm version (the fp_version, face_version and palm_version in the device’s info). A template is never converted.
Slots. The group owns schedule slots 26 to 50. On 2.4 it also owns holiday slots 26 to 50 and access group slots 50 to 99. The group’s first schedule goes in 26, the next in 27. Slot 1 is the clock’s factory “always” schedule, and group 1 is its default group. Installers number theirs from the bottom. Keep hand-made schedules out of 26-50.
An upload is complete when its users equal the clock’s count. A ZK clock does not mark the end of what it uploads. It has no last page and no end row. The answer to the query says only that it was taken. The package’s query_users therefore queues info right behind it. The clock’s UserCount after the upload is what the number of users uploaded must equal before the engine compares them with what the clock should hold.
A user gone is not confirmed. A change of user id on a 2.4 or 3.4 clock ends with the old user deleted. The package declares no check that the old user is gone (verify.absent). So an inventory without the user may be partial. The change goes on unverified (counted in houradvantage_sync_replace_unverifiable_total). The daily inventory finds an old user still on the clock, which the group deleted, and sends the delete again. A firmware command that answers for a single user, and says so when the user is not there, would let the package declare verify.absent and confirm it at once.
2.0 has no inventory. A 2.0 clock uploads one user at a time, by id. Users already on a 2.0 clock when it joins a group are not taken in as people enrolled at the clock. Only those it uploads later, as they change, are. Add them to the group through the API. A deleted 2.0 user’s name, card and password stay in the clock’s memory until the slot is reused (delete_leaves_bytes = true).
Lists. A work code key is 1 to 8 digits and its name at most 24 characters. A message key is 1 to 5 digits with no leading 0, and its text at most 320 characters. set_list_item makes a work code (WORKCODE) or a message (SMS, and USER_SMS for each of its user_ids). A message without from shows from the start of the day it is sent. 2.0 takes no messages, because it has no command to delete one.
Punches. On 2.0 and 2.4 the clock is sent nothing for punches. Its punch events carry the group’s sync marks like any member’s.
LastPunch (3.4)
Section titled “LastPunch (3.4)”When the endpoint is in a sync group that shares punches, GET /cdata?type=LastPunch&PIN=<user> is answered from the group:
status=0name=Ann Example pin=1001 state=0 workcode=0 date=2026-10-02 time=08:59:12state is this clock’s code: 0 check in to 7 overtime out, or empty for a state it has no code for. workcode is 0 for none. date and time are in the endpoint’s zone. An old user id is answered for its new one. When there is no recent punch, or the endpoint shares no punches, the answer is status=1. A short key with lockout = true makes the clock ask before it accepts a punch. The clock enforces its own lock-out period from the answer.
Settings
Section titled “Settings”The settings registry is the same on every version. set_settings and set_option_verified take these names and nothing else. An option that is not registered cannot be set.
| Setting | Clock option | Type | Range |
|---|---|---|---|
volume | VOLUME | integer | 0 to 100 |
repeat_punch_minutes | AlarmReRec | integer | 0 to 255 |
idle_minutes | IdleMinute | integer | 0 to 999; 0 never |
keypad_beep | KeyPadBeep | boolean | |
work_code_prompt | WorkCode | boolean | |
punch_log_alarm | AlarmAttLog | integer | 0 to 9999 |
set_settings sends one SET OPTION per value, in name order, as the internal command set_option. Its key is one of the clock option names above. 2.4 and 3.4 share the settings class zk-push-tft, so a value a sync group sets reaches clocks of both. 2.0 has a class of its own, [email protected].
Limits
Section titled “Limits”| Commands in one reply | 200, and at most max_command_bytes (default 40960) |
| Cards a user holds | 1, a number from 0 to 4294967295, without facility |
| Access groups a user is in | 1 |
| Schedule intervals a day | 1 |
| Lockout schedules a user follows | 3 |
| Verified-action checks waiting on one clock | 16 |
reboot_and_wait retry | every 10 seconds, at the clock’s next request |