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

Python error: invalid literal for int() with base 10: 'I-1' #293

Open
trickford opened this issue Feb 12, 2025 · 4 comments
Open

Python error: invalid literal for int() with base 10: 'I-1' #293

trickford opened this issue Feb 12, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@trickford
Copy link

When connecting to my DVR, I'm able to enter its IP and my credentials, and get a "Created configuration for Embedded Net DVR."

However, once that's done, I get the following python error in HA:

Failed setup, will retry: Cannot initialize hikvision_next http://192.168.86.36:88. Error: invalid literal for int() with base 10: 'I-1'

This seems to happen no matter which version I use.

Image Image Image
@trickford
Copy link
Author

This is from the logs:

Source: custom_components/hikvision_next/__init__.py:61
integration: Hikvision NVR / IP Camera ([documentation](https://github.com/maciej-or/hikvision_next), [issues](https://github.com/maciej-or/hikvision_next/issues))
First occurred: 4:04:38 PM (10 occurrences)
Last logged: 4:07:35 PM

Cannot initialize hikvision_next http://192.168.86.36:88. Error: invalid literal for int() with base 10: 'I-1' Traceback (most recent call last): File "/config/custom_components/hikvision_next/__init__.py", line 53, in async_setup_entry await device.get_hardware_info() File "/config/custom_components/hikvision_next/isapi/isapi.py", line 124, in get_hardware_info self.supported_events = await self.get_supported_events(capabilities) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hikvision_next/isapi/isapi.py", line 297, in get_supported_events if event := create_event_info(event_trigger): ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/config/custom_components/hikvision_next/isapi/isapi.py", line 263, in create_event_info io_port = int(event_trigger.get("inputIOPortID", 0)) ValueError: invalid literal for int() with base 10: 'I-1'```

@trickford
Copy link
Author

This is from the logs:

Source: custom_components/hikvision_next/__init__.py:61
integration: Hikvision NVR / IP Camera ([documentation](https://github.com/maciej-or/hikvision_next), [issues](https://github.com/maciej-or/hikvision_next/issues))
First occurred: 4:04:38 PM (10 occurrences)
Last logged: 4:07:35 PM

Cannot initialize hikvision_next http://192.168.86.36:88. Error: invalid literal for int() with base 10: 'I-1' Traceback (most recent call last): File "/config/custom_components/hikvision_next/__init__.py", line 53, in async_setup_entry await device.get_hardware_info() File "/config/custom_components/hikvision_next/isapi/isapi.py", line 124, in get_hardware_info self.supported_events = await self.get_supported_events(capabilities) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hikvision_next/isapi/isapi.py", line 297, in get_supported_events if event := create_event_info(event_trigger): ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/config/custom_components/hikvision_next/isapi/isapi.py", line 263, in create_event_info io_port = int(event_trigger.get("inputIOPortID", 0)) ValueError: invalid literal for int() with base 10: 'I-1'```

@maciej-or thoughts on the cause of this?

@maciej-or
Copy link
Owner

Thanks for details, it looks like your dvr returns not supported response. I will check the Hikvision ISAPI documentation and fix. Will let you know when it is ready for testing

@maciej-or maciej-or added the bug Something isn't working label Feb 19, 2025
@trickford
Copy link
Author

Thanks for details, it looks like your dvr returns not supported response. I will check the Hikvision ISAPI documentation and fix. Will let you know when it is ready for testing

Let me know if I can help! Happy to proactively test any changes with you using my device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants