KNX Listener
A thin node client to monitor, write and read groups telegrams through KNX gateway
Install
Install the knx-listener globally and use commands from the command line
sudo npm install -g knx-listener
Remote access to the knx net
Monitor telegrams
Usage bin/busmonitor.js -s <ip address>
Options:
-t, --timeout Seconds to retry, 0 - fail on first attemp [default: 0]
-p, --port Remote port number [default: 3671]
-s, --server Remote ip address [required]
-h, --help Show help [boolean]
busmonitor -s 192.168.1.100
Write value 1 to 0/0/1 through 192.168.1.100
Usage bin/groupswrite.js -s <ip address> -g <group address> -d <XX:XX:..>
Options:
-s, --server Remote ip address [required]
-p, --port Remote port number [default: 3671]
-g, --groupAddress Group address to issue the write telegram to [required]
-d, --data Data to write [required]
-h, --help Show help [boolean]
groupswrite -s 192.168.1.100 -g 0/0/1 -d 01
Read value from 0/0/1 through 192.168.1.100
Usage bin/groupsread.js -s <ip address> -g <group address>
Options:
-s, --server Remote ip address [required]
-p, --port Remote port number [default: 3671]
-g, --groupAddress Group address to issue the read telegram to [required]
-h, --help Show help [boolean]
groupsread -s 192.168.1.100 -g 0/0/1
Development use cases
const KnxListener = require("knx-listener");
const client = new KnxListener.BusListener();
const die = () => {
return client.disconnect().then(
() => process.exit(),
() => process.exit());
};
client.bind("192.168.1.105", 3671, {
timeout: 1000,
});
client.on("query", console.log);
client.ready(() => {
client.read(KnxListener.utils.knxAddr2num("0/0/1")).then((res) => {
console.log("Remote responded with", res);
}, (err) => {
console.error("Request failed", err);
});
client.write([0xFF], KnxListener.utils.knxAddr2num("0/0/2")).then(() => {
console.log("Success");
}, (err) => {
console.error("Request failed", err);
});
});
process.on('SIGINT', die);
TODO
- Generate JSDoc
- Integration testing
- Create another npm module for data types encoding/decoding
What is next?
- You may create stream using websockets to broadcast telegrams to rich web apps
- You may create ETS project parser to get group address and store them in db
- You may create REST API with express
- You may record telegrams to a database and return last values on demand
- You may build visualization with any KNX gateway
- You may delegate endcoding/decoding of data to your rich clients