| Crates.io | knxkit |
| lib.rs | knxkit |
| version | 0.1.3 |
| created_at | 2024-12-29 21:08:37.02305+00 |
| updated_at | 2025-01-02 21:32:08.907878+00 |
| description | High-level API for KNX devices and networks |
| homepage | |
| repository | https://github.com/knxkit/knxkit |
| max_upload_size | |
| id | 1498522 |
| size | 312,268 |
knxkit is a library for interfacing with KNX devices and networks. It provides a high-level API for interacting with KNX devices and networks, and is designed to be easy to use and flexible.
Data structures — individual and group addresses, CEMI, APDU, DPT, DataPoint, KNXnet/IP frames
KNXnet/IP services — search, describe, tunneling are implemented.
Project files — read .knxproj files, which are used by ETS to store KNX project information. Devices and group definitions can be extracted.
Data point structures generated from knx_master.xml contents. Typed and generic representations are supported
Command line utilities for data structures generation and knx network interaction.
[dependencies]
tokio = { version = "1.42.0", features = ["full"] }
knxkit = "0.1.1"
knxkit_dpt = "0.1"
use std::{net::Ipv4Addr, str::FromStr, time::Duration};
use knxkit::{
connection::{self, ops::GroupOps, KnxBusConnection, RemoteSpec},
core::address::GroupAddress,
};
use knxkit_dpt::{
specific::{SpecificDataPoint, DPT_9_1},
typeinfo,
};
#[tokio::main]
async fn main() {
let remote = RemoteSpec::KnxIpTunnel("192.168.8.2:3671".parse().unwrap());
let local = Ipv4Addr::from_str("192.168.7.51").unwrap();
let mut tunnel = connection::connect(local, &remote).await.unwrap();
let group = GroupAddress::from_str("2/0/0").unwrap();
let timeout = Duration::from_secs(1);
let data_point = tunnel.group_read(group, timeout).await.unwrap();
let temp = DPT_9_1::from_data_point(&data_point).unwrap();
let info = typeinfo::lookup(DPT_9_1::DPT).unwrap();
println!("{}: {}{}", info.text.unwrap(), temp.0, info.unit.unwrap());
// -> temperature (°C): 19.5°C
tunnel.terminate().await
}
cargo install knxkit_cli
export KNX_REMOTE=udp://192.168.8.2
export KNX_PROJECT=~/knxkit/_hidden/etc/TestProject.knxproj
Search

Group Monitor

Downloadable binary releases for Linux (and maybe Windows) will be provided in the future.
Currently the library is in development. It may be used for testing and experimentation, but is not yet ready for production use. The API is subject to change. The library is being developed in the open, and contributions are welcome.
In addition to general improvements and bug fixes, the following features are planned for the library:
Tools and applications