Integration with hikvision ax pro alarm system

Hi,
I have installed a ax pro alarm system from hikvision.
Do you know about any way to integrate it with Ha?
Br, Dariush

1 Like

You can probably use ISAPI, check this thread, first post, i added all ISAPI filed there, it’s for a doorbell, but there are also documents for alarm events…

Hi Fabio,
thank you very much for the suggestion.
ISAPI would not be my preferred way, the reason why I’m looking at the integration is because I don’t want to connect my alarm with hik-connect cloud.
Is it possible in your opinion jsut integrating with the hik hub locally? If yes, could you provide me any guideline?
BR, Dariush

But ISAPI is local , you don’t need cloud to use ISAPI…

I only have a doorbell, no alarm system, but i use ISAPI without cloud

My fault Fabio, sorry for that, I did not see you’re using 192.168.x.y as host.
Let me try, in case of success I’ll share my config (first of all I have to check if the isapi is compatible with my AX PRO system, if not I’d ask to hik).
BR, Dariush.

yeah, it should be, there are ISAPI documents for alarm panels, i have zipped them all , they are in first post of that other thread

Yes thanks, downloaded.
Have a good day,
Dariush

1 Like

Mh, my hub model DS-PWA6464lWE is not listed in the security control pdf file.
Do you know how can i obtain the SDK documentation from hik? Having a look to their site SDK | Download | Hikvision if don’t find what i’m looking at…
Ciao, Dariush.

hmm, sdk uses the same ISAPI, so there is no advantage
but even if your device is not listed, it doest mean it doestnt work
mine doorbell isnt listed either

is port 80 open? try some basic ISAPI command?

You’re probably right, I’ll try in the next days once I’m at home and let you know :wink:
BR, Dariush

Anyone know how to arm an area using ISAPI?

1 Like

or how to get a sensor state?

Hi Dariush,

Did you ever come right with adding ax pro to home assistant?

Hi, I’ve tried quickly sniffing the network calls vs the hub, didn’t succeed.
If you’re interested, we could give a try wirking together after vacation.
Let me know, ciao, Dariush

Hi Dariush, what methods were you using to sniff? I have started looking at this myself. There is definitely some work to be done in this. I would definitely wish to help or participate. I came across this repo, might be a useful starting point in order to communicate with the hub programmatically.

Hi, I managed to make my AxHub working with HA, ISAPI should be the same for AxPro:

sensor:
  - platform: rest
    name: axhubsys
    resource: http://<ip>/ISAPI/SecurityCP/status/subSystems?format=json
    username: xxxxx
    password: yyyyy
    authentication: digest
    value_template: 'OK'
    scan_interval: 10
    json_attributes:
        - SubSysList
  - platform: template
    sensors:
       axhubpanel:
        friendly_name: "AxHub Panel"
        value_template: '{{ state_attr("sensor.axhubsys", "SubSysList")[0]["SubSys"]["arming"] }}'
        attribute_templates:
            id: '{{ state_attr("sensor.axhubsys", "SubSysList")[0]["SubSys"]["id"] }}'
            arming: '{{ state_attr("sensor.axhubsys", "SubSysList")[0]["SubSys"]["arming"] }}'
            alarm: '{{ state_attr("sensor.axhubsys", "SubSysList")[0]["SubSys"]["alarm"] }}'
 
switch:
  - platform: command_line
    switches:
      ax_arm_home:
            command_on: "/usr/bin/curl -X PUT --digest -u user:password 'http://<ip>/ISAPI/SecurityCP/control/arm/1?ways=stay&format=json'"
      ax_arm_away:
            command_on: "/usr/bin/curl -X PUT --digest -u user:password 'http://<ip>/ISAPI/SecurityCP/control/arm/1?ways=away&format=json'"
      ax_disarm:
            command_on: "/usr/bin/curl -X PUT --digest -u user:password 'http://<ip>/ISAPI/SecurityCP/control/disarm/1?format=json'"

If you setup a manual alarm_control_panel it will also work with Homekit:

alarm_control_panel:
  - platform: template
    panels:
      allarme:
        name: AxHub
        value_template: >-
            {%- if is_state('sensor.axhubpanel', 'disarm') %}
              disarmed
            {% else %}
              {%- if is_state('sensor.axhubpanel', 'stay') %}
                armed_home
              {% else %}
                {%- if is_state('sensor.axhubpanel', 'away') %}
                    armed_away
                {% else %}
                    unavailable
                {% endif %}
              {% endif %}
            {% endif %}
        arm_home:
            service: script.ax_arm_stay
        arm_away:
            service: script.ax_arm_away
        disarm:
            service: script.ax_disarm

Ciao!

5 Likes

For anyone that’s interested, I got it working with the ax pro hub yesterday! It works differently to the older axhub in that it needs more than just digest auth. I wrote it in typescript for node, but being a home-assistant newbie, was wondering what the best way is to integrate this with ha is? any ideas let me know!
Repo is emmetdel/hikvision-api (github.com).Comments are welcome as code is still in a very early stage.

I’m getting 401 after checking user/password are correct despite using digest… any ideas?

hikvision-toolkit/.jest.setup.js at b2cece9bb76b51a37dd3f514977ad122188ee0d7 · emmetdel/hikvision-toolkit · GitHub

I hope those are test credentials!

Uhmm… which FW version are you on? My panel is on 1.07.
Ax-PRO or AxHub?