knx
v2.5.4
Published
KNXnet/IP protocol implementation for Node(>=6.x)
Downloads
2,862
Maintainers
Readme
KNXnet/IP for Node.JS
New: Join the Gitter.im chatroom!
A feature-complete KNXnet/IP protocol stack in pure Javascript, capable of talking multicast (routing) and unicast (tunneling). Adding KNX to your Node.JS applications is now finally easy as pie.
- Wide DPT (datapoint type) support (DPT1 - DPT20 supported)
- Extensible Device support (binary lights, dimmers, ...)
- You won't need to install a specialised eibd daemon with its arcane dependencies and most importantly,
- If you got an IP router and a network that supports IP multicast, you can start talking to KNX within seconds!
Installation
Make sure your machine has Node.JS (version 4.x or greater) and do:
npm install knx
Usage
At last, here's a reliable KNX connection that simply works without any configs. To get a basic KNX monitor, you just need to run this in Node:
var knx = require('knx');
var connection = knx.Connection({
handlers: {
connected: function() {
console.log('Connected!');
},
event: function (evt, src, dest, value) {
console.log("%s **** KNX EVENT: %j, src: %j, dest: %j, value: %j",
new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''),
evt, src, dest, value);
}
}
});
Ahhh, KNX telegrams, what a joy:
> 2016-09-24 05:34:07 **** KNX EVENT: "GroupValue_Write", src: "1.1.100", dest: "5/0/8", value: 1
2016-09-24 05:34:09 **** KNX EVENT: "GroupValue_Write", src: "1.1.100", dest: "5/1/15", value: 0
2016-09-24 05:34:09 **** KNX EVENT: "GroupValue_Write", src: "1.1.100", dest: "5/0/8", value: 0
2016-09-24 05:34:17 **** KNX EVENT: "GroupValue_Write", src: "1.1.100", dest: "5/1/15", value: 0
2016-09-24 05:34:17 **** KNX EVENT: "GroupValue_Write", src: "1.1.100", dest: "5/0/8", value: 1