node-red-contrib-knx-ultimate
Advanced tools
Comparing version
@@ -1,9 +0,14 @@ | ||
# node-red-contrib-knx-ultimate | ||
 | ||
[](https://www.paypal.me/techtoday) and <a href="http://eepurl.com/gJm095" target="_blank">subscribe to my channel.</a> Only news about my nodes, no spam, no ads. I'm a github developer, not a merchant. | ||
[](https://www.paypal.me/techtoday) and <a href="http://eepurl.com/gJm095" target="_blank">subscribe to my channel </a> for latest news about my nodes. | ||
<br/> | ||
<p> | ||
<b>Version 1.1.30</b><br/> | ||
- New: the Watchdog node now signals if a knx-ultimate node throws errors as well. <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/8.-WatchDog-Messages-from-the-node" target="_blank">See here output message properties.</a><br/> | ||
</p> | ||
<p> | ||
<b>Version 1.1.29</b><br/> | ||
@@ -28,3 +33,3 @@ - Changed Node KNX Icon, logo and colors, thanks @svenflender <br/> | ||
<b>Version 1.1.26</b><br/> | ||
- New: Professional Watchdog Node added. Please <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/7.-WatchDog-Configuration" target="_blank">consult the Wiki</a>.<br/> | ||
- New: Watchdog Node added. Please <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/7.-WatchDog-Configuration" target="_blank">consult the Wiki</a>.<br/> | ||
- Changed category (the node's list on left panel of node-red) to "KnxUltimate", to accomodate the Watchdog node.<br/> | ||
@@ -31,0 +36,0 @@ </p> |
@@ -162,2 +162,13 @@ const knx = require('knx') | ||
// 16/02/2020 KNX-Ultimate nodes calls this function, then this funcion calls the same function on the Watchdog | ||
node.reportToWatchdogCalledByKNXUltimateNode = (_oError) => { | ||
var readHistory = []; | ||
let delay = 0; | ||
node.nodeClients | ||
.filter(oClient => (oClient.isWatchDog !== undefined && oClient.isWatchDog === true)) | ||
.forEach(oClient => { | ||
oClient.signalNodeErrorCalledByConfigNode(_oError); | ||
}) | ||
} | ||
node.Disconnect = () => { | ||
@@ -164,0 +175,0 @@ node.setAllClientsStatus("Waiting", "grey", "") |
@@ -32,2 +32,9 @@ module.exports = function (RED) { | ||
node.status({ fill: fill, shape: shape, text: _GA + payload + ((node.listenallga && node.server.statusDisplayDeviceNameWhenALL) == true ? " " + _devicename : "") + (node.server.statusDisplayDataPoint == true ? _dpt : "") + (node.server.statusDisplayLastUpdate == true ? " (" + dDate.getDate() + ", " + dDate.toLocaleTimeString() + ")" : "") + " " + text }); | ||
// 16/02/2020 signal errors to the server | ||
if (fill.toUpperCase() == "RED") { | ||
if (node.server) { | ||
var oError = {nodeid:node.id,topic:node.outputtopic,devicename:_devicename,GA:_GA,text:text}; | ||
node.server.reportToWatchdogCalledByKNXUltimateNode(oError); | ||
}; | ||
}; | ||
} | ||
@@ -101,3 +108,3 @@ | ||
node.server.readValue(element.ga); | ||
node.setNodeStatus({ fill: "yellow", shape: "dot", text: "Read", payload: "", GA: element.ga, dpt: element.dpt, devicename: element.devicename }); | ||
node.setNodeStatus({ fill: "grey", shape: "dot", text: "Read", payload: "", GA: element.ga, dpt: element.dpt, devicename: element.devicename }); | ||
}, delay); | ||
@@ -104,0 +111,0 @@ delay = delay + 200; |
{ | ||
"name": "node-red-contrib-knx-ultimate", | ||
"version": "1.1.29", | ||
"version": "1.1.30", | ||
"description": "Single Node KNX IN/OUT with optional ETS group address importer. Easy to use and highly configurable.", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -7,3 +7,3 @@ module.exports = function (RED) { | ||
node.dpt = "1.001" | ||
node.notifyreadrequestalsorespondtobus = "false" | ||
node.notifyreadrequestalsorespondtobus = "false" | ||
node.notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized = "" | ||
@@ -13,17 +13,17 @@ node.notifyreadrequest = true; | ||
node.notifywrite = false | ||
node.initialread = false | ||
node.initialread = false | ||
node.listenallga = false | ||
node.outputtype = "write" | ||
node.outputRBE = "false" | ||
node.inputRBE = "false" | ||
node.outputtype = "write" | ||
node.outputRBE = "false" | ||
node.inputRBE = "false" | ||
node.currentPayload = "" | ||
node.topic = config.topic; | ||
node.retryInterval = config.retryInterval !== undefined ? config.retryInterval * 1000: 10000; | ||
node.retryInterval = config.retryInterval !== undefined ? config.retryInterval * 1000 : 10000; | ||
node.maxRetry = config.maxRetry !== undefined ? config.maxRetry : 6; | ||
node.autoStart = config.autoStart !== undefined ? config.autoStart: false; | ||
if (node.autoStart) node.timerWatchDog = setInterval(handleTheDog, node.retryInterval); // Autostart watchdog | ||
node.autoStart = config.autoStart !== undefined ? config.autoStart : false; | ||
node.beatNumber = 0; // Telegram counter | ||
node.timerWatchDog; | ||
node.isWatchDog = true; | ||
node.checkLevel= config.checkLevel !== undefined ? config.checkLevel : "Ethernet"; | ||
node.checkLevel = config.checkLevel !== undefined ? config.checkLevel : "Ethernet"; | ||
// Used to call the status update from the config node. | ||
@@ -34,10 +34,10 @@ node.setNodeStatus = ({ fill, shape, text, payload, GA, dpt, devicename }) => { | ||
// 30/08/2019 Display only the things selected in the config | ||
_GA= (typeof _GA == "undefined" || GA == "") ? "" : "(" + GA + ") "; | ||
_GA = (typeof _GA == "undefined" || GA == "") ? "" : "(" + GA + ") "; | ||
_devicename = devicename || ""; | ||
_dpt= (typeof dpt == "undefined" || dpt == "") ? "" : " DPT" + dpt; | ||
node.status({ fill: fill, shape: shape, text: _GA + payload + ((node.listenallga && node.server.statusDisplayDeviceNameWhenALL) == true ? " " + _devicename : "") +(node.server.statusDisplayDataPoint == true ? _dpt : "") + (node.server.statusDisplayLastUpdate == true ? " (" + dDate.getDate() + ", " + dDate.toLocaleTimeString() + ")" : "") + " " + text }); | ||
_dpt = (typeof dpt == "undefined" || dpt == "") ? "" : " DPT" + dpt; | ||
node.status({ fill: fill, shape: shape, text: _GA + payload + ((node.listenallga && node.server.statusDisplayDeviceNameWhenALL) == true ? " " + _devicename : "") + (node.server.statusDisplayDataPoint == true ? _dpt : "") + (node.server.statusDisplayLastUpdate == true ? " (" + dDate.getDate() + ", " + dDate.toLocaleTimeString() + ")" : "") + " " + text }); | ||
} | ||
if (!node.server) return; // 29/08/2019 Server not instantiate | ||
if (!node.server) return; | ||
function handleTheDog() { | ||
@@ -50,3 +50,3 @@ node.beatNumber += 1; | ||
type: "BUSError", | ||
checkPerformed:node.checkLevel, | ||
checkPerformed: node.checkLevel, | ||
nodeid: node.id, | ||
@@ -80,3 +80,3 @@ payload: true, | ||
} else { | ||
// With thes check level "Ethernet + KNX Twisted Pair", i need to obtain the "Response" from the physical device, otherwise the connection TP is broken. | ||
// With this check level "Ethernet + KNX Twisted Pair", i need to obtain the "Response" from the physical device, otherwise the connection TP is broken. | ||
if (_sTypeOfTelegram === "Response") { | ||
@@ -92,2 +92,26 @@ // With this check level, i need to obtain at least a response from the KNX/IP Gateway, that is "Read" | ||
// 16/02/2020 This function is called by the knx-ultimate config node. | ||
node.signalNodeErrorCalledByConfigNode = _oError => { | ||
// Report an error from knx-ultimate node. | ||
// var oError = {nodeid:node.id,topic:node.outputtopic,devicename:_devicename,GA:_GA,text:text}; | ||
msg = { | ||
type: "NodeError", | ||
checkPerformed: "Self KNX-Ultimate node reporting a red color status", | ||
nodeid: _oError.nodeid, | ||
payload: true, | ||
description: _oError.text, | ||
completeError: _oError | ||
}; | ||
node.send(msg); | ||
}; | ||
node.StartWatchDogTimer = () => { | ||
node.beatNumber = 0; | ||
if (node.timerWatchDog !== undefined) clearInterval(node.timerWatchDog); | ||
node.timerWatchDog = setInterval(handleTheDog, node.retryInterval); // 02/01/2020 Start the timer that handles the queue of telegrams | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "WatchDog started.", payload: "", GA: "", dpt: "", devicename: "" }) | ||
} | ||
if (node.autoStart) node.StartWatchDogTimer(); // Autostart watchdog | ||
node.on("input", function (msg) { | ||
@@ -111,6 +135,3 @@ | ||
if (Boolean(msg.start) === true) { | ||
node.beatNumber = 0; | ||
clearInterval(node.timerWatchDog); | ||
node.timerWatchDog = setInterval(handleTheDog, node.retryInterval); // 02/01/2020 Start the timer that handles the queue of telegrams | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "WatchDog started.", payload: "", GA: "", dpt: "", devicename: "" }) | ||
node.StartWatchDogTimer(); | ||
} | ||
@@ -123,3 +144,3 @@ else { | ||
}); | ||
node.on('close', function () { | ||
@@ -139,9 +160,9 @@ clearInterval(node.timerWatchDog); | ||
node.server.addClient(node); | ||
if (node.autoStart) node.timerWatchDog = setInterval(handleTheDog, node.retryInterval); // Autostart watchdog | ||
if (node.autoStart) node.StartWatchDogTimer(); // Autostart watchdog | ||
} | ||
} | ||
} | ||
RED.nodes.registerType("knxUltimateWatchDog", knxUltimateWatchDog) | ||
} |
@@ -1,4 +0,4 @@ | ||
# node-red-contrib-knx-ultimate | ||
 | ||
 | ||
<br/> | ||
@@ -12,7 +12,6 @@ [![NPM version][npm-version-image]][npm-url] | ||
 | ||
## DESCRIPTION | ||
* **Knx-ultimate device node** allow you to control your *KNX installation* via Node-Red. You can control all your KNX devices as well as create a *Virtual Device* in Node-Red, to link external *non KNX* devices, and make it compatible with your KNX installation. I'ts very SIMPLE TO USE thus very customizable. | ||
* **WatchDog node** is a professional oriented knx node for installers/companies. It allows notification (Email, Twitter, Telegram, Alexa, Siri, Sonos -with sonospollytts node- and so on) of KNX Bus connection errors, automatic or manual switchover to a backup KNX/IP router if the primary fails and allows you to programmatically change the config-node directly from a msg flow. | ||
* **WatchDog node** allows notification (Email, Twitter, Telegram, Alexa, Siri, Sonos -with sonospollytts node- and so on) of KNX Bus connection errors, automatic or manual switchover to a backup KNX/IP router if the primary fails and allows you to programmatically change the config-node directly from a msg flow. | ||
@@ -19,0 +18,0 @@ [](https://www.paypal.me/techtoday) and <a href="http://eepurl.com/gJm095" target="_blank">subscribe to my channel.</a> Only news about my nodes, no spam, no ads. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1478370
7.46%1071
3.38%58
-1.69%174
-0.57%