hikvision_next
hikvision_next copied to clipboard
New install - Failed to set up credentials expired
Hi, I'm a little lost. It's a new install of the integration.
I've followed the instructions but can't get the integration to configure.
Any help would be greatly appreciated. 😀
Hi,
To help with the issue. I've copied the log details below.
I've deleted and added the integration several time with no change?
Thanks in advance.
Peter
Logger: homeassistant.config_entries Source: config_entries.py:407 First occurred: 10 May 2023 at 22:08:21 (1 occurrences) Last logged: 10 May 2023 at 22:08:21
Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance
pls check if user has required permissions -> https://github.com/maciej-or/hikvision_next#hikvision-device-setup-checklist
pls check if user has required permissions -> https://github.com/maciej-or/hikvision_next#hikvision-device-setup-checklist
Hi, Thanks for the quick response. I've checked again the following
Network settings ISAPI access User Management - User has full Admin rights
Events Notify Surveillance Center yes Regions if needed. I'm not sure what this is? Arming Schedule 24/7 Storage Schedule Settings - 24/7
Alarm Server - IP address suggested is the correct one for my HA. (Box left ticked).
Can I send any other information to help?
Thanks,
Peter
pls attach full logs https://github.com/maciej-or/hikvision_next#reporting-issues
pls attach full logs https://github.com/maciej-or/hikvision_next#reporting-issues
Hi, Sorry I've had to split it over several posts (page 1 to 25)
Home Assistant Core
2023-05-10 22:07:51.401 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration foxess_modbus which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-05-10 22:07:51.403 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-05-10 22:07:51.405 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hikvision_next which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-05-10 22:08:01.681 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400) 2023-05-10 22:08:21.877 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-10 22:08:21.900 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s 2023-05-10 22:10:22.634 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-10 22:10:22.637 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s 2023-05-10 22:12:22.807 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1234, in async_reload raise UnknownEntry homeassistant.config_entries.UnknownEntry 2023-05-10 22:13:12.749 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-10 22:13:12.761 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s 2023-05-10 22:15:13.445 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-10 22:15:13.449 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s 2023-05-10 22:17:14.113 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-10 22:17:14.117 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s 2023-05-10 22:19:14.808 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-10 22:19:14.811 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s
Hi, I'm a little lost. It's a new install of the integration.
I've followed the instructions but can't get the integration to configure.
Any help would be greatly appreciated. 😀
Hi, I've have turned on the debugging and now have the below log. It's seems the integration is able to connect to the NVR and extract the model number and ID. So I must have the IP, port and user set up correctly.
Does this help?
Thanks,
Peter
2023-05-12 19:53:38.123 DEBUG (MainThread) [custom_components.hikvision_next.isapi] http://192.168.0.3/ISAPI/System/deviceInfo {'DeviceInfo': {'@version': '1.0', '@xmlns': 'http://www.hikvision.com/ver20/XMLSchema', 'deviceName': 'Embedded Net DVR', 'deviceID': '48463737-3037-3239-3339-08a18918e0c7', 'model': 'iDS-7204HUHI-M1/FA/A', 'serialNumber': 'iDS-7204HUHI-M1/FA/A0420210405CCWRF77072939WCVU', 'macAddress': '08:a1:89:18:e0:c7', 'firmwareVersion': 'V4.26.120', 'firmwareReleasedDate': 'build 210304', 'encoderVersion': 'V5.0', 'encoderReleasedDate': 'build 210304', 'deviceType': 'IPC', 'telecontrolID': '255', 'hardwareVersion': '0xc0fbe00'}} 2023-05-12 19:53:38.274 DEBUG (MainThread) [custom_components.hikvision_next.isapi] http://192.168.0.3/ISAPI/System/deviceInfo {'DeviceInfo': {'@version': '1.0', '@xmlns': 'http://www.hikvision.com/ver20/XMLSchema', 'deviceName': 'Embedded Net DVR', 'deviceID': '48463737-3037-3239-3339-08a18918e0c7', 'model': 'iDS-7204HUHI-M1/FA/A', 'serialNumber': 'iDS-7204HUHI-M1/FA/A0420210405CCWRF77072939WCVU', 'macAddress': '08:a1:89:18:e0:c7', 'firmwareVersion': 'V4.26.120', 'firmwareReleasedDate': 'build 210304', 'encoderVersion': 'V5.0', 'encoderReleasedDate': 'build 210304', 'deviceType': 'IPC', 'telecontrolID': '255', 'hardwareVersion': '0xc0fbe00'}} 2023-05-12 19:53:38.326 DEBUG (MainThread) [custom_components.hikvision_next.isapi] http://192.168.0.3/ISAPI/Event/capabilities {'EventCap': {'@version': '1.0', '@xmlns': 'http://www.hikvision.com/ver20/XMLSchema', 'isSupportHDFull': 'true', 'isSupportHDError': 'true', 'isSupportNicBroken': 'true', 'isSupportIpConflict': 'true', 'isSupportIllAccess': 'true', 'isSupportViException': 'false', 'isSupportViMismatch': 'false', 'isSupportRecordException': 'true', 'isSupportRaidException': 'false', 'isSupportViResMismatch': 'false', 'isSupportPOCException': 'false', 'isSupportSpareException': 'false', 'isSupportFaceContrast': 'true', 'isSupportWhiteListFaceContrast': 'false', 'isSupportHumanRecognition': 'true', 'isSupportFaceSnap': 'true', 'isSupportPersonDensityDetection': 'false', 'HFPD': 'false', 'isSupportTriggerCapCheck': 'true'}} 2023-05-12 19:53:38.388 DEBUG (MainThread) [custom_components.hikvision_next.isapi] http://192.168.0.3/ISAPI/Smart/capabilities {'SmartCap': {'@version': '1.0', '@xmlns': 'http://www.hikvision.com/ver20/XMLSchema', 'isSupportROI': 'false', 'isSupportFaceDetect': 'true', 'isSupportIntelliTrace': 'false', 'isSupportFieldDetection': 'true', 'isSupportDefocusDetection': 'true', 'isSupportAudioDetection': 'true', 'isSupportSceneChangeDetection': 'true', 'isSupportLineDetection': 'true', 'isSupportRegionEntrance': 'true', 'isSupportRegionExiting': 'true', 'isSupportLoitering': 'true', 'isSupportGroup': 'true', 'isSupportRapidMove': 'true', 'isSupportParking': 'true', 'isSupportUnattendedBaggage': 'true', 'isSupportAttendedBaggage': 'true', 'isSupportAnalysisUnitSwitch': 'false', 'isSupportSmartCalibration': 'false', 'isSupportHFPD': 'false'}} 2023-05-12 19:53:38.657 DEBUG (MainThread) [custom_components.hikvision_next.coordinator] Finished fetching hikvision_next data in 0.222 seconds (success: False)
2023-05-12 19:53:38.658 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Embedded Net DVR' for hikvision_next integration could not authenticate: Credentials expired for http://192.168.0.3 Cannot fetch state for regionentrance 2023-05-12 19:53:38.663 WARNING (MainThread) [custom_components.hikvision_next.config_flow] Attempt to reauth in 120s
This is the same issue as #34
Thank you for pointing this out. I've read issue 34 however I can't see how you resolved the issue?
Peter 😀
I've read issue 34 however I can't see how you resolved the issue?
Try installing the old version v1.0.2 through HACS, if it works for you then don't upgrade the integration until #34 is fixed.
Hi, I've deleted and installed version 1.02. The integration now loads successfully. However I'm getting 400 and 403 errors.
The integration is now at least connecting to the NVR. I'm not sure why its not generating events for motion. I will have another look over the weekend.
Thanks,
Peter
v1.0.4 has been released. @msp1974 thank you for contribution I needed fix NVR side a bit. I wonder if we could hit analog inputs and ip camera inputs endpoints depending on deviceType (NVR/DVR) instead of catching exceptions. We will back to videoloss capability detection later as well.
You can have both IP and analog cameras on some of these devices (have both on mine) and seems that some report as a DVR and some as an IPC. I have been looking more at the possible endpoints to determine how you know what it supports and will look at this again when i have worked it out.
I have also seen from some of the javascript libraries used by the DVRs web interface that quite a few of the endpoints are different (ie videoloss) depending on whether an IP or analog camera. I think it might be worth looking at establishing a camera list with a type parameter and using this to manage what endpoints are called for certain functions.
Will keep working on this to find a preferable method to do.
Edit: think IPC also needs adding to the DEVICE_TYPE_NVR list but not sure of impact on single IP cameras of this.
You can have both IP and analog cameras on some of these devices (have both on mine) and seems that some report as a DVR and some as an IPC. I have been looking more at the possible endpoints to determine how you know what it supports and will look at this again when i have worked it out.
I have also seen from some of the javascript libraries used by the DVRs web interface that quite a few of the endpoints are different (ie videoloss) depending on whether an IP or analog camera. I think it might be worth looking at establishing a camera list with a type parameter and using this to manage what endpoints are called for certain functions.
Will keep working on this to find a preferable method to do.
Edit: think IPC also needs adding to the DEVICE_TYPE_NVR list but not sure of impact on single IP cameras of this.
Thanks for the update to version 1.04.
I've just removed the old integration and installed v1.04. This was very smooth process. I've now got a live video feed from the DVR. I might try adding the IPC into the DEVICE_TYPE_NVR as with a modified version of 1.02 the integration detected the 4 analog camera. Version 1.04 is only pulling video from Camera1. I still don't seem to be getting any events from the DVR? When I toggle any of the switches I get a error 400?
I will try adding IPC to the device type and see what difference this makes.
For reference this is what I'm seeing now.
Thanks,
Peter
@Fitzpap firstly you need to get it recognising all your cameras. If the adding IPC does not work, you need to turn on debugging and post your logs after a restart. Without this working, the supported events are likely wrong.
Secondly, you need to ensure the alarm server sesnors are correctly populated as this is how it notifies events. This should be populated automatically when setup, unless you unticked it.
Thirdly, if your cameras are coax and not IP, there is still some work to do to make all the event switches work properly. For now you can enable in your dvrweb interface.
As a note, with my iDS7204HUHI if i have motion detection enabled, i cannot enable line crossing, get a 400 error. I have to turn off motion detection first before i can then enable. This would need some further smarts to better handle this.
@Fitzpap firstly you need to get it recognising all your cameras. If the adding IPC does not work, you need to turn on debugging and post your logs after a restart. Without this working, the supported events are likely wrong.
Secondly, you need to ensure the alarm server sesnors are correctly populated as this is how it notifies events. This should be populated automatically when setup, unless you unticked it.
Thirdly, if your cameras are coax and not IP, there is still some work to do to make all the event switches work properly. For now you can enable in your dvrweb interface.
As a note, with my iDS7204HUHI if i have motion detection enabled, i cannot enable line crossing, get a 400 error. I have to turn off motion detection first before i can then enable. This would need some further smarts to better handle this.
Hi, thanks for the advice. I've added IPC into the configuration file and I now get all 4 analog cameras via coax. I've still not managed to get the entities to detect motion... I need to check the alarm sever settings are correct on my DVR. Thanks for your help. Peter