Skip to content

Hikvision stop events #173869

Closed
Closed

Description

@ilvi80

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

Activity

  1. ilvi80 commented on Jun 15, 2026

    @ilvi80
    Author

    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.

  2. home-assistant commented on Jun 16, 2026

    @home-assistant
    Contributor

    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 hikvision can trigger bot actions by commenting:

    • @home-assistant close Closes the issue.
    • @home-assistant rename Awesome new title Renames the issue.
    • @home-assistant reopen Reopen the issue.
    • @home-assistant unassign hikvision Removes the current integration label and assignees on the issue, add the integration domain after the command.
    • @home-assistant add-label needs-more-information Add 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-information Remove 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)

  3. ilvi80 commented on Sep 3, 2026

    @ilvi80
    Author

    @ptarjan Hello. Is there any information on when this problem will be resolved?

  4. ptarjan commented on Sep 3, 2026

    @ptarjan
    Contributor

    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 (eventState or activePostCount). 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() raises ValueError, and process_stream() is called from inside an except (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 NoneType line, the Problem 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.

  5. mezz64 commented on Sep 4, 2026

    @mezz64
    Contributor

    mezz64/pyHik#130 has been merged and a new 0.4.6 release pushed to pypi with the fix.

  6. ptarjan commented on Sep 4, 2026

    @ptarjan
    Contributor

    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.

  7. locked and limited conversation to collaborators on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions