petrleocompel / hikaxpro_hacs

HACS repository of Hikvision Ax Pro integration for home assistant
MIT License
40 stars 4 forks source link

Setup - Unauthorized #123

Closed Aquagen1800 closed 2 weeks ago

Aquagen1800 commented 1 month ago

As above when adding it errors out immediately Double/triple checked the IP, user and password. Enabling debugging log is not producing a log file.

Using the latest hacs version Ax pro v1. 2.9 Screenshot_20240814_143837_Home Assistant Screenshot_20240814_143448_Home Assistant

petrleocompel commented 1 month ago

Debug output still goes towards main homeassistant log. Depends on type of your installation where and how to view the log.

Also newest release is v2.1.5 not v1.2.9. Please check that you are pointing to correct repository.

Next step is did you check https://github.com/petrleocompel/hikaxpro_hacs?tab=readme-ov-file#pre-check

image

Again depends on your installation how it is configured. If you have "Hikvision account" configured and linked to the system try to use login of your Hikvision account.

Aquagen1800 commented 1 month ago

Hacs addon is latest version. Ax pro firmware is v1. 2.9 which I believe is also latest Ij3epa is the generated hikvision username and is the only account. It has admin privilege

petrleocompel commented 4 weeks ago

HACS Addon != HikAXPro Integration AX Pro Firmware != HikAXPro Integration

Most important thing here is version of HikAXPro Integration you are using. AX Pro firmware is not that important since they did not release any major versions yet. HACS Addon is nothing I care about because that is only a way how to install this integrations.

Soo.... HikAXPro Integration version is what I asked about.

Are you sure it is the only account ? Did you check in WebUI interface of AX Pro that there is no installer ? Did somebody else install your system? Do you have Hikvision Account conntected?

Aquagen1800 commented 4 weeks ago

V2. 1.5 is installed. Latest version

There is only mine and my partners account. I'm admin she is user

2024-08-14 20:19:12.406 DEBUG (SyncWorker_0) [hikaxpro] Session_Capabilities response
2024-08-14 20:19:12.406 DEBUG (SyncWorker_0) [hikaxpro] Status: 200
2024-08-14 20:19:12.406 DEBUG (SyncWorker_0) [hikaxpro] Content: b'<SessionLoginCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">\n<sessionID>0c11d90b5212f18bd871396fd03338c2213bf4f5428f085c57b6a81ac61def7c</sessionID>\n<challenge>f0f8e87ab9745bbbfb787a1c1e098fe1</challenge>\n<iterations>100</iterations>\n<isSupportRTSPWithSession>true</isSupportRTSPWithSession>\n<isIrreversible>true</isIrreversible>\n<sessionIDVersion>2.1</sessionIDVersion>\n<salt>4916FFFB17D4349A710317FB87429D383083002CDA80BD6C0FA5C1AFE6397F0D</salt>\n<salt2>A901B553AB9C0799C7BEEB8988C8C0EF0D8C2B2947407E3FA5BC995EFDD5D1AC</salt2>\n</SessionLoginCap>\n'
2024-08-14 20:19:12.407 DEBUG (SyncWorker_0) [hikaxpro] Text: <SessionLoginCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<sessionID>0c11d90b5212f18bd871396fd03338c2213bf4f5428f085c57b6a81ac61def7c</sessionID>
<challenge>f0f8e87ab9745bbbfb787a1c1e098fe1</challenge>
<iterations>100</iterations>
<isSupportRTSPWithSession>true</isSupportRTSPWithSession>
<isIrreversible>true</isIrreversible>
<sessionIDVersion>2.1</sessionIDVersion>
<salt>4916FFFB17D4349A710317FB87429D383083002CDA80BD6C0FA5C1AFE6397F0D</salt>
<salt2>A901B553AB9C0799C7BEEB8988C8C0EF0D8C2B2947407E3FA5BC995EFDD5D1AC</salt2>
</SessionLoginCap>
2024-08-14 20:19:12.407 DEBUG (SyncWorker_0) [hikaxpro] Headers: {'Date': 'Wed, 14 Aug 2024 20:19:10 GMT', 'Server': 'Webs', 'X-Frame-Options': 'SAMEORIGIN', 'Cache-Control': 'no-cache', 'Content-Length': '568', 'Content-Type': 'application/xml; charset="UTF-8"', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=60, max=99'}
2024-08-14 20:19:12.408 DEBUG (SyncWorker_0) [hikaxpro] End Session_Capabilities response
2024-08-14 20:19:12.408 DEBUG (SyncWorker_0) [hikaxpro] Debug data <SessionLoginCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<sessionID>0c11d90b5212f18bd871396fd03338c2213bf4f5428f085c57b6a81ac61def7c</sessionID>
<challenge>f0f8e87ab9745bbbfb787a1c1e098fe1</challenge>
<iterations>100</iterations>
<isSupportRTSPWithSession>true</isSupportRTSPWithSession>
<isIrreversible>true</isIrreversible>
<sessionIDVersion>2.1</sessionIDVersion>
<salt>4916FFFB17D4349A710317FB87429D383083002CDA80BD6C0FA5C1AFE6397F0D</salt>
<salt2>A901B553AB9C0799C7BEEB8988C8C0EF0D8C2B2947407E3FA5BC995EFDD5D1AC</salt2>
</SessionLoginCap>
2024-08-14 20:19:12.557 DEBUG (SyncWorker_0) [hikaxpro] Connect response
2024-08-14 20:19:12.557 DEBUG (SyncWorker_0) [hikaxpro] Status: 401
2024-08-14 20:19:12.557 DEBUG (SyncWorker_0) [hikaxpro] Content: b'<?xml version="1.0" encoding="UTF-8" ?>\n<SessionLogin>\n<statusValue>401</statusValue>\n<statusString>Unauthorized</statusString>\n<isActivated>false</isActivated>\n<sessionID>0c11d90b5212f18bd871396fd03338c2213bf4f5428f085c57b6a81ac61def7c</sessionID>\n<lockStatus>unlock</lockStatus>\n<unlockTime>0</unlockTime>\n<retryLoginTime>1</retryLoginTime>\n</SessionLogin>'
2024-08-14 20:19:12.557 DEBUG (SyncWorker_0) [hikaxpro] Text: <?xml version="1.0" encoding="UTF-8" ?>
<SessionLogin>
<statusValue>401</statusValue>
<statusString>Unauthorized</statusString>
<isActivated>false</isActivated>
<sessionID>0c11d90b5212f18bd871396fd03338c2213bf4f5428f085c57b6a81ac61def7c</sessionID>
<lockStatus>unlock</lockStatus>
<unlockTime>0</unlockTime>
<retryLoginTime>1</retryLoginTime>
</SessionLogin>
2024-08-14 20:19:12.557 DEBUG (SyncWorker_0) [hikaxpro] Headers: {'Date': 'Wed, 14 Aug 2024 20:19:10 GMT', 'Server': 'Webs', 'X-Frame-Options': 'SAMEORIGIN', 'Cache-Control': 'no-cache', 'Content-Length': '358', 'Content-Type': 'application/xml; charset="UTF-8"', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=60, max=99'}
2024-08-14 20:19:12.558 DEBUG (SyncWorker_0) [hikaxpro] End connect response
petrleocompel commented 4 weeks ago

I will answer for you.

From the log I see it is trying to authorize but your credentials are not valid for the API. So the integration works but just credentials you provide are not right for the API.

Aquagen1800 commented 3 weeks ago

If by Hikvision account is connected you mean the hik connect Web then yes. It has only one user ij3epa The Web ui I cannot access. https://ius.hik-connect.com/devices/page recognises the ax pro (it is my only hikvision device) but the IP points directly to my ISP ip. When I click on it it is unable to resolve. I'm unsure if this is a port forwarding issue

petrleocompel commented 3 weeks ago

No - the device directly has "WebUI".It is accessible on IP of the device. In your case http://192.168.1.163/ (taken from your screenshots)

petrleocompel commented 3 weeks ago

If you cannot access the device WebUI your user is not probably an admin.

Aquagen1800 commented 3 weeks ago

Got it sorted. Complete wipe and re do on hikvision side let the addon install. Thanks for the help 👍

petrleocompel commented 2 weeks ago

@Aquagen1800 you did not close the issue... closing for you.