Hik-Connect_Team_Skills is a full-featured integration Skills designed specifically for Hik-Connect for Teams (HCT) developers. Based on the HCTOpen OpenAPI system, it encapsulates core capabilities from basic resource management to advanced alarm push through Python scripts.
This Skills adopts a modular design with built-in automated Token maintenance mechanisms, dynamic path searching, and standardized error handling, aiming to help developers quickly build HCT-based automated O&M, security monitoring, and business integration systems.
This Skills consists of five core sub-modules, each providing deep support for specific business scenarios:
Module NameCore FunctionsCore ScriptsApplicable Scenarios📦 Resource ManagementDevice discovery, detail acquisition, channel enumerationlist_devices.py
device_detail.py
device_channels.py
list_doors.pyAsset inventory, obtaining device serial numbers and channel IDs, access control resources, synchronizing organizational structure resources.🚪 Access Control (ACS)Remote open/close, normally open/normally closed controlacs_control.pyRemote office collaboration, unattended entrance management, access control linkage in emergencies.📸 Device CaptureReal-time trigger capture, obtain image URLcapture_pic.pyAnomaly verification, real-time screen preview, manual secondary verification of AI recognition results.🎥 Video StreamingObtain real-time video streamget_video_url.pyReal-time monitoring embedding, remote video inspection, third-party monitoring large screen integration.🔔 Alarm Push (Alarm)Webhook subscription, fine-grained event managementwebhook_manager.py
event_manager.pyReal-time alarm notification, third-party system integration (e.g., Feishu/DingTalk robots).
Before using any module, credentials must be configured. The system supports two methods:
bash
# Required: Obtain from Hik-Connect HCT Developer Platform
export HIK_CONNECT_TEAM_OPENAPI_APP_KEY="Your Hik-Connect Team OpenAPI AppKey"
export HIK_CONNECT_TEAM_OPENAPI_SECRET_KEY="Your Hik-Connect Team OpenAPI SecretKey"
# Note: API domain is automatically obtained from token response (no longer required)
# Optional: Token cache configuration (enabled by default to reduce API call frequency)
export HIK_CONNECT_TEAM_TOKEN_CACHE="1" # 1=Enabled, 0=Disabled
If environment variables are not set, the system will automatically search for credentials in OpenClaw config files:
text
Config search order (first found wins):
1. ~/.openclaw/config.json
2. ~/.openclaw/gateway/config.json
3. ~/.openclaw/channels.json
Config format:
json
{
"channels": {
"hik_connect_team_openapi": {
"appKey": "Your Hik-Connect Team OpenAPI AppKey",
"secretKey": "Your Hik-Connect Team OpenAPI SecretKey",
"enabled": true
}
}
}
Recommended: Save to ~/.openclaw/channels.json — This is the dedicated file for channel credentials.
⚠️ Security Note: Storing credentials in config files is convenient but introduces some risk. Environment variables are recommended for better security.
This Skills is developed based on Python 3.8+. It is recommended to install necessary dependencies using the following command:
bash
pip3 install requests tabulate pycryptodome Pillow
Credential Priority (Highest to Lowest):
text
┌─────────────────────────────────────────────────────────────┐
│ 1. Environment Variables (Highest Priority - Recommended) │
│ ├─ HIK_CONNECT_TEAM_OPENAPI_APP_KEY │
│ └─ HIK_CONNECT_TEAM_OPENAPI_SECRET_KEY │
│ ✅ Advantage: No config file reading, fully isolated │
├─────────────────────────────────────────────────────────────┤
│ 2. OpenClaw Config Files (Only when env vars not set) │
│ ├─ ~/.openclaw/config.json │
│ ├─ ~/.openclaw/gateway/config.json │
│ └─ ~/.openclaw/channels.json │
│ ⚠️ Note: Only reads channels.hik_connect_team_openapi field │
├─────────────────────────────────────────────────────────────┤
text
Hik-Connect_Team_Skills/
├── SKILL.md # This guide file (Full-featured integration guide)
├── lib/ # Core library
│ └── token_manager.py # Encapsulates HCTOpenClient base class, handles Token refresh, request retries, and path searching
└── modules/ # Functional sub-modules
├── Hik-Connect_Team_Resource/ # Resource Management: Devices, channels, details
├── Hik-Connect_Team_ACS/ # Access Control: Open/close, normally open/normally closed
├── Hik-Connect_Team_Capture/ # Device Capture: Real-time trigger, URL acquisition
├── Hik-Connect_Team_Video/ # Video Streaming: Real-time preview address acquisition
└── Hik-Connect_Team_Alarm/ # Alarm Push: Webhook management, event subscription
lib/ directory.ngrok or cpolar with SSL certificates for secure access.signSecret and implement HMAC-SHA256 signature verification on your receiving end to prevent forged alarm pushes.success is false, please check the message field for detailed error reasons.