Supergiovane / node-red-contrib-hikvision-ultimate

A native set of node for Hikvision Cameras, Doorbells, Alarms, Radars etc.
https://www.facebook.com/supergiovaneDev
MIT License
51 stars 11 forks source link

AX PRO not getting zone update message for second zone #49

Closed JacekKac closed 1 year ago

JacekKac commented 1 year ago

hi! i manage to run node-red with this library, connect to AX Pro, and setup a simply mqtt broker to send status / change setteings via mqtt commands. What is interesting for me

when i am playing with the APP hik connect or directly from node-red i see

AXPRO {"zoneUpdate":{"id":0,"name":"Strefa przewodowa 1","status":"online","sensorStatus":"normal","tamperEvident":true,"shielded":false,"bypassed":false,"armed":true,"isArming":false,"alarm":false,"subSystemNo":1,"linkageSubSystem":[1],"detectorType":"passiveInfraredDetector","stayAway":false,"zoneType":"Instant","accessModuleType":"localTransmitter","moduleChannel":1,"zoneAttrib":"wired","deviceNo":2,"abnormalOrNot":false}}

when i send command to "whole alarm system" or to First zone (id number: 0). I have 2 zones in the setup and don't see any status updates for second zone even when i am playing with the zone from himkvision app.

but i do see the CIDevents for different zones i think system 1 or 2

"CIDEvent":{"code":3441,"name":"jkjebj","type":"armAndDisarm","trigger":"2023-03-13T13:59:00+01:00","upload":"2023-03-13T13:59:02+01:00","system":1,"subSystemName":"Dom parter"}} AXPRO {"CIDEvent":{"code":1401,"name":"jkjebj","type":"armAndDisarm","trigger":"2023-03-13T14:00:30+01:00","upload":"2023-03-13T14:00:30+01:00","system":2,"subSystemName":"Dom pietro"}} AXPRO {"CIDEvent":{"code":3401,"name":"jkjebj","type":"armAndDisarm","trigger":"2023-03-13T14:00:38+01:00","upload":"2023-03-13T14:00:38+01:00","system":2,"subSystemName":"Dom pietro"}} AXPRO {"CIDEvent":{"code":3441,"name":"jkjebj","type":"armAndDisarm","trigger":"2023-03-13T14:00:39+01:00","upload":"2023-03-13T14:00:40+01:00","system":2,"subSystemName":"Dom pietro"}}

not sure if this is a bug we can fix, happy to help you with testing

Supergiovane commented 1 year ago

Hi Can you pleasy post here your flow, to allow me to check it?

JacekKac commented 1 year ago

Sure - but playing a little bit arround it seems to work only if you have at least one device added in each zone. One was empty and there was a possibility to arm it via hik vision app but the status message was missing. When i add a device to this zone i get status updates for 2 zones right now, so it seems to be a bug in hikvision

[
    {
        "id": "7c370c1cabe6fd89",
        "type": "hikvisionUltimateAxPro",
        "z": "8a9b917e04d6e380",
        "name": "Ax Pro",
        "topic": "",
        "server": "9527d2874792ace5",
        "outputtype": "0",
        "x": 350,
        "y": 160,
        "wires": [
            [
                "893818dce1fc2c20",
                "93ae7a8eca4e4d1d"
            ],
            [
                "01e634bd9098e528"
            ]
        ]
    },
    {
        "id": "ddc2d752e0c13937",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Disarm Area 1",
        "props": [
            {
                "p": "disarmArea",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 150,
        "y": 240,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "b33ec376180a53bc",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Arm Away Area 1",
        "props": [
            {
                "p": "armAwayArea",
                "v": "1",
                "vt": "num"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "armAwayArea0",
        "payloadType": "str",
        "x": 140,
        "y": 280,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "6145bfa8991c1831",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Arm selektywnie Area 1",
        "props": [
            {
                "p": "armStayArea",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 140,
        "y": 120,
        "wires": [
            [
                "7c370c1cabe6fd89",
                "93ae7a8eca4e4d1d"
            ]
        ]
    },
    {
        "id": "189b2eb17cb67a52",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Clear Alarm Area 1",
        "props": [
            {
                "p": "clearAlarmArea",
                "v": "1",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 130,
        "y": 200,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "40ce4b0d34bedf21",
        "type": "comment",
        "z": "8a9b917e04d6e380",
        "name": "Hikvision AX Pro Alarm Control and Event receiver",
        "info": "",
        "x": 230,
        "y": 80,
        "wires": []
    },
    {
        "id": "93ae7a8eca4e4d1d",
        "type": "mqtt out",
        "z": "8a9b917e04d6e380",
        "name": "",
        "topic": "AXPRO",
        "qos": "0",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "3442476185a00e3f",
        "x": 340,
        "y": 440,
        "wires": []
    },
    {
        "id": "01e634bd9098e528",
        "type": "debug",
        "z": "8a9b917e04d6e380",
        "name": "Connection Error",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 220,
        "wires": []
    },
    {
        "id": "893818dce1fc2c20",
        "type": "debug",
        "z": "8a9b917e04d6e380",
        "name": "Event",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 530,
        "y": 120,
        "wires": []
    },
    {
        "id": "df929025fa145352",
        "type": "inject",
        "z": "8a9b917e04d6e380",
        "name": "Arm selektywnie Area 2",
        "props": [
            {
                "p": "armStayArea",
                "v": "2",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 160,
        "wires": [
            [
                "7c370c1cabe6fd89"
            ]
        ]
    },
    {
        "id": "9527d2874792ace5",
        "type": "AXPro-config",
        "host": "192.168.0.20",
        "port": "80",
        "name": "Ax Pro",
        "authentication": "sha256-salted",
        "protocol": "http",
        "heartbeattimerdisconnectionlimit": "2",
        "deviceinfo": "[object Object]",
        "credentials": {}
    },
    {
        "id": "3442476185a00e3f",
        "type": "mqtt-broker",
        "name": "localhost",
        "broker": "192.168.0.13",
        "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": ""
    }
]
Supergiovane commented 1 year ago

Hi the arming works only if you have something to arm in the zone. The Hik APIs reports only armed devices bellnging to a zone.