npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

knx-mqtt-bridge

v0.1.1

Published

A KNX / MQTT bridge

Downloads

6

Readme

knx-mqtt-bridge

npm license github-issues

A KNX / MQTT bridge

nodei.co

Features

Bridges KNX and MQTT using the knx.js library. A Dockerfile is also provided for creating a working docker container.

KNX events are written to the MQTT topic knx/x/y/z where x/y/z is the group address. Writing to KNX is done by sending an MQTT message to topic knx/x/y/z/write with the value to write as the message. Again x/y/z is the group address to write to. The bridge also supports reading of values by sending an MQTT message to knx/x/y/z/read.

It's highly recommended to provide an ETS export of all the group addresses and their corresponding datapoint types. By doing this, values will be automatically converted from and to its raw type. If you are reading or writing to an unknown group address the raw byte buffer is what's being communicated and you would need to convert back and forth yourself.

Providing an ETS export is done by exporting an XML of all group addresses and its datapoint types from the ETS software. This file is then referenced from the configuration file.

Install

npm install -g knx-mqtt-bridge

Run

KNX_MQTT_CONFIG=config.yaml knx-mqtt-bridge

Configuring

See config.example.yaml for a configuration example. By default, the bridge will try to connect to a KNX router using the multicast address. If you prefer unicast you can add ipAddr and ipPort to the options block under knx in the configuration file.

Usage

Writing values to a mapped group address is straight forward. Send a message to knx/x/y/z/write with the value to write. However, if the group address is not mapped to a datapoint you can still write to that group address but you would have to provide the raw buffer yourself. Again, you can still write to knx/x/y/z/write, however knx-mqtt-bridge need to know the datapoint type of the address you are writing to for proper conversion. This is especially true for dpt1, dpt2 and dpt3. In this case you pass that information to the topic, like so: knx/x/y/z/write/dpt1. For instance, if you would want to send a 1/true to light switch using mosquitto_pub it could look something like this: mosquitto_pub -h localhost -t 'knx/1/1/65/write/dpt1' -m "{\"type\":\"Buffer\",\"data\":[1]}". For any datapoint other than dpt1, dpt2 or dpt3 you don't need to pass that additional information.

Dependencies

Package | Version | Dev --- |:---:|:---: js-yaml | 3.12.0 | ✖ knx | >=2.3.0 | ✖ mqtt | ^2.18.1 | ✖ winston | 3.0.0 | ✖ xml-js | 1.6.4 | ✖

License

  • Apache-2.0 : http://opensource.org/licenses/Apache-2.0