Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-red-contrib-hikvision-ultimate

Supergiovane1.3kMIT1.2.10

A native set of nodes for Hikvision (and compatible) Cameras, Alarms, Radars, NVR, Doorbells, etc.

node-red, hikvision, alarm, camera, radar, ANPR, license plate, doorbell, door intercom, access control terminal, Ax Pro

readme

A native set of nodes for Hikvision (and compatible) Camera, Alarm, Radar, NVR, Doorbell, Speaker etc.

NPM version NPM downloads per month NPM downloads total MIT License JavaScript Style Guide Donate via PayPal

DESCRIPTION

This is a set of nodes to handle ISAPI Hikvision messages. It works exclusively with HIKVISION and Hikvision based compatible devices.
Works with cameras, NVR, Security Systems, Doorbells and also with specialized devices, like Radar (for example DS-PR1-60, DS-PR1-100 and DS-PR1-120).
Digest authentication: it should work with all devices.
All nodes are capable of auto reconnect if the connection is lost and are able to actively monitor the connection.
Be sure to have installed Node.js v12.3.0 or newer (issue a node -v command in a console, to check it out).

WARNING

Due to the many models and firmware versions out there, not all cams/NVR/Door Intercoms does work. For example, many intercoms does not really support all APIs, that the official ISAPI documentation says it supports, thus, they don't work, not only with this node, but also with any software using the public ISAPI documentation. Please don't blame the developer, as it can do nothing to workaround such problems.

ENABLE NOFITICATIONS

For NVR/DVR, pleas remember to select "Notify Alarm Center" in the event window, otherwise the NVR won't emit any alarm event.



CHANGELOG



CAMERA EVENT NODE

The Camera Event node connects to NVR, Camera, Radars, etc.. and outputs true/false in case of an alarm.
The node can be configured as Camera/NVR (with standard and smart events) or as Old Security System and Radar (with specific CID events, designed for these type of security devices)
You can optionally filter the alarms by CHANNEL, EVENT and ZONE.
For NVR/DVR, the Channel property is the CAMERA number, while for Cameras, is the image sensor number (normally 1).
The Zone property is the alarm zone (RADARS), or the alert region number (CAMERAS AND NVR/DVR).
For RADAR device types, you can filter improper/false alams as well.

You can choose from many different alarms, including:

  • Video Motion Alarm (When motion is detected)
  • Local alarm input (it's the device's IO pigtail connector)
  • Line crossing (when someone crosses a line)
  • CID alarms
  • Many more.....

Flow Messages

The node outputs a payload on PIN 1 (TRUE on alarm start, FALSE on alarm end). Some alarm types only support the alarm start event.
The node outputs a payload on PIN 2, representing a connection error. TRUE if error, otherwise FALSE
The node outputs a payload on PIN 3, with the captured image (as byte array), that you can directly save to disk or attach on an email or so. This pin emits a message only if the camera sends the captured image. This usually happens with "smart" events (but many firmwares out there, allow you to do it even with the basic events). You can check that by attaching a debug node on the third pin, then set a rule in the smart event and set the camera to send pictures in case of events (usually, you'll find this option in the "Archive management" menu of your camera).

This below is an example of msg output:

Output PIN 1

// Example of an event from NVR/Camera
msg = {
  "payload": true,
  "topic": "",
  "channelid": "13", // This is the camera number for NVR, or the channel ID for cameras
  "zone": 0, // Zone or Region, see above, the explained difference
  "description": "Motion alarm",
  "_msgid": "386a613.89f259e"
}
// Example of an event from Radar
msg = {
{
    "zone": 1, // This is the zone number that fired the alarm
    "payload": true, // true if alarm, otherwise false if alarm ended.
    "alarm": {
        "ipAddress": "192.168.1.25",
        "ipv6Address": "",
        "portNo": 80,
        "protocol": "HTTP",
        "macAddress": "BananaRama",
        "channelID": 1,
        "dateTime": "2012-01-13T03:58:19+01:00",
        "activePostCount": 1,
        "eventType": "cidEvent",
        "eventState": "active",
        "eventDescription": "CID event",
        "CIDEvent": {
            "code": 3103,
            "standardCIDcode": 3130,
            "type": "zoneAlarm",
            "trigger": "2012-01-13T03:58:19+01:00",
            "upload": "2012-01-13T03:58:19+01:00",
            "CameraList": [],
            "NVRList": [
                {
                    "id": 1,
                    "ip": "192.168.1.32",
                    "port": 8000,
                    "channel": 1
                }
            ],
            "zone": 1
        }
    }
    "_msgid": "b07e50f6.86a72"
}

Output PIN 2 (connection error)

msg = {
    "topic": "",
    "errorDescription": "", // This will contain the error rescription, in case of errors.
    "payload": false, // Or TRUE if error
    "_msgid": "dd5b3622.884a78"
}

Output PIN 3 (Image)

msg = {
    "topic": "",
    "payload": image (Bytes),
    "extension": "jpg" // Can be "jpg" or "png"
}



ANPR (License Plate) NODE

This node works with Hikvision ANPR cameras.

Flow Messages

The payload contains the license plate number and the property plate contains other useful informations.

Output PIN 1

msg = {
    "topic":"",
    "payload":"AB123CD", // This is the license plate
    "plate":{
        "captureTime":"20201130T114200+0100",
        "plateNumber":"AB123CD",
        "picName":"202011301142008600", // This is the picture's name of the license plate.
        "country":"ITA",
        "laneNo":"1",
        "direction":"forward",
        "matchingResult":"otherlist"
        }
    }

Output PIN 2 (connection error)

msg = {
    "topic": "",
    "errorDescription": "", // This will contain the error rescription, in case of errors.
    "payload": false, // Or TRUE if error
    "_msgid": "dd5b3622.884a78"
}



PTZ NODE

Recalls a PTZ pre-recorded preset.
Just select the preset in the configuration window and recall it by passing true as payload.
You can also set the Camera Number and PTZ preset number by msg.payload.channelID (optional) and msg.payload.PTZPreset. See below.

Flow Messages

The node outputs true on PIN 1 if the command is executed, otherwise an error on PIN 2.

Input

// Recall the preset set in the configuration window
msg.payload = true; // Recalls the preset
return msg;
// Pass the Camera Number and PTZ preset by message
msg.payload.channelID = 1; // OPTIONAL, pass the Camera number
msg.payload.PTZPreset = 2; // OPTIONAL, pass the PTZ preset number
return msg;

Output PIN 1

msg = {
{
    "payload": true, // true after the camera has reached the PTZ preset position
    "_msgid": "b07e50f6.86a72"
}

Output PIN 2 (connection error)

msg = {
    "topic": "",
    "errorDescription": "", // This will contain the error rescription, in case of errors.
    "payload": false, // Or TRUE if error
    "_msgid": "dd5b3622.884a78"
}



PICTURE NODE

This node gets a picture from the camera/NVR, ready to be shown in the dashboard UI.
You can rotate, resize, crop, overlay with text, zoom the image.
The overlay text is applied directly after the picture's manipulation. This behaves differently than the text overlay node (that uses the overlay functionality onboard the camera).
Pass true as payload to obtain the image.
You can, for example, link the Camera Event node to the Picture node to get an image whenever an alarm occurs.
CAUTION: image handling is a very CPU/GPU consuming job. Use only if you have enough computational resources.


For the picture to show up directly into the flow, you can use this node developed by @riku

node-red-contrib-image-output



Copy this code and paste it into your flow

<summary>View code</summary>

Adjust the nodes according to your setup

[{"id":"bd6acbb81c4f9eaf","type":"change","z":"48095c5671f0ab16","name":"Setup msg","rules":[{"t":"set","p":"cid","pt":"msg","to":"","tot":"date"},{"t":"set","p":"attachments","pt":"msg","to":"[{\t \"filename\": 'image_' & $replace($now(),\":\",\"_\") & '.jpg', \t \"content\": $$.forEmail,\t \"cid\": \"\" & cid & \"\"\t}]","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"See attached image","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"''","tot":"jsonata"},{"t":"set","p":"from","pt":"msg","to":"info@mysupersmarthome.it","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":200,"wires":[["3e0ca3cc7c0d2e22"]]},{"id":"0b82f010bd682a0d","type":"hikvisionUltimatePicture","z":"48095c5671f0ab16","name":"Ovest","topic":"","server":"eb73371b.af5208","channelID":"7","rotateimage":"0","heightimage":"","widthimage":"","qualityimage":"100","cropimage":"","textoverlay":"","textoverlayXY":"","textoverlayWH":"","textoverlayFont":"FONT_SANS_64_WHITE","x":230,"y":200,"wires":[["bd6acbb81c4f9eaf","7ff4f0c75ef4d486"],[]]},{"id":"478fee35ffd435b5","type":"inject","z":"48095c5671f0ab16","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":200,"wires":[["0b82f010bd682a0d"]]},{"id":"facefd92c70af183","type":"comment","z":"48095c5671f0ab16","name":"Send an Email with image attachment and show it in the web UI","info":"","x":290,"y":160,"wires":[]},{"id":"7ff4f0c75ef4d486","type":"template","z":"48095c5671f0ab16","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img width=\"320px\" height=\"240px\" src=\"{{{payload}}}\">","output":"str","x":400,"y":260,"wires":[["121759fa66219f53"]]},{"id":"121759fa66219f53","type":"ui_template","z":"48095c5671f0ab16","group":"e2be830cd2d143a0","name":"","order":0,"width":"6","height":"4","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":560,"y":260,"wires":[[]]},{"id":"3e0ca3cc7c0d2e22","type":"function","z":"48095c5671f0ab16","name":"Email","func":"// Replace this function node with an email node","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":200,"wires":[[]]},{"id":"eb73371b.af5208","type":"Hikvision-config","host":"192.168.1.32","port":"80","name":"NVR","authentication":"digest","protocol":"http","heartbeattimerdisconnectionlimit":"1","deviceinfo":"[object Object]"},{"id":"e2be830cd2d143a0","type":"ui_group","name":"Default","tab":"e0f42233.22428","order":2,"disp":true,"width":"6","collapse":false},{"id":"e0f42233.22428","type":"ui_tab","name":"NVR","icon":"dashboard","order":13}]


PROPERTY WINDOW

Flow Messages

The node outputs the image in in mamy formats on PIN 1, otherwise an error on PIN 2. On PIN 1 you'll have:
base64 JPG string format, ready for the UI Dashboard.
JPG Buffer, ready to be sent as email attachment.
pure base64 format, for many other uses.
The Picture Node now passes through the input message, in the property msg.previousInputMessage

Input

// To get the image
msg.payload = true; 
return msg;
// Dinamically set the overlay text
node.textoverlay = "Hello new overlay";
msg.payload = true; 
return msg;

Output PIN 1

msg = {
{
    "previousInputMessage" : {topic : "banana"}, // this is the original passedthrough message
    "payload": "data:image/jpg;base64,/9j/4AAQSk...", // FOR THE DASHBOARD UI: Image as string in base64 format with JPG DATA header already there.
    "forEmail": "<buffer>", // FOR EMAIL: Image as buffer format, ready to be attached to an email as JPG attachment.
    "base64": "/9j/4AAQSk...", // FOR FURTHER MANIPULATION: Image as pure base64 string.
    "_msgid": "b07e50f6.86a72"
}
return msg;

Output PIN 2 (connection error)

msg = {
    "topic": "",
    "errorDescription": "", // This will contain the error rescription, in case of errors.
    "payload": false, // Or TRUE if error
    "_msgid": "dd5b3622.884a78"
}
return msg;



TEXT OVERLAY NODE

You can set the camera's text overlay. This node uses the camera's onboard text overlaying capabilities.
There are 4 rows avaiable, to be set from the configuration window or dinamically via msg input from flow.
Please note that not all cameras nor NVR/DVR (especially with old firmware) suppor setting the overlay text.

Copy this code and paste it into your flow

<summary>View code</summary>

Adjust the nodes according to your setup

[{"id":"7e79800b.afb8a8","type":"hikvisionUltimateText","z":"3f22f0c6.ff1328","name":"Overlay Text","server":"eb73371b.af5208","row1":"","row1XY":"","row2":"","row2XY":"","row3":"","row3XY":"","row4":"","row5XY":"","channelID":"1","x":510,"y":120,"wires":[]},{"id":"3aa8a40f.9a0964","type":"inject","z":"3f22f0c6.ff1328","name":"Go","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":120,"wires":[["7e79800b.afb8a8"]]},{"id":"2b4d9297.75ee46","type":"comment","z":"3f22f0c6.ff1328","name":"Set the overlay text","info":"","x":190,"y":80,"wires":[]},{"id":"22dc37f9.b3b86","type":"function","z":"3f22f0c6.ff1328","name":"MSG Override","func":"// Override one or more rows\n// You can use from row1 to row4 to set the text\n// and from row1XY to row4XY to set the position in the format x,y (for example: 100,200)\n\n// Optionally set the channel. On NVR, this indicates the camera number\nmsg.channelid = 1;\n\n// Row 1\nmsg.row1 = \"Temperature: \" + msg.payload;\nmsg.row1XY = \"100,200\"; // Optionallly set the position\n\n// Row 2 (here we leave the position previosly set via the camera menu)\nmsg.row2 = \"Sun\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":180,"wires":[["7e79800b.afb8a8"]]},{"id":"a91e43a0.ccbb2","type":"inject","z":"3f22f0c6.ff1328","name":"Go","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"22°c","payloadType":"str","x":170,"y":180,"wires":[["22dc37f9.b3b86"]]},{"id":"eb73371b.af5208","type":"Hikvision-config","host":"192.168.1.32","port":"80","name":"Server","authentication":"digest","protocol":"http","heartbeattimerdisconnectionlimit":"1","deviceinfo":"[object Object]"}]


Flow Messages

Pass anything you like as input msg, to set the text overlay.
You can override texts by passing some msg inputs. See samples below

Input

// Simply overlay the text set in the config window
msg.payload = true;
return msg;
// Override one or more rows
// You can use from row1 to row4 to set the text
// and from row1XY to row4XY to set the position in the format x,y (for example: 100,200)

// Optionally set the channel. On NVR, this indicates the camera number
msg.channelid = 1;

// Row 1
msg.row1 = "Temperature: " + msg.payload;
msg.row1XY = "100,200"; // Optionallly set the position

// Row 2 (here we leave the position previosly set via the camera menu)
msg.row2 = "Sun";

return msg;
// Delete all 4 rows
msg.row1 = "";
msg.row2 = "";
msg.row3 = "";
msg.row4 = "";
return msg;



XML NODE

This node allow you to send any XML you want to your devices.
Every device has own firmware, capabilities etc. so i decided to allow you to cover all your needs by adding this universal node.
Please read the ISAPI Hikvision documentation or dig into the Internet to learn what XML you can send. The limit is only your fantasy.



Flow Messages

You can override all properties configured in the node, by passing some msg inputs. See samples below

Input

// Send your own XML to the device
// You can override the default config, with all these optional properties
// msg.method must be PUT, POST or GET (all uppercase)

msg.XML = ``; // Here goes your XML. These strange chars after the = allow you to do multiline text
msg.path = ""; // For example /ISAPI/System/Video/inputs/channels/1/overlays
msg.method = "PUT"; // This must be PUT, POST or GET (uppercase)

return msg;

As an example, you can set a text overlay via XML

// Set an overlay text (if the camera supports overlaying text)

msg.XML = `<?xml version="1.0" encoding="UTF-8" ?>
<VideoOverlay version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema\">
<fontSize>1</fontSize>
<TextOverlayList size="6">
    <TextOverlay version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema\">
    <id>1</id>
    <enabled>true</enabled>
    <positionX>464</positionX>
    <positionY>96</positionY>
    <displayText>HELLO WORLD</displayText>
    </TextOverlay>
</TextOverlayList>
</VideoOverlay>`; // Here goes your XML. These strange chars after the = allow you to do multiline text
msg.path = "/ISAPI/System/Video/inputs/channels/1/overlays/text"; // For example /ISAPI/System/Video/inputs/channels/1/overlays
msg.method = "PUT"; // This must be PUT, POST or GET (uppercase)

return msg;

Output

The node will return the response from the camera.
For example, if you wish to know if your camera has motion detect enable, just pass this to the node

// Ask the camera if it supports motion detect
msg.path = "/ISAPI/System/Video/inputs/channels/1/motionDetection";
msg.method ="GET";
return msg;

The response will be something like this

{
   "topic":"Camera Sud",
   "payload":{
      "MotionDetection":{
         "$":{
            "version":"2.0",
            "xmlns":"http://www.hikvision.com/ver20/XMLSchema"
         },
         "enabled":"false",
         "enableHighlight":"true",
         "samplingInterval":"2",
         "startTriggerTime":"500",
         "endTriggerTime":"500",
         "regionType":"grid",
         "Grid":{
            "rowGranularity":"18",
            "columnGranularity":"22"
         },
         "MotionDetectionLayout":{
            "$":{
               "version":"2.0",
               "xmlns":"http://www.hikvision.com/ver20/XMLSchema"
            },
            "sensitivityLevel":"80",
            "layout":{
               "gridMap":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
            }
         },
         "enableWithMoving":"false"
      }
   },
   "_msgid":"fa45ddc3240240cf"
}

If an error occurs, the XML node will output a msg with the error

{
   "topic":"XML Node",
   "errorDescription":"network timeout at: http://192.168.1.211:80/ISAPI/System/Video/inputs/channels/1/motionDetection",
   "_msgid":"8289d3fbf2919d2b"
}



RAW CAMERA Event NODE

The RAW CAMERA Event node reacts to every message sent by the device. You can use this node when the other nodes doesn't fit your needs. It connects to NVR, Camera, Radars etc... and outputs the event received.
On the third pin, the node will output the event's picture (if any). You can save it directly to disk or user where you want.

Flow Messages

The node outputs a payload on PIN 1 that can vary, depending on the alarm type sent by the connected device.
The node outputs a payload on PIN 2, representing a connection error. TRUE if error, otherwise FALSE
This below is an example of msg output (in this case, a movement detected from a radar)

Output PIN 1

msg = {
    "topic": "",
    "type": "event",
    "payload": {
        "ipAddress": "192.168.1.25",
        "ipv6Address": "",
        "portNo": 80,
        "protocol": "HTTP",
        "macAddress": "banana",
        "channelID": 1,
        "dateTime": "2012-01-13T04:32:47+01:00",
        "activePostCount": 1,
        "eventType": "MultiRadarTargetEvent",
        "eventState": "active",
        "eventDescription": "MultiRadar Target Event",
        "MultiRadarTargetEventList": [
            {
                "targetID": 25,
                "isTargetDisappear": false,
                "targetType": "people",
                "Coordinate": {
                    "angle": 101.49,
                    "distance": 24.59
                },
                "speed": -0.2,
                "signalStrength": "strong",
                "TrackedInfoList": [],
                "trackedByIPC": false
            }
        ]
    }
}

Output PIN 2 (connection error)

msg = {
    "topic": "",
    "errorDescription": "", // This will contain the error rescription, in case of errors.
    "payload": false // Or TRUE if error
}

Output PIN 3 (Image)

msg = {
    "topic": "",
    "type": "img",
    "payload": image,
    "extension": "jpg" // Can be "jpg" or "png"
}



DOORBELL NODE

The doorbell node allow you to receive ring/call progress events, open the doors, hangup calls and other things from hikvision and hik compatible doorbells.
Everytime ad intercom sends a message to the node, this message is validated using the filters you selected in the configuration window. In case of a match, it emits a msg to the flow.
There are many filters you can apply (ringStatus (ring or on call), floor number, unit number, building number and so on.).

Copy this code and paste it into your flow

<summary>View code</summary>

Adjust the nodes according to your setup

[{"id":"22420ca523840eef","type":"hikvisionUltimateDoorbell","z":"48095c5671f0ab16","name":"","topic":"","server":"085ef798e6c04064","ringStatus":"all","floorNo":"all","unitNo":"all","zoneNo":"all","buildingNo":"all","x":360,"y":180,"wires":[["5d1eddc07a46bd2c"],["7b5813c6cd794885"]]},{"id":"5d1eddc07a46bd2c","type":"debug","z":"48095c5671f0ab16","name":"Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":160,"wires":[]},{"id":"7b5813c6cd794885","type":"debug","z":"48095c5671f0ab16","name":"Error report","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":200,"wires":[]},{"id":"a1032b3b72cf9db6","type":"inject","z":"48095c5671f0ab16","name":"Open Door","props":[{"p":"openDoor","v":"1","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":160,"wires":[["22420ca523840eef"]]},{"id":"54590a36f409ce0f","type":"inject","z":"48095c5671f0ab16","name":"Hang Up","props":[{"p":"hangUp","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"8","topic":"","x":180,"y":200,"wires":[["22420ca523840eef"]]},{"id":"2388a3941360bd3c","type":"comment","z":"48095c5671f0ab16","name":"Doorbell sample. Caution: \"Open Door\" will open your door.","info":"","x":330,"y":120,"wires":[]},{"id":"085ef798e6c04064","type":"Doorbell-config","host":"192.168.1.5","port":"80","name":"OUTDOOR STATION","authentication":"digest","protocol":"http","heartbeattimerdisconnectionlimit":"1","deviceinfo":"{\"DeviceInfo\":{\"$\":{\"version\":\"2.0\",\"xmlns\":\"http://www.isapi.org/ver20/XMLSchema\"},\"deviceName\":\"OUTDOOR STATION\",\"deviceID\":\"7d49925b-4fc7-406b-a0ec-2ca59cc25838\",\"deviceDescription\":\"\\tVis\",\"deviceLocation\":\"STD-CGI\",\"systemContact\":\"STD-CGI\",\"model\":\"DS-KV6113-WPE1(B)\",\"serialNumber\":\"DS-KV6113-WPE1(B)0120210416RRF86332026\",\"macAddress\":\"24:18:c6:39:42:29\",\"firmwareVersion\":\"V2.2.50\",\"firmwareReleasedDate\":\"build 210630\",\"bootVersion\":\"33685554\",\"bootReleasedDate\":\"1377822\",\"hardwareVersion\":\"0x0\",\"encoderVersion\":\"V4.0\",\"encoderReleasedDate\":\"build 181206\",\"deviceType\":\"\\tVis\",\"telecontrolID\":\"88\",\"supportBeep\":\"true\",\"supportVideoLoss\":\"true\",\"alarmOutNum\":\"2\",\"alarmInNum\":\"4\",\"RS485Num\":\"1\",\"customizedInfo\":\"\"}}"}]

Flow Messages

Input

The node accepts messages from the flow.
See these messages you can pass to it:

OPEN THE DOOR LATCHES

// Open the door. 
msg.openDoor = 1; // Pass the door number to open as value, in this case, 1.
return msg;

HANG UP THE CURRENT CALL AND STOP RINGING

// Hangup the current call and stop ringing 
msg.hangUp = true; 
return msg;


Output

The node outputs a payload on PIN 1 that can vary, depending on the event type sent by the connected intercom.
Anyway, it emits always a payload = *true as soon as an intercom message matching filters you configured in the configuration window, arrives. You can use that payload to trigger events. The node outputs a payload on PIN 2, representing a connection error. TRUE if error, otherwise FALSE
This below is an example of msg output

Output PIN 1

msg = {
   "CallerInfo":{
      "buildingNo":1,
      "floorNo":1,
      "zoneNo":1,
      "unitNo":1,
      "devNo":88,
      "devType":1,
      "lockNum":1,
      "status":"idle"
   },
   "topic":"",
   "payload":true
}

Output PIN 2 (connection error)

msg = {
    "topic": "",
    "errorDescription": "", // This will contain the error rescription, in case of errors.
    "payload": false // Or TRUE if error
}



AX PRO Alarm node (Ax Pro and AX Pro Hybrid)

This node receives all events sent by your AX Pro alarm.
You will receive not only Alarms etc, but also zone status, even if the AX Pro is disarmed.
You can also arm, disarm, silence alarm etc...

Copy this code and paste it into your flow

<summary>View code</summary>

Adjust the nodes according to your setup


[{"id":"7c370c1cabe6fd89","type":"hikvisionUltimateAxPro","z":"e9a7cd97842ffa10","name":"Ax Pro","topic":"","server":"2dfc48091d46ead3","outputtype":"0","x":350,"y":200,"wires":[["893818dce1fc2c20"],["01e634bd9098e528"]]},{"id":"893818dce1fc2c20","type":"debug","z":"e9a7cd97842ffa10","name":"Event","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":180,"wires":[]},{"id":"01e634bd9098e528","type":"debug","z":"e9a7cd97842ffa10","name":"Connection Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":260,"wires":[]},{"id":"ddc2d752e0c13937","type":"inject","z":"e9a7cd97842ffa10","name":"Disarm Area 1","props":[{"p":"disarmArea","v":"1","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":280,"wires":[["7c370c1cabe6fd89"]]},{"id":"b33ec376180a53bc","type":"inject","z":"e9a7cd97842ffa10","name":"Arm Away Area 1","props":[{"p":"armAwayArea","v":"1","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":140,"y":160,"wires":[["7c370c1cabe6fd89"]]},{"id":"6145bfa8991c1831","type":"inject","z":"e9a7cd97842ffa10","name":"Arm Stay Area 1","props":[{"p":"armStayArea","v":"1","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":140,"y":200,"wires":[["7c370c1cabe6fd89"]]},{"id":"189b2eb17cb67a52","type":"inject","z":"e9a7cd97842ffa10","name":"Clear Alarm Area 1","props":[{"p":"clearAlarmArea","v":"1","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":240,"wires":[["7c370c1cabe6fd89"]]},{"id":"40ce4b0d34bedf21","type":"comment","z":"e9a7cd97842ffa10","name":"Hikvision AX Pro Alarm Control and Event receiver","info":"","x":230,"y":120,"wires":[]},{"id":"2dfc48091d46ead3","type":"AXPro-config","host":"192.168.1.10","port":"80","name":"AX Pro","authentication":"sha256-salted","protocol":"http","heartbeattimerdisconnectionlimit":"2","deviceinfo":"[object Object]"}]
// FOR CID EVENTS 
CIDEvent: {
   "code":1401, // This is the reference code of the event. Please see the ISAPI docs or try by yourself, by watching the output while playing with your alarm
   "name":"Supergiovane",
   "type":"armAndDisarm",
   "trigger":"2022-12-22T17:33:56+01:00",
   "upload":"2022-12-22T17:33:56+01:00",
   "system":1,
   "subSystemName":"Casa"
}
// FOR ZONE UPDATE EVENT
zoneStatus: {
   "id":1,
   "name":"Zona cablata 2",
   "status":"trigger",
   "sensorStatus":"normal",
   "magnetOpenStatus":true,
   "tamperEvident":false,
   "shielded":false,
   "bypassed":false,
   "armed":false,
   "isArming":false,
   "alarm":false,
   "reason":"break",
   "subSystemNo":1,
   "linkageSubSystem":[
      1
   ],
   "detectorType":"magneticContact",
   "stayAway":false,
   "zoneType":"Instant",
   "accessModuleType":"localTransmitter",
   "moduleChannel":2,
   "zoneAttrib":"wired",
   "deviceNo":3,
   "abnormalOrNot":false
}

CID Events common codes

CID Events refers to a field "code" in the Alarm event output
The most common event codes are: 3401 (Arm Away), 3441 (Arm Stay), 1401 (Disarmed), 1759 (Intrusion Alarm)
For other codes, please see the list below. You can find it here as well

> > > > >



Access Control Terminal node

This node receives all events sent by your access control terminal, like, for example the DS-K1T502DBFWX-C.
The node emits the payload as soon as it receives the event.
You can filter by any type of event, alarm, exception, etc, or you can accept all incoming events



Flow Messages

This is an example of payload.

Output


{
   "topic":"",
   "payload":{
      "major":5,
      "minor":21,
      "time":"2023-03-18T18:37:54+01:00",
      "netUser":"",
      "doorNo":1,
      "type":0,
      "serialNo":735,
      "eventDescription":"(EVENT) Door Ulock",
      "currentVerifyMode":"faceOrFpOrCardOrPw"
   },
   "connected":true
}


Speaker node

This node connects to your Hikvision Speaker and broadcast a selected audio file, that must be already been uploaded to the speaker.
Please see the help into the Node-Red help tab for further infos.

Logo

changelog

Donate via PayPal

Version 1.2.10 May 2025
- Fixed this: https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/issues/84#event-17587603634

Version 1.2.8 May 2025
- Housekeeping.
- Optimized hikvision stream for some devices.

Version 1.2.6 January 2025
- AX Pro: fixed msg.clearAllAlarmAreas input property, that was clearing only the area number 1.
- AX Pro: fixed msg.disarmAllAreas input property, that was disarming only the area number 1.

Version 1.2.5 December 2024
- Doorbell: Disabled some XML parser error logs.

Version 1.2.4 December 2024
- Doorbell: fixed an issue introduced with 1.2.3, preventing the door to be open.

Version 1.2.1 September 2024
- AX Pro: fixed an issue where occasionally, when malformed multipart data is sent from the AX Pro, there would be no NAK.

Version 1.2.0 September 2024
- RAW Event Node: on the third pin, outputs the IMAGE related to the event (if any). The node will now filter the heartbeat signals.
- Event Node: on the third pin, outputs the IMAGE related to the event (if any).

Version 1.1.22 August 2024
- IP Speaker node: added help.

Version 1.1.21 August 2024
- NEW: IP Speaker node: play preloaded audio files from an IP Speaker.

Version 1.1.20 Mai 2024
- AX Pro node: added msg.disarmAllAreas, msg.clearAlarmArea and msg.clearAllAlarmAreas. See the help tab in node-red for fuhrter infos

Version 1.1.19 April 2024
- ANPR: fixed an issue it the plate's list parser in cameras having ISAPI protocol 1.0.

Version 1.1.17 April 2024
- ANPR: fixed an issue it the plate's list parser. Thanks @jpgnz.
- Fixed the node icons not showing up.

Version 1.1.16 April 2024
- Fixed somme try-catch functions.

Version 1.1.15 April 2024
- Doorbel node: fixed a crash if you send msg.hangUp = true, when the doorbell cannot be reached.

Version 1.1.14 January 2024
- Fixed sintax errors in some dropdown list. Thanks to @pmattia90

Version 1.1.13 October 2023
- Refined some function and start to write the help TAB of Node-Red.
- Added the debug level option.

Version 1.1.12 October 2023
- Silenced the log error, while error occurs fetching the http socket.

Version 1.1.11 August 2023
- Bump Jimp.

Version 1.1.9 April 2023
- FIX: Access Control Node: workarounded bug in some hik firmwares, not correctly sorting the events received.

Version 1.1.8 March 2023
- Access Control Node: added eventdescription in the payload message.

Version 1.1.6 March 2023
- Optimization/bugfix to Access Control Terminal, node event handling after NTP time set.

Version 1.1.5 March 2023
- NEW: Added the Access Control Terminal node.

Version 1.1.2 January 2023
- FIX: trying to fix the "reject" and "hangUp" function, sent to Door Station using the new V2 protocol.

Version 1.1.1 January 2023
- NEW: added an online device list in the camera/nvr configuration node, to visually help the user.

Version 1.1.0 January 2023
- Removed xml2js package and replaced it with fast-xml-parser.
- Fixed other memory issues when there are a lot of cameras in the flow.

Version 1.0.71 January 2023
- FIX: fixed error MaxEventListener, occurring in case of sudden Camera LAN disconnection. This was due to the xml2js function.
- AX Pro node is out of the beta phase and has been released.

Version 1.0.70 December 2022
- NEW: AX Pro node: you can now filter by Alarm events, Zone status changes, or have both as output.
- Begin standardizing help in the "help" panel of node-red, starting with AX Pro node.

Version 1.0.69 December 2022
- Some bugfixes.

Version 1.0.67 December 2022
- NEW: AX Pro node now outputs alarm events and also zone status (even if the alarm is disarmed).
- Updated Ajax Pro Wiki.

Version 1.0.66 December 2022
- NEW: new AX Pro and AX Pro Hybrid node. These panels require a totally different authentication and handling, so i made another node just for that. You can receive events and also control your security system
- EDIT: changed the node name from "Alarm" and "RAW Alarm" to "Event" and "RAW Event" to avoid confusion with the new AX Pro node.
- Fixed stability issue with the new AX Pro node.

Version 1.0.64 September 2022
- Not all Hikvision door intercom does have the proper APIs to connect to. Added warning.
- Add: The Picture Node now passes through the input message, in the property msg.previousInputMessage

Version 1.0.63 August 2022
- Maintenance release. Optimized the scope of some variables.
- Aded a Warning on the README page.

Version 1.0.62 Juni 2022
- Maintenance release. Fixed an issue with node-fetch v3 incompatibility.

Version 1.0.61 April 2022
- Maintenance release. Bumped required depencencies.

Version 1.0.60 January 2022
- Maintenance release. Removed the device compatiblility list from the bottom of the readme page, because with the new Doorbell Hik devices (that i haven't and i cannot test with), this list isn't realistic anymore.

Version 1.0.59 January 2022
- FIX for some couple NVR/firmware, not behaving standard with the heartbeat.

Version 1.0.58 December 2021
- FIX a possible error in wrong XML returned by the node, if node-red runs under IOBroker, having an old XML parser version.

Version 1.0.57 November 2021
- NEW: PTZ Node: you can now pass the channelID and PTZ preset number by msg.payload.

Version 1.0.56 November 2021
- Workaround for an issue in a js library used by hikvision-ultimate.

Version 1.0.54 October 2021
- NEW: the XML Node can now emit a message containing the response from the camera. You can now ask a camera for anything (for example if the motion detect is enabled) and get the response in JSON format. See the gitHub README on how to do that.

Version 1.0.53 September 2021
- FIX: Doorbell node now correctly emits error on the second PIN instead of the first output PIN.

Version 1.0.52 September 2021
- NEW: Doorbell node (you can be notified on ringing, on call and even open the door). Thanks @ur5zeb for help in testing.

Version 1.0.51 August 2021
- FIX: XML Node do not retain the XML text.

Version 1.0.50 Juli 2021
- You can now connect to devices using HTTPS with a self signed certificate. Preiouusly, the node was given an SSL warning and refuse to connect.

Version 1.0.49 Juli 2021
- NVR: fixed an issue causing the node not detecting the channel ID on some NVR type "NX..".

Version 1.0.48 June 2021
- Minor fix.

Version 1.0.47 April 2021
- Alarm node: fixed an issue where the camera won't emit the intrusion detection event start, but only the end. Workaround for that.

Version 1.0.43 April 2021
- ANPR: Fixed the authentication type (digest/basic) not retained.
- ANPR: Fixed the error message visible if you have one and only ANPR camera in your flow.

Version 1.0.42 April 2021
- Server node: the port config was totally ignored. Fixed, now you can set the port as well and it works. Thanks to @Mateiuc.

Version 1.0.41 April 2021
- Picture Image: Better handling of automatic URLs selection.
- Picture Image: fixed a false status whenever an alarm node receives an alarm.

Version 1.0.38 April 2021
- Fidex a syntax error checking an url.

Version 1.0.37 April 2021
- Fidex an issue in the new function of picture node.

Version 1.0.35 April 2021
- PICTURE node is now compatible with hybrid NVR both for analog and for IP cameras. Thanks to smcgann99 for raising the issue.

Version 1.0.33 February 2021
- Filter null payloads in picture node, in case the device you're connecting to, is an hybrid DVR/NVR.
- Fixed some glitches it the sample code on the README page.

Version 1.0.31 February 2021
- FIX: sometime, the IMAGE node fails to show the text overlay.
- NEW: the IMAGE outputs a pure base64 image format as well as image buffer ready to be attached to an email.

Version 1.0.30 January 2021
- Nasty ANPR camera fix: it has happened to me, that the cam's plate list had some odd item order. This caused me some problem. The ANPR node has been changed to overcome any sort of oddness in the camera plate list returnet by the camera itself.
- NEW: XML Node. You can now send what you want to your device. See the README in gitHub.

Version 1.0.29 January 2021
- Text overlay node: you can now use it with NVR. Channel selection is also avaiable now.

Version 1.0.28 January 2021
- BREAKING CHANGE: the Radar node is now part of the Alarm node. The Radar node has been deleted.
- NEW: the Alarm node can now filter for channels and zones as well. SOME ADJUSTMENT TO YOUR FLOW MAY BE NEEDED.
- NEW: Text overlay node: you can set the camera's 4 rows overlay text.

Version 1.0.27 January 2021
- NEW: Text overlay in the picture node. You can also set the position and font. The text can be set with msg.textoverlay as well.

Version 1.0.26 January 2021
- Fixed an unwanted LOG in case you have a picture node asking for an image to an unconnected camera.

Version 1.0.25 January 2021
- Minor fixes in alarm filter.

Version 1.0.24 January 2021
- FIX: all nodes won't emit a topic property. Has been fixed.
- NEW: you can now filter false alarms in the radar node.

Version 1.0.22 December 2020
- NEW: you can now choose how much times the node server should try to reconnect to the Hik device, before emitting the connection error on PIN 2. This is useful in case of problematic LANs, like VPN or very slow Wireless 3G connections.

Version 1.0.20 December 2020
- NEW: you can now choose to tell Supergiovane (the developer) that your camera model works with the node. You'll help other users. The list will be shown here https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/blob/master/TESTEDWITH.md

Version 1.0.18 December 2020
- FIX: node topic wasn't retent on all nodes.

Version 1.0.16 December 2020
- CHANGE: the node should now work with node version below 10.0.0, but it's recommended anyway to update.
- FIX: on some setups, the alarm stream wasn't received. Thanks @oliveres for signalling this issue.

Version 1.0.15 December 2020
- FIX: getting rid of promise rejection error log in the hikconfig-node, whenever a conneciton error occurs.

Version 1.0.14 December 2020
- Picture Node: support for NVR with max 32 channels.
- Radar Node: support for max 16 alarm zones.
- FIX: the "connect" button in the config node doesn't work if this is the first node ever. A message will show, to tell you to save, deploy and re-enter the config node again.

Version 1.0.12 December 2020
- NEW: You can now get info from the camera by pressing CONNECT button in the config window, even if the server node is new and it hasn't been saved.
- CHANGE: The Picture Node has now a button to reload the image, so you can view the changes in size etc.. just in time.

Version 1.0.10 December 2020
- NEW: You can now get info from the camera by pressing CONNECT button in the config window.

Version 1.0.9 December 2020
- NEW: Picture node, you can now CROP the image, to obtain a zoomed portion, for example, of a door or things like this.
- NEW: Picture node, the config window shows the actual picture you see, including all image manipulation you've done through settings.

Version 1.0.7 December 2020
- NEW: Picture node, you can now set the output quality, from 10 to 100.

Version 1.0.6 December 2020
- Increased timeout for situation where the connection is via VPN or very slow. Thanks @Georg for suggesting this thing.

Version 1.0.5 December 2020
- NEW: Picture node. This node get a picture from camera, ready to be shown in the dashboard UI. The image can be rotated and resized.

Version 1.0.4 December 2020
- Getting rid of old debug logs. Thanks @oliveres for advice.

Version 1.0.3 December 2020
- NEW: Added help links to the config windows.

Version 1.0.2 December 2020
- NEW: PTZ preset recall node, for PTZ cameras. Just pass payload TRUE to the node to recall the preset.

Version 1.0.1 December 2020
- NEW: added more events to the alarm node.
- Changed icon of alarm node.

Version 1.0.0 FIRST OFFICIAL VERSION December 2020
- NEW: added Generic Alarm node.
- NEW: added warning in the node-red log, specify that the node requires Node V.10.0.0 or newer.

Version 0.0.25 GA VERSION WITH STABLE BEHAVOUR December 2020
- Fine tuning some msg handlers.
- Debug mode avaiable. Just type banana after the server ip, for example 192.168.1.5banana

Version 0.0.24 GA VERSION WITH STABLE BEHAVOUR December 2020
- Better handling of malformed alert messages.

Version 0.0.23 GA VERSION WITH STABLE BEHAVOUR December 2020
- NEW: added "http" and "https" protocol selection.

Version 0.0.22 GA VERSION WITH STABLE BEHAVOUR December 2020
- NEW: added "basic" authentication as well.

Version 0.0.21 GA VERSION WITH STABLE BEHAVOUR December 2020
- Changed timeout in hearthbeat. More relaxed, to avoid false disconnections messages.

Version 0.0.20 GA VERSION WITH STABLE BEHAVOUR December 2020
- NEW: added the PIN 2 for signalling errors.

Version 0.0.19 LAST BETA BEFORE STABLE RELEASE December 2020
- Better handling of status messages.

Version 0.0.18 BETA December 2020
- BUGFIX: fixed a vaccata in handling boundary of stream pipeline.
- BUGFIX: fixed a minchiata in ANPR node, where if the alarmed zone was 0, the node outputs "unknown zone".
- Fixed Radar alarm zone. Zone number in ISAPI is base 0, while in the UI is base 1.
- BUGFIX: ANPR - fixed array handling when returning a single plate.

Version 0.0.16 BETA December 2020
- NEW: added Radar Node for trapping radar zone's alarms.
- Radar Node allow for alarm filter (all zone or specific zone)

Version 0.0.15 BETA December 2020
- Moved RAW node code into async functions.
- Fixed BUG in ANPR module, where the last plate was sent every second..
- Added icons.

Version 0.0.14 BETA December 2020
- Moved ANPR code into async functions, do help very slow PC's to correctly handle the data.

Version 0.0.13 BETA December 2020
- Moved ANPR code into async functions, do help very slow PC's to correctly handle the data.

Version 0.0.12 BETA November 2020
- Added support for devices sending XML as well as for devices sending JSON.

Version 0.0.11 BETA November 2020
- Added an option to the ANPR node, to filter repeating plates in a timeframe.

Version 0.0.9 BETA November 2020
- Replaced the node urllib with node-fetch.
- Alert node now filters heartbeath without sending unuseful payloads.

Version 0.0.8 BETA November 2020
- ANPR node now emits connect and disconnect messages. - Fixes and improvements.

Version 0.0.7 BETA November 2020
- ANPR node now works and correclty handles the plates queue by disregarding old plates. - Fixes and improvements.

Version 0.0.6 BETA November 2020
- Automatic reconnection and error handling. Resilency is done.

Version 0.0.4 BETA November 2020
- Added ANPR License Plate Node.

Version 0.0.3 BETA November 2020
- Added connection checks and reconnection.

Version 0.0.1 BETA November 2020
- First BETA