Hikvision stop events #173869
Copy link
Copy link
Closed
Labels
Description
The problem
events from the Hikvision DS-2DE5425IW-AE(T5) camera stopped coming, firmware V5.8.13 build 260402, events are coming to third-party applications
What version of Home Assistant Core has the issue?
2026.6.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Hikvision
Link to integration documentation on our website
https://www.home-assistant.io/integrations/hikvision
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
None yet
Activity
ilvi80 commentedon Jun 15, 2026
Logger: pyhik.hikvision
Source: /usr/local/lib/python3.14/site-packages/pyhik/hikvision.py:759
First recorded: 17:36:17 (84 occurrences)
Last recorded: 19:15:45
Problem finding attribute: 'NoneType' object has no attribute 'text'
Logger: pyhik.hikvision
Source: /usr/local/lib/python3.14/site-packages/pyhik/hikvision.py:445
First recorded: June 16, 2026 at 15:40:31 (8 occurrences)
Last recorded: 07:50:04
Sensor type "group" is unsupported.
Sensor type "rapidMove" is unsupported.
Sensor type "parking" is unsupported.
Sensor type "facedetection-1" is unsupported.
Sensor type "faceSnap" is unsupported.
home-assistant commentedon Jun 16, 2026
Hey there @mezz64, @ptarjan, mind taking a look at this issue as it has been labeled with an integration (
hikvision) you are listed as a code owner for? Thanks!Code owner commands
Code owners of
hikvisioncan trigger bot actions by commenting:@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign hikvisionRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the issue.(message by CodeOwnersMention)
@ilvi80 Thanks for reporting this issue!
Before we dive in, please make sure this isn't a duplicate by searching through existing issues. Also check recently closed issues, as your problem might already be fixed but not yet released.
https://github.com/home-assistant/core/issues?q=%20label%3A%22integration%3A%20hikvision%22%20
(message by IssueContext)
hikvision documentation
hikvision source
(message by IssueLinks)
Keep the event stream alive through read timeouts
Keep the event stream alive through read timeouts
ilvi80 commentedon Sep 3, 2026
@ptarjan Hello. Is there any information on when this problem will be resolved?
ptarjan commentedon Sep 3, 2026
Status update, since a few people are watching this one.
Root cause is found and fixed upstream. The
Problem finding attribute: 'NoneType' object has no attribute 'text'line means the device sent an alert packet that left out an optional XML element (eventStateoractivePostCount).process_stream()parsed those fields unconditionally, so the whole packet — including the event type and channel that were present — got thrown away. That is the 84x-repeated log line in this issue.There is a second, nastier variant that I think explains "events stop entirely until I restart HA" better than the dropped packet does: if the device sends an empty
<activePostCount/>,int()raisesValueError, andprocess_stream()is called from inside anexcept (ValueError, RequestException)block that means "the connection dropped". So one malformed packet tears down the alert stream and puts it into reconnect-backoff. Third-party apps keep getting events off the device; HA doesn't. That matches the reports here.Fix: mezz64/pyHik#130 — every field except the event type is now treated as optional, a packet with no state is treated as active (
update_stale()clears it after 5s as usual), and an unparseable count becomes 0 instead of escaping. Five regression tests cover it; CI is green on 3.9–3.12. I also verified the patched library against a live DS-7608NI-EV2/8P and replayed real captured packets with the fields stripped out.Where it stands: #130 is open and waiting on @mezz64's review. Once it merges and he tags a release, I'll open the dependency bump here and it ships in the next HA release after that. Nothing is blocked on the HA side.
If you're hitting this, a useful thing you can add: your model and firmware version, and whether your log shows the
NoneTypeline, theProblem getting device info/reconnect lines, or both. My own NVR always sends both fields, so the malformed packets come from models I can't reproduce on directly.mezz64 commentedon Sep 4, 2026
mezz64/pyHik#130 has been merged and a new 0.4.6 release pushed to pypi with the fix.
ptarjan commentedon Sep 4, 2026
Thanks @mezz64 for the quick turnaround.
The Home Assistant side is up: #181330 bumps the pin to pyHik 0.4.6. Once that is reviewed and merged it will ride out in the next release, and it is a small enough change that it should be backportable to a patch release if the maintainers want it sooner.