Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hikvision binary sensor fails to initialize #107892

Closed
acuszka opened this issue Jan 12, 2024 · 3 comments
Closed

Hikvision binary sensor fails to initialize #107892

acuszka opened this issue Jan 12, 2024 · 3 comments

Comments

@acuszka
Copy link

acuszka commented Jan 12, 2024

The problem

The Hikvision binary sensor fails to initialize. It had been working fine for the past 2 years.

NVR: Hikvision DS-7604NI-K1/4P(C)
I recently upgraded my NVR to V4.75.200 build 231110

`Error while setting up hikvision platform for binary_sensor

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/hikvision/binary_sensor.py", line 110, in setup_platform
data = HikvisionData(hass, url, port, name, username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/hikvision/binary_sensor.py", line 157, in init
self.camdata = HikCamera(self._url, self._port, self._username, self._password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 116, in init
self.initialize()
File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 291, in initialize
events_available = self.get_event_triggers()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 435, in get_event_triggers
etchannel_num = int(etchannel.text)
^^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'`

What version of Home Assistant Core has the issue?

core-2024.1.2

What was the last working version of Home Assistant Core?

core-2024.1.2

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

Traceback (most recent call last).txt

Example YAML snippet

binary_sensor:
  - platform: hikvision
    host: 192.168.0.10
    port: 80
    ssl: false
    username: user
    password: pass

Anything in the logs that might be useful for us?

File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 435, in get_event_triggers
    etchannel_num = int(etchannel.text)
                    ^^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Additional information

NVR: Hikvision DS-7604NI-K1/4P(C)
I recently upgraded my NVR to V4.75.200 build 231110

@home-assistant
Copy link

Hey there @mezz64, 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) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


hikvision documentation
hikvision source
(message by IssueLinks)

@mezz64
Copy link
Contributor

mezz64 commented Jan 12, 2024

This is being troubleshooted in the library repo (mezz64/pyHik#93). It's not an issue with the component side code. This can be closed.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants