Integration with hikvision ax pro alarm system

@gunkutz thanks for your reply. I tried to configure SIA integration but my entities become unavailable soon although connectivity entity is up . I tried playing around with different protocols without any luck. Would you mind sharing your ARC configuration in AX pro.
Thanks

Hi,
this configuration works for me.

1 Like

i tried the integration, but when i enter the credentials it tells me invalid authentication
How could I resolve?

Thanks

Thanks @gunkutz it works now. I realized there are arm and disarm buttons under zone entities and when I press them, it fails with the following message:

Failed to call service alarm_control_panel/alarm_arm_away. Entity alarm control panel.8000_aaa_zone_1_alarm does not support this service.

same thing here! can someone help with this? thanks !

can you help us understand how it worked? thanks!

With the help of the Findller, it intercepted the mobile application’s request to the server. got the Python code, everything works, but the question arose how to write the payload in a more readable form

payload = f"deviceSerial=Q0123454&channelNo=0&apiKey=100080&apiData=GET%20%2FISAPI%2FSecurityCP%2FConfiguration%2FsubSys%3Fformat%3Djson%20HTTP%2F1.1%0D%0AAuthorization%3A%20Digest%20username%3D%22admin%22%2C%20nonce%3D%226659f56cfas71338dc2b403439a0eff7%3A1544623276710%22%2C%20response%3D%22bb6790e0002734c58a656984bdf0b6e0%22%2C%20UserType%3D%22Operator%22%0D%0AUserType%3A%20Operator%0D%0A%0D%0A"
response0 = requests.request("POST", "https://apiieu.hik-connect.com/v3/userdevices/v1/isapi", headers=headers, data=payload)

I don’t understand the apiDATA parameterI tried to write like this.

payload={'deviceSerial': 'Q012345', 'channelNo': '0', 'apiKey': '100080', 'apiData': 'GET /ISAPI/SecurityCP/Configuration/subSys?format=json Authorization: Digest username="admin", nonce="6939f56cfbc71338dc2b40367890eff7:1544623276710", response="bb6790e0002734c58a656984bdf0b6e0", UserType="Operator"UserType: Operator' }

Hi, look at the Hikconnect integration in HACS, it’s using the same payload as you do to intercept for example callstatus…

Do you mind sharing your code? Always interested

I have code under development

headers['sessionId']=login('[email protected]','xxxxxxx')
def login(username: str, password: str):
    password = hashlib.md5(password.encode("utf-8")).hexdigest()
    payload=f'account={username}&password={password}'


    conn = http.client.HTTPSConnection("apiieu.hik-connect.com")
    conn.request("POST", "/v3/users/login/v2",payload,headers)
    res = conn.getresponse()
    data = res.read().decode("utf-8")
    data = json.loads(data)
    data = data['loginSession']['sessionId']
    return data

def getStatusAXPro(serial):
    payload = f"deviceSerial=Q0123454&channelNo=0&apiKey=100080&apiData=GET%20%2FISAPI%2FSecurityCP%2FConfiguration%2FsubSys%3Fformat%3Djson%20HTTP%2F1.1%0D%0AAuthorization%3A%20Digest%20username%3D%22admin%22%2C%20nonce%3D%226659f56cfas71338dc2b403439a0eff7%3A1544623276710%22%2C%20response%3D%22bb6790e0002734c58a656984bdf0b6e0%22%2C%20UserType%3D%22Operator%22%0D%0AUserType%3A%20Operator%0D%0A%0D%0A"
    payload={'deviceSerial': 'Q012345', 'channelNo': '0', 'apiKey': '100080', 'apiData': 'GET /ISAPI/SecurityCP/Configuration/subSys?format=json Authorization: Digest username="admin", nonce="6939f56cfbc71338dc2b40367890eff7:1544623276710", response="bb6790e0002734c58a656984bdf0b6e0", UserType="Operator"UserType: Operator' }
    conn = http.client.HTTPSConnection("apiieu.hik-connect.com")
    conn.request("POST", "/v3/userdevices/v1/isapi/", payload, headers)
    res = conn.getresponse()
    data = res.read().decode("utf-8")
    data = json.loads(data)
    #data = data
    return data

I installed the integration but when I try to arm the alarm I receive this message in the log:

I found this GitHub - Supergiovane/node-red-contrib-hikvision-ultimate: A native set of node for Hikvision Cameras, Doorbells, Alarms, Radars etc.
Can it be useful to implement in HA?

hello but What credentials should be entered in the integration?

1 Like

You need to use admin or installer account…
If for installing has been used Hik-ProConnect username&password you need to use that… You can first try login localy to web page of your alarm panel. If you can login sucessfully then creditentals are ok.

1 Like

@DejanBukovec @DejanBukove
yes thanck you, bu how i can get different status like arm_home and arm_away?

Did you try check them in card?
slika

I use “custom:mushroom-alarm-control-panel-card” and have option to do that but didn’t test them because do not need them…

@DejanBukovec DejanBukov

yes, on card I havve all enabled,
the problem it is as below,
even if it is armed at home the state is always armed,
I have automations that work with status change and I need to have armed home and armed away…

i loved at home now, and if i look at the status it’s always armed…

@DejanBukovec see my last post…

Hi,
Im not developer of integration. You can open issue on github…
Im quick check code and there is arm_home, arm_away and disarm functions and they must work. BUT do you use more than one zone? If yes integration do not support zones and show only general status. If all zones are in state arm then it show arm if all zones are in disarm then show disarm…
For example I have 3 zones and one of them I have all time in arm state but integration show disarmed state, then I arm alarm in other zones and integration show armed. When I disarm other zones and leave one zone armed it show disarmed. Im talking about disarming/arming inside hikvision app and not integration… In integration it arm/disarm ALL zones(In some older version of integration it arm/disarm only first zone).

@gunkutz gunkut hello dear friend
I’m using your home assistant addon, can you modify the code by adding the various states?
armed_away
armed_home
triggered
disarmed
it would be very useful for someone like me who uses different states to create automations.

I hope for your help.

1 Like

Great addon and works very well thanks. I would like to know if there is some way for the home assistant to have the states of the sensors even with the alarm off.