node-red-contrib-hikvision-ultimate
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -5,2 +5,7 @@ # node-red-contrib-hikvision-ultimate | ||
<p> | ||
<b>Version 1.0.1</b> December 2020<br/> | ||
- NEW: added more events to the alarm node.<br/> | ||
- Changed icon of alarm node.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.0 FIRST OFFICIAL VERSION</b> December 2020<br/> | ||
@@ -7,0 +12,0 @@ - NEW: added Generic Alarm node.<br/> |
@@ -8,3 +8,3 @@ | ||
node.server = RED.nodes.getNode(config.server) | ||
node.reactto = (config.reactto === null || config.reactto === undefined) ? "vmd" : config.reactto;// Rect to alarm coming from... | ||
node.reactto = (config.reactto === null || config.reactto === undefined) ? "vmd" : config.reactto.toLowerCase();// Rect to alarm coming from... | ||
@@ -41,10 +41,16 @@ node.setNodeStatus = ({ fill, shape, text }) => { | ||
// check alarm filter | ||
if (sAlarmType === node.reactto) { | ||
var oRetMsg = {}; // Return message | ||
oRetMsg.payload = bAlarmStatus; | ||
oRetMsg.description = (_msg.payload.hasOwnProperty("eventDescription") ? _msg.payload.eventDescription : ""); | ||
node.send([oRetMsg, null]); | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "Alarm " + (bAlarmStatus === true ? "start" : "end") }); | ||
} | ||
var aReactTo = node.reactto.split(","); // node.reactto can contain multiple names for the same event, depending from firmware | ||
for (let index = 0; index < aReactTo.length; index++) { | ||
const element = aReactTo[index]; | ||
if (element !== null && element !== undefined && element.trim() !== "" && sAlarmType === element) { | ||
var oRetMsg = {}; // Return message | ||
oRetMsg.payload = bAlarmStatus; | ||
oRetMsg.channelid = (_msg.payload.hasOwnProperty("channelID") ? _msg.payload.channelID : "0"); | ||
oRetMsg.description = (_msg.payload.hasOwnProperty("eventDescription") ? _msg.payload.eventDescription : ""); | ||
node.send([oRetMsg, null]); | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "Alarm " + (bAlarmStatus === true ? "start" : "end") }); | ||
return; // Find first occurrence, exit. | ||
} | ||
} | ||
} | ||
@@ -51,0 +57,0 @@ } |
{ | ||
"name": "node-red-contrib-hikvision-ultimate", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A native set of node for Hikvision Cameras, Alarms, Radars etc.", | ||
@@ -5,0 +5,0 @@ "author": "Supergiovane (https://github.com/Supergiovane)", |
131
README.md
@@ -29,65 +29,3 @@ # node-red-contrib-hikvision-ultimate | ||
## - RAW Alarm Node | ||
The RAW alarm node connects to ***NVR, Camera, Alarm system, Radars etc...*** and outputs the alarm received. <br/> | ||
<img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/img/RawAlarm.png' width="80%"> | ||
**Output message** | ||
The node outputs a payload on **PIN 1** that can vary, depending on the alarm type sent by the connected device.</br> | ||
The node outputs a payload on **PIN 2**, representing a connection error. ***TRUE*** if error, otherwise ***FALSE***</br> | ||
This below is an example of msg output (in this case, a movement detected from a radar)</br> | ||
**Output PIN 1** | ||
```javascript | ||
msg.payload = { | ||
"topic": "", | ||
"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 | ||
} | ||
] | ||
}, | ||
"_msgid": "dba1850a.2dc5e8" | ||
} | ||
``` | ||
**Output PIN 2 (connection error)** | ||
```javascript | ||
msg = { | ||
"topic": "", | ||
"errorDescription": "", // This will contain the error rescription, in case of errors. | ||
"payload": false, // Or TRUE if error | ||
"_msgid": "dd5b3622.884a78" | ||
} | ||
``` | ||
<br/> | ||
<br/> | ||
--- | ||
## - Alarm node | ||
## ALARM NODE | ||
The alarm node connects to ***NVR, Camera, Alarm system, Radars etc...*** and outputs true/false whenever an alarm occurs. <br/> | ||
@@ -116,7 +54,7 @@ | ||
```javascript | ||
msg.payload = { | ||
{"payload":true, // True if alarm starts, false if ends. | ||
msg = { | ||
"payload":true, // True if alarm starts, false if ends. | ||
"channelid":"1", // If you have many video channels on your camera, this represents the channel number. | ||
"description":"Motion alarm", // Type of alarm | ||
"_msgid":"28f2b9e6.7c74f6" | ||
} | ||
} | ||
@@ -139,3 +77,3 @@ ``` | ||
## - ANPR (License Plate) Node | ||
## ANPR (License Plate) NODE | ||
This node works with Hikvision ANPR cameras.<br/> | ||
@@ -180,3 +118,3 @@ | ||
## - Radar Alarm Node | ||
## RADAR ALARM NODE | ||
This node works with Hikvision Radars.<br/> | ||
@@ -242,10 +180,67 @@ | ||
``` | ||
<br/> | ||
<br/> | ||
--- | ||
## RAW ALARM NODE | ||
The RAW alarm node reacts to every message sent. You can use this node when the other nodes doesn't fit your needs. It connects to ***NVR, Camera, Alarm system, Radars etc...*** and outputs the alarm received. <br/> | ||
<img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/img/RawAlarm.png' width="80%"> | ||
**Output message** | ||
The node outputs a payload on **PIN 1** that can vary, depending on the alarm type sent by the connected device.</br> | ||
The node outputs a payload on **PIN 2**, representing a connection error. ***TRUE*** if error, otherwise ***FALSE***</br> | ||
This below is an example of msg output (in this case, a movement detected from a radar)</br> | ||
**Output PIN 1** | ||
```javascript | ||
msg.payload = { | ||
"topic": "", | ||
"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 | ||
} | ||
] | ||
}, | ||
"_msgid": "dba1850a.2dc5e8" | ||
} | ||
``` | ||
**Output PIN 2 (connection error)** | ||
```javascript | ||
msg = { | ||
"topic": "", | ||
"errorDescription": "", // This will contain the error rescription, in case of errors. | ||
"payload": false, // Or TRUE if error | ||
"_msgid": "dd5b3622.884a78" | ||
} | ||
``` | ||
![Logo](https://raw.githubusercontent.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/img/madeinitaly.png) | ||
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg | ||
@@ -252,0 +247,0 @@ [license-url]: https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/LICENSE |
Sorry, the diff of this file is not supported yet
361056
28
741
247