HIK Vision AX PRO alarm system

Any one interested in hik vision AX PRO binding? i can’t find any working plugins right know, home assistant is probably close to make it happen. i Own some hik alarm devices including AX PRO and would be happy to contribute

oh my progress so far:

Using node-red with GitHub - Supergiovane/node-red-contrib-hikvision-ultimate: A native set of node for Hikvision Cameras, Doorbells, Alarms, Radars etc.

Created a small flow for the alarm like the example in the documentation and added a mqtt service for sending information received from AX PRO to openhabs mqtt, created a generic mqtt item and i can now use it to arm/dismarm/turnoff alarm etc. Steps to begin:

1/ Install node-red
3/ Setup a mqtt server (can be the same if you are already using one with your openhab
2/ Go to node-red web gui and install node-red-contrib-hikvision-ultimate package
3/ Created the flow test it

ok i have a working setup right now.

1/ red-node connected to mqtt broker
2/ all devices from ax pro alarm system (wired and wireless) exposed to openhab and homekit binding
3/ additional automations integrated with ax pro arm status (cameras, audible warning, flashing lights warnings)

example things configuration:

AX PRO main thing - zones & status manipulation


UID: mqtt:topic:AXPRO
label: AXPRO - Centrala
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:mymqttbroker
channels:
  - id: stanalarmu
    channelTypeUID: mqtt:switch
    label: Stan Alarmu strefa dom - 1
    description: null
    configuration:
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*CIDEvent.*)∩REGEX:(.*"system":1.*)∩JSONPATH:$.CIDEvent.code
      off: "1401"
      on: "3401"
  - id: stanalarmu_ogrod
    channelTypeUID: mqtt:switch
    label: Stan Alarmu strefa ogród - 2
    description: null
    configuration:
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*CIDEvent.*)∩REGEX:(.*"system":2.*)∩JSONPATH:$.CIDEvent.code
      off: "1401"
      on: "3401"

AX pro wired, traditional PIR:

UID: mqtt:topic:mymqttbroker:AXPROZone1
label: AXPRO - 1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:mymqttbroker
channels:
  - id: name
    channelTypeUID: mqtt:string
    label: name
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.name
  - id: status
    channelTypeUID: mqtt:switch
    label: status
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.status
      off: online
      on: trigger
  - id: sensorStatus
    channelTypeUID: mqtt:switch
    label: sensorStatus
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.sensorStatus
      off: offline
      on: normal
  - id: tamperEvident
    channelTypeUID: mqtt:switch
    label: tamperEvident
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.tamperEvident
      off: "false"
      on: "true"
  - id: shielded
    channelTypeUID: mqtt:switch
    label: shielded
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.shielded
      off: "false"
      on: "true"
  - id: bypassed
    channelTypeUID: mqtt:switch
    label: bypassed
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.bypassed
      off: "false"
      on: "true"
  - id: armed
    channelTypeUID: mqtt:switch
    label: armed
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.armed
      off: "false"
      on: "true"
  - id: isArming
    channelTypeUID: mqtt:switch
    label: isArming
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.isArming
      off: "false"
      on: "true"
  - id: alarm
    channelTypeUID: mqtt:switch
    label: alarm
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.alarm
      off: "false"
      on: "true"
  - id: stayAway
    channelTypeUID: mqtt:switch
    label: stayAway
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.stayAway
      off: "false"
      on: "true"
  - id: zoneType
    channelTypeUID: mqtt:string
    label: zoneType
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.zoneType
  - id: zoneAttrib
    channelTypeUID: mqtt:string
    label: zoneAttrib
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.zoneAttrib
  - id: accessModuleType
    channelTypeUID: mqtt:string
    label: accessModuleType
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.accessModuleType
  - id: moduleChannel
    channelTypeUID: mqtt:string
    label: moduleChannel
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.moduleChannel
  - id: deviceNo
    channelTypeUID: mqtt:string
    label: deviceNo
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.deviceNo
  - id: abnormalOrNot
    channelTypeUID: mqtt:switch
    label: abnormalOrNot
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      allowedStates: true,false
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.abnormalOrNot
      off: "false"
      on: "true"
  - id: subSystemNo
    channelTypeUID: mqtt:string
    label: subSystemNo
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.subSystemNo
  - id: linkageSubSystem
    channelTypeUID: mqtt:string
    label: accessModuleType
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: "%s"
      stateTopic: AXPRO
      transformationPattern: REGEX:(.*"id":1,.*)∩JSONPATH:$.zoneUpdate.linkageSubSystem

Some further automations on hikvision ISAPI

UID: http:url:67cafe1cbf
label: Turn ON audible alarm on Bok
thingTypeUID: http:url
configuration:
  authMode: DIGEST
  ignoreSSLErrors: false
  baseURL: http://10.30.1.183/ISAPI/Event/triggers/notifications/AudioAlarm?format=json
  password: xxxxxxxx
  delay: 0
  stateMethod: GET
  refresh: 3000
  commandMethod: PUT
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
  username: xxxxx
location: Bok
channels:
  - id: ON
    channelTypeUID: http:string
    label: ON
    description: null
    configuration:
      mode: WRITEONLY

node-red copy&past config


[
    {
        "id": "8a9b917e04d6e380",
        "type": "tab",
        "label": "AXPRO",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "7c370c1cabe6fd89",
        "type": "hikvisionUltimateAxPro",
        "z": "8a9b917e04d6e380",
        "name": "Ax Pro",
        "topic": "",
        "server": "9527d2874792ace5",
        "outputtype": "0",
        "x": 590,
        "y": 200,
        "wires": [
            [
                "893818dce1fc2c20",
                "93ae7a8eca4e4d1d"
            ],
            [
                "01e634bd9098e528"
            ]
        ]
    },
    {
        "id": "ddc2d752e0c13937",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Rozbrojenie Obszar 1",
        "props": [
            {
                "p": "disarmArea",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 300,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "b33ec376180a53bc",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Zbrojenie Obszar 1",
        "props": [
            {
                "p": "c",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 110,
        "y": 400,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "6145bfa8991c1831",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Zbrojenie selektywne Obszar 1",
        "props": [
            {
                "p": "armStayArea",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 150,
        "y": 120,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "189b2eb17cb67a52",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Kasuj alarm Obszar 1",
        "props": [
            {
                "p": "clearAlarmArea",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 200,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "40ce4b0d34bedf21",
        "type": "comment",
        "z": "8a9b917e04d6e380",
        "name": "Hikvision AX Pro Alarm Control and Event receiver",
        "info": "",
        "x": 290,
        "y": 20,
        "wires": []
    },
    {
        "id": "93ae7a8eca4e4d1d",
        "type": "mqtt out",
        "z": "8a9b917e04d6e380",
        "name": "",
        "topic": "AXPRO",
        "qos": "0",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "3442476185a00e3f",
        "x": 780,
        "y": 420,
        "wires": []
    },
    {
        "id": "01e634bd9098e528",
        "type": "debug",
        "z": "8a9b917e04d6e380",
        "name": "Connection Error",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 830,
        "y": 260,
        "wires": []
    },
    {
        "id": "893818dce1fc2c20",
        "type": "debug",
        "z": "8a9b917e04d6e380",
        "name": "Event",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 770,
        "y": 80,
        "wires": []
    },
    {
        "id": "df929025fa145352",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Zbrojenie selektywne Obszar 2",
        "props": [
            {
                "p": "armStayArea",
                "v": "2",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 150,
        "y": 160,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "8e1c206612bacff3",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Kasuj alarm Obszar 2",
        "props": [
            {
                "p": "clearAlarmArea",
                "v": "2",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 240,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "de51beab81326ca2",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Rozbrojenie Obszar 2",
        "props": [
            {
                "p": "disarmArea",
                "v": "2",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 340,
        "wires": [
            []
        ]
    },
    {
        "id": "a0a68faf80654edc",
        "type": "mqtt in",
        "z": "8a9b917e04d6e380",
        "name": "",
        "topic": "AXPRO/SET",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "61de5090.0f5d9",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 110,
        "y": 520,
        "wires": [
            [
                "8a948a2fc482dcc5"
            ]
        ]
    },
    {
        "id": "8a948a2fc482dcc5",
        "type": "function",
        "z": "8a9b917e04d6e380",
        "name": "message to command transformation",
        "func": "var newmsg;\nif (msg.payload === \"armStayArea: 1\") {\n    newmsg = { armStayArea: 1 }\n    return newmsg;\n}\nif (msg.payload === \"armStayArea: 2\") {\n    newmsg = { armStayArea: 2 }\n    return newmsg;\n}\nif (msg.payload === \"clearAlarmArea: 1\") {\n    newmsg = { clearAlarmArea: 1 }\n    return newmsg;\n}\nif (msg.payload === \"clearAlarmArea: 2\") {\n    newmsg = { clearAlarmArea: 2 }\n    return newmsg;\n}\nif (msg.payload === \"disarmArea: 1\") {\n    newmsg = { clearAlarmArea: 1 }\n    return newmsg;\n}\nif (msg.payload === \"disarmArea: 2\") {\n    newmsg = { disarmArea: 2 }\n    return newmsg;\n}\nif (msg.payload === \"armAwayArea: 1\") {\n    newmsg = { armAwayArea: 1 }\n    return newmsg;\n}\nif (msg.payload === \"armAwayArea: 2\") {\n    newmsg = { armAwayArea: 2 }\n    return newmsg;\n}\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 390,
        "y": 520,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "9527d2874792ace5",
        "type": "AXPro-config",
        "host": "ip_address",
        "port": "80",
        "name": "Ax Pro",
        "authentication": "sha256-salted",
        "protocol": "http",
        "heartbeattimerdisconnectionlimit": "2",
        "deviceinfo": "[object Object]"
    },
    {
        "id": "3442476185a00e3f",
        "type": "mqtt-broker",
        "name": "localhost",
        "broker": "127.0.0.1",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "61de5090.0f5d9",
        "type": "mqtt-broker",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    }
]