New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-knx-ultimate

Package Overview
Dependencies
Maintainers
1
Versions
461
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-knx-ultimate - npm Package Compare versions

Comparing version

to
1.1.28

img/config/connectioneibnettunneling.png

10

CHANGELOG.md

@@ -8,2 +8,8 @@ # node-red-contrib-knx-ultimate

<p>
<b>Version 1.1.28</b><br/>
- New: Added topic property<br/>
- New: added page to wiki, explaining the node protection. <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/-Protections" target="_blank">Node Protections</a>.<br/>
- Updated Wiki to reflect the new changes.<br/>
</p>
<p>
<b>Version 1.1.27</b><br/>

@@ -94,3 +100,3 @@ - New: added payloadmeasureunit to the node's msg output (for example "W" or "%"), based on Datapoint type.<br/>

- Auto send node value as response to the KNX Bus. It works in conjunction with React to event GroupValue read. When checked, whenever the node receives a read request from bus, it sends a response to the KNX Bus with the stored payload value.<br/>
- Fixed an issue where if you have a node set to Universal mode (listen to all Group Addresses) (with ETS CSV File set) and you create a new node having a Group Address (topic) not in the ETS CSV file, an exception is raised but not caught and the nodes may not receive the values from KNX BUS.<br/>
- Fixed an issue where if you have a node set to Universal mode (listen to all Group Addresses) (with ETS CSV File set) and you create a new node having a Group Addr. not in the ETS CSV file, an exception is raised but not caught and the nodes may not receive the values from KNX BUS.<br/>
</p>

@@ -173,3 +179,3 @@ <p>

<b>Version 1.0.7</b><br/>
- Check for invalid node's group address (topic)<br/>
- Check for invalid node's Group Addr.<br/>
</p>

@@ -176,0 +182,0 @@ <p>

28

knxUltimate-config.js

@@ -83,3 +83,3 @@ const knx = require('knx')

node.loglevel = config.loglevel !== undefined ? config.loglevel : "info"; // 06/02/2020 by Heleon19 Loglevel default info
// Endpoint for reading csv from the other nodes

@@ -146,7 +146,7 @@ RED.httpAdmin.get("/knxUltimatecsv", RED.auth.needsPermission('knxUltimate-config.read'), function (req, res) {

if (typeof _Node.topic == "undefined" || typeof _Node.dpt == "undefined") {
_Node.setNodeStatus({ fill: "red", shape: "dot", text: "Empty group address (topic) or datapoint.",payload: "", GA: "", dpt:"", devicename:"" })
_Node.setNodeStatus({ fill: "red", shape: "dot", text: "Empty Group Addr. or datapoint.",payload: "", GA: "", dpt:"", devicename:"" })
return;
} else {
// Topic must be in formar x/x/x
// topic must be in formar x/x/x
if (_Node.topic.split("\/").length < 3) {

@@ -321,3 +321,3 @@ _Node.setNodeStatus({ fill: "red", shape: "dot", text: "Wrong group address (topic: " + _Node.topic + ") format.",payload: "", GA: "", dpt:"", devicename:"" })

// 25/10/2019 from v. 1.1.11, try to decode and output a datapoint.
let msg = buildInputMessage(src, dest, evt, rawValue, tryToFigureOutDataPointFromRawValue(rawValue, dest), "")
let msg = buildInputMessage(src, dest, evt, rawValue, tryToFigureOutDataPointFromRawValue(rawValue, dest), "", dest);
input.setNodeStatus({ fill: "green", shape: "dot", text: "Try to decode", payload: msg.payload, GA: msg.knx.destination, dpt: "", devicename: "" });

@@ -328,3 +328,3 @@ input.send(msg)

} else {
let msg = buildInputMessage(src, dest, evt, rawValue, oGA.dpt, oGA.devicename)
let msg = buildInputMessage(src, dest, evt, rawValue, oGA.dpt, oGA.devicename, dest);
input.setNodeStatus({ fill: "green", shape: "dot", text: "", payload: msg.payload, GA: msg.knx.destination, dpt: msg.knx.dpt, devicename: msg.devicename });

@@ -339,3 +339,3 @@ input.send(msg)

} else {
let msg = buildInputMessage(src, dest, evt, rawValue, input.dpt, input.name ? input.name : "")
let msg = buildInputMessage(src, dest, evt, rawValue, input.dpt, input.name ? input.name : "", input.outputtopic)
// Check RBE INPUT from KNX Bus, to avoid send the payload to the flow, if it's equal to the current payload

@@ -370,3 +370,3 @@ if (!checkRBEInputFromKNXBusAllowSend(input, msg.payload)) {

if (typeof oGA === "undefined") {
let msg = buildInputMessage(src, dest, evt, rawValue, tryToFigureOutDataPointFromRawValue(rawValue, dest), "")
let msg = buildInputMessage(src, dest, evt, rawValue, tryToFigureOutDataPointFromRawValue(rawValue, dest), "", dest)
input.setNodeStatus({ fill: "green", shape: "dot", text: "Try to decode", payload: msg.payload, GA: msg.knx.destination, dpt: "", devicename: "" });

@@ -377,3 +377,3 @@ input.send(msg)

} else {
let msg = buildInputMessage(src, dest, evt, rawValue, oGA.dpt, oGA.devicename)
let msg = buildInputMessage(src, dest, evt, rawValue, oGA.dpt, oGA.devicename, dest)
input.setNodeStatus({ fill: "blue", shape: "dot", text: "", payload: msg.payload, GA: msg.knx.destination, dpt: msg.knx.dpt, devicename: msg.devicename });

@@ -389,3 +389,3 @@ input.send(msg)

} else {
let msg = buildInputMessage(src, dest, evt, rawValue, input.dpt, input.name ? input.name : "")
let msg = buildInputMessage(src, dest, evt, rawValue, input.dpt, input.name ? input.name : "", input.outputtopic)
// Check RBE INPUT from KNX Bus, to avoid send the payload to the flow, if it's equal to the current payload

@@ -422,3 +422,3 @@ if (!checkRBEInputFromKNXBusAllowSend(input, msg.payload)) {

// 25/10/2019 from v. 1.1.11, try to decode and output a datapoint.
let msg = buildInputMessage(src, dest, evt, null, tryToFigureOutDataPointFromRawValue(rawValue, dest), "")
let msg = buildInputMessage(src, dest, evt, null, tryToFigureOutDataPointFromRawValue(rawValue, dest), "",dest)
input.setNodeStatus({ fill: "green", shape: "dot", text: "Try to decode", payload: msg.payload, GA: msg.knx.destination, dpt: "", devicename: "" });

@@ -429,3 +429,3 @@ input.send(msg)

} else {
let msg = buildInputMessage(src, dest, evt, null, oGA.dpt, oGA.devicename);
let msg = buildInputMessage(src, dest, evt, null, oGA.dpt, oGA.devicename, dest);
input.setNodeStatus({ fill: "grey", shape: "dot", text: "Read", payload: msg.payload, GA: msg.knx.destination, dpt: msg.knx.dpt, devicename: msg.devicename });

@@ -441,3 +441,3 @@ input.send(msg);

} else {
let msg = buildInputMessage(src, dest, evt, null, input.dpt, input.name ? input.name : "");
let msg = buildInputMessage(src, dest, evt, null, input.dpt, input.name ? input.name : "", input.outputtopic);
msg.previouspayload = typeof input.currentPayload !== "undefined" ? input.currentPayload : ""; // 24/01/2020 Added previous payload

@@ -566,3 +566,3 @@ // 24/09/2019 Autorespond to BUS

function buildInputMessage(src, dest, evt, value, inputDpt, _devicename) {
function buildInputMessage(src, dest, evt, value, inputDpt, _devicename, _outputtopic) {
// Resolve DPT and convert value if available

@@ -583,3 +583,3 @@ var dpt = dptlib.resolve(inputDpt);

return {
topic: dest
topic: _outputtopic
, payload: jsValue

@@ -586,0 +586,0 @@ , payloadmeasureunit: sPayloadmeasureunit

@@ -7,2 +7,3 @@ module.exports = function (RED) {

node.topic = config.topic
node.outputtopic = (typeof config.outputtopic === "undefined" || config.outputtopic == "") ? config.topic : config.outputtopic; // 07/02/2020 Importante, per retrocompatibilità
node.dpt = config.dpt || "1.001"

@@ -22,3 +23,3 @@ node.notifyreadrequest = config.notifyreadrequest || false

node.messageQueue = []; // 01/01/2020 All messages from the flow to the node, will be queued and will be sent separated by 60 milliseconds each. Use uf the underlying knx.js "minimumDelay" is not possible because the telegram order isn't mantained.
// Used to call the status update from the config node.

@@ -38,7 +39,7 @@ node.setNodeStatus = ({ fill, shape, text, payload, GA, dpt, devicename }) => {

if (typeof node.topic == "undefined" || typeof node.dpt == "undefined") {
node.setNodeStatus({ fill: "red", shape: "dot", text: "Empty group address (topic) or datapoint.",payload: "", GA: "", dpt:"", devicename:"" })
node.setNodeStatus({ fill: "red", shape: "dot", text: "Empty Group Addr. or datapoint.",payload: "", GA: "", dpt:"", devicename:"" })
return;
} else {
// Topic must be in formar x/x/x
// topic must be in formar x/x/x
if (node.topic.split("\/").length < 3) {

@@ -139,12 +140,10 @@ node.setNodeStatus({ fill: "red", shape: "dot", text: "Wrong group address format.",payload: "", GA: node.topic, dpt:"", devicename:""})

}
// Anti looping check
if (node.icountMessageInWindow == -999) return; // Locked out
// 07/02/2020 Revamped flood protection (avoid accepting too many messages as input)
if (node.icountMessageInWindow == -999)return; // Locked out
if (node.icountMessageInWindow == 0) {
setTimeout(() => {
if (node.icountMessageInWindow >= 80) {
if (node.icountMessageInWindow >= 120) {
// Looping detected
setTimeout(() => {
node.setNodeStatus({ fill: "red", shape: "dot", text: "DISABLED! Looping detected! Check your flow's design or use RBE option.", payload:"", GA: "", dpt:"", devicename:"" })
RED.log.error("knxUltimate: Node " + node.id + " has been disabled due to loop detection. Check your flow's design or use RBE option.");
}, 1000);
node.setNodeStatus({ fill: "red", shape: "ring", text: "DISABLED! Flood protection! Too many msg at the same time.", payload:"", GA: "", dpt:"", devicename:"" })
RED.log.error("knxUltimate: Node " + node.id + " has been disabled due to Flood Protection. Too many messages in a timeframe. Check your flow's design or use RBE option.");
node.icountMessageInWindow = -999; //Lock out node

@@ -207,7 +206,9 @@ return;

// Protection over circular references (for example, if you link two Ultimate Nodes toghether with the same group address), to prevent infinite loops
if (msg.hasOwnProperty('topic')) {
if (msg.topic == grpaddr && msg.knx) {
RED.log.error("knxUltimate: Circular reference protection. The node " + node.id + " has been disabled. " + JSON.stringify(msg));
// if (msg.hasOwnProperty('topic')) {
if (msg.hasOwnProperty('knx')) {
//if (msg.topic == grpaddr && msg.knx !== undefined) { // 07/02/2020 changed, to allow topic customization asked by users.
if (msg.knx.destination == grpaddr) { // 07/02/2020 changed, to allow topic customization asket by users.
RED.log.error("knxUltimate: Circular reference protection. The node " + node.id + " has been disabled. Two nodes with same group address are linked. See the FAQ in the Wiki. Msg:" + JSON.stringify(msg));
setTimeout(() => {
node.setNodeStatus({ fill: "red", shape: "ring", text: "Node DISABLED due to a circulare reference (" + grpaddr + "). Two nodes with same group address are linked. Unlink it.",payload:"", GA: "", dpt:"", devicename:"" })
node.setNodeStatus({ fill: "red", shape: "ring", text: "DISABLED due to a circulare reference (" + grpaddr + ").",payload:"", GA: "", dpt:"", devicename:"" })
}, 1000);

@@ -214,0 +215,0 @@ return;

{
"name": "node-red-contrib-knx-ultimate",
"version": "1.1.27",
"version": "1.1.28",
"description": "Single Node KNX IN/OUT with optional ETS group address importer. Easy to use and highly configurable.",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -72,12 +72,7 @@ # node-red-contrib-knx-ultimate

</details>
<details><summary>CIRCULAR REFERENCE PROTECTION</summary>
<details><summary>NODE SELF PROTECTION</summary>
The Node has a circular reference protection. If 2 nodes with same group address are linked toghether, the protection avoids loops by stopping the message transmitted to the KNX BUS. <a href="https://youtu.be/I32_qG7yhFc" target="_blank"><img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/Loop.png' width='15%'></a>You can select what to see in the status (the row below the node). For example, you can select to see the current payload value and the last time changed, or the device name as well.
The Node protects you, from youself. [Node Protections](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/-Protections)
</details>
<details><summary>AUTOMATIC LOOP PROTECTION</summary>
Protect the flow form being flooded by KNX telegram, in case of mistaken in the flow design, by DISABLING the affected node.
</details>
<details><summary>BUILT INPUT AND OUTPUT RBE FILTER</summary>

@@ -84,0 +79,0 @@

Sorry, the diff of this file is not supported yet