Note: This is a fork of maciej-or/hikvision_next with critical bug fixes and improvements.
Disclaimer!
This is a community-made integration.
It is not affiliated with, authorized, or endorsed by Hikvision. The Hikvision name and logo are trademarks of their respective owners. This project does not attempt to misuse, exploit, or misrepresent the brand. Use at your own risk.
Added PTZ (Pan-Tilt-Zoom) camera controls via ONVIF protocol.
Features:
- PTZ movement controls (up, down, left, right, zoom in/out)
- Preset positions
- Patrol routes
Credit: Merged from zyloid's fork
Problem: Motion detection and other binary sensors were delayed by up to 2 minutes due to polling every 120 seconds.
Solution: Binary sensors now respond instantly by properly utilizing Hikvision's real-time event stream with eventState (active/inactive) parsing.
Before:
- Motion detected → wait up to 2 minutes for sensor to update
- Sensor stuck ON (never turned OFF automatically)
After:
- Motion detected → sensor turns ON instantly (<1 second)
- Motion ends → sensor turns OFF instantly
- Perfect for automations that need real-time response
- Open HACS in Home Assistant
- Click the 3 dots (top right) → Custom repositories
- Add this repository:
- URL:
https://github.com/daveinc/hikvision_next - Category:
Integration
- URL:
- Click "Explore & Download Repositories"
- Search for "Hikvision Next"
- Download and restart Home Assistant
- Download this repository
- Copy the
custom_components/hikvision_nextfolder to your HAconfig/custom_components/directory - Restart Home Assistant
- NVR Model: DS-7216HQHI-K1
- Firmware: V4.20.000 build 190724
- Know to be working with : Annke N46PCK DS-7108NI-Q1/8P DS-7608NI-I2 DS-7608NI-I2/8P DS-7608NXI-I2/8P/S DS-7608NXI-K1/8P DS-7616NI-E2/16P DS-7616NI-I2/16P DS-7616NI-Q2 DS-7616NI-Q2/16P DS-7616NXI-I2/16P/S DS-7716NI-I4/16P DS-7732NI-M4 ERI-K104-P4 DVR iDS-7204HUHI-M1/FA/A iDS-7204HUHI-M1/P iDS-7208HQHI-M1(A)/S(C) IP Camera Annke C800 (I91BM) DS-2CD2047G2-LU/SL DS-2CD2047G2H-LIU DS-2CD2087G2-LU DS-2CD2146G2-ISU DS-2CD2155FWD-I DS-2CD2346G2-IU DS-2CD2386G2-IU DS-2CD2387G2-LU DS-2CD2387G2H-LISU/SL DS-2CD2425FWD-IW DS-2CD2443G0-IW DS-2CD2532F-IWS DS-2CD2546G2-IS DS-2CD2747G2-LZS DS-2CD2785G1-IZS DS-2CD2H46G2-IZS (C) DS-2CD2T46G2-ISU/SL DS-2CD2T87G2-L DS-2CD2T87G2P-LSU/SL DS-2DE4425IW-DE (PTZ) DS-2SE4C425MWG-E/26
- Home Assistant: 2025.X+ (should work on older versions too)
Please report your working configurations in Issues to help others!
1. Models (isapi/models.py)
- Added
event_state: strfield toAlertInfodataclass - Stores "active" or "inactive" state from event notifications
2. ISAPI Client (isapi/isapi.py)
- Modified
parse_event_notification()to extract<eventState>from XML - Passes event state to
AlertInfoobject
3. Notifications Handler (notifications.py)
- Updated
trigger_sensor()to useevent_statefor binary sensor state - Sets sensor ON when
eventState == "active" - Sets sensor OFF when
eventState == "inactive" - Fires HA events only on motion start (not on motion end)
Hikvision devices send real-time HTTP POST notifications with XML like:
<EventNotificationAlert>
<eventType>VMD</eventType>
<eventState>active</eventState> <!-- Motion started -->
...
</EventNotificationAlert>And when motion ends:
<EventNotificationAlert>
<eventType>VMD</eventType>
<eventState>inactive</eventState> <!-- Motion ended -->
...
</EventNotificationAlert>The original integration was ignoring the eventState field and relying on slow polling instead.
These are still present (not fixed in this fork yet):
- Camera stream entities may not appear (reported in home-assistant/core#xxxxx)
- [Add any other known issues you're aware of]
Found a bug? Have an improvement?
- Open an Issue
- Or submit a Pull Request!
Since the original repository appears unmaintained (last update 2+ years ago), I'm maintaining this fork for the community.
- Original Author: maciej-or - Created the excellent foundation
- This Fork: Fixed instant binary sensor updates
- Contributors: [List any contributors who help you]
[Same license as original - usually MIT or Apache 2.0, check the original repo]
- Issues: GitHub Issues
- Community: Home Assistant Community Forums
- Documentation: [Original ISAPI Documentation](link if you have it)
Potential future improvements (help wanted!):
- Fix camera stream entity creation
- Reduce polling interval for non-critical sensors
- Add support for [feature X]
- Improve error handling
- Add more comprehensive tests
Want to help? Pick an item and open an issue to discuss implementation!