This script can bulk add mifare cards to Hikvision video intercom (or other device from Hikvision with internal mifare card reader) without manually adding them in the panel’s web interface, as well as without using Hikvision iVMS software. First of all, this is necessary when the mifare_id of the cards is already known and they need to be duplicated in video intercom.
You can add mifare cards by first preparing a text file with mifare_id in hex format, then the script will create users with the name you specify, 5 cards in each user. Or each mifare card separately. It is also possible to completely clear all users with cards added to them.
Requires Python 3.10+ to run correctly!
# Clone this repository or download the zip file
git clone https://github.com/dammaer/bulk-record-mifare-id-in-hikvision.git
# Go to the folder
cd bulk-record-mifare-id-in-hikvision/
# Creation and activation of virtual environment
python3 -m venv venv
source venv/bin/activate
# Installing required packages
pip install -r requirements.txt
Prepare the settings.ini file. Indicate in it the IP addresses of video intercom stations and the login and password for them.
# Run the script with the -u add.txt and -n student keys.
# This will update or create users named student1, student2, etc. and add 5 mifare cards to each.
python record_mifare_id.py -u add.txt -n student
# This will add new mifare cards to existing users called student
# or create a new user student if the remaining users are full
python record_mifare_id.py -a 85EF77B4 7290FDE1 -n student
# This will remove all users with the name "student" and their mifare cards
python record_mifare_id.py -c -n student
Some mifare card readers display the key value in reverse. For example, the NFC Tool (Android) application displays the 85EF77B4 key as 4B:77:FE:58 when read. This must be taken into account before use, otherwise mifare cards will not work!