-
Notifications
You must be signed in to change notification settings - Fork 51
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
etchannel_num = int(etchannel.text) - TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' #93
Comments
That error would suggest the updated firmware has changed the form of the XML response in the event stream which either changed the name for the channel field or removed it. If you can post a snippet from the event stream when some events are occurring I can see if it can be accounted for. |
Certainly. What specific steps should I take? Do you want me to export the log from the NVR through the web interface? Sorry a bit confused |
You need to use curl to monitor the alertStream output. Something like this:
If you look through other active issues you can find some more detailed info if that doesn't work for you. |
|
full log |
it looks like |
I didn't realize initially this is thrown on setup, the alertStream looks OK so something must be different in triggers. Please post the output of this:
|
|
Thanks. From a quick look I think the problem is in some of the NVR status sensors. They are set to notify the center so they are being parsed, but they don't report any ID's so it doesn't know what camera to associate them with. You also have center notify turned on for videoloss events, which can cause problems. Try turning off notifying the surveillance center on these alert types and see if it will startup ok. |
I disabled all events and notifications in both the NVR and in each individual camera. However, I am still encountering the same error in Home Assistant. Is it correct to assume that when Home Assistant initializes Hikvision/pyHik, the script fails due to not receiving the expected data during the 'get_event_triggers' process? |
Can you generate another output from the trigger endpoint once everything is disabled? I'm wondering if the new firmware isn't replicating certain changes to the api endpoints. |
|
With everything disabled do you get the same error or a different one? Things looked to have changed correctly, but with everything off there won't be any sensors to setup so i'm not surprised it doesn't work. Enable something (motion, linedetection) on one camera and see if it loads. |
Ok, i'll run your trigger output through independently and see if I can track it down. Should be able to find some time this weekend. |
I think i've found the problem and put together a fix in a new branch (https://github.com/mezz64/pyHik/tree/trig-fixes) for you to test. Please replace the hikvision.py file in your local install with the one from that branch and give home assistant a restart to test. If all works well i'll put together the necessary PR's to update the library and get things fixed in the main branch. |
I seem to lack access to both I believe I need to create a hikvision folder in custom_components to prompt HA to load an updated hikvision script. Should I place the files from github.com/home-assistant/core/tree/dev/homeassistant/components/hikvision inside this folder and modify them somehow to load a test version of the hikvision.py file? |
I'm not familiar with the HA OS architecture these days, nor if you can get away with forcing something with custom components. Let me run the changes through my tests to make sure something unintended didn't break. If all work well I can push the new version to pypi which should make it easier for you to fetch it and test. |
Thank you. I've asked about this on the HA forums, but it seems a bit complicated... https://community.home-assistant.io/t/force-ha-to-use-custom-pyhik-version/673512/5 |
I encountered the same issue in Home Assistant, and the error messages were identical. After testing your modified hikvision.py, the binary sensor entities can now be generated correctly. Additionally, there were no other error messages found in the Home Assistant logs. It seems to be functioning properly now. I tested the line cross functionality, and it triggers correctly in Home Assistant. |
@Marsmz Thanks for confirming. I'll try to find some time to merge this in soon. |
so, I tested this by directly updating the Python in Not seeing the cameras, though |
Hi,
I'm using pyHik through Home Assistant. Everything was working fine for the last 2 years, but suddenly I started receiving the error message below. I recently upgraded my NVR firmware to V4.75.200, and I'm not sure if this is what caused the issue.
NVR: Hikvision DS-7604NI-K1/4P(C)
V4.75.200 build 231110
HA config:
binary_sensor:
host: 192.168.0.10
port: 80
ssl: false
username: user
password: pass
The text was updated successfully, but these errors were encountered: