This is a tiny Rust library and cli to connect to Guntamatic devices via HTTP and Modbus/TCP.
guntamatic 0.3.0
simon wimmesberger <wimmesberger@gmail.com>
CLI tool to connect to and extract data from Guntamatic Devices
USAGE:
guntamatic [FLAGS] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-v, --verbose Controls the log level. ex.: -v, -vv or -vvv
-V, --version Prints version information
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
modbus Accessing devices using Modbus/TCP protocol
web Accessing devices using web/HTTP APIsThe cli allows to:
get: read the current system state oncestream: read the current system state regularly and pump it into a data sink. Two sinks are available:influxdb: InfluxDB v2 (also works against InfluxDB 3 via its v2 write-compatibility endpoint). Enabled by default (sink_influxdbfeature).influxdb3: native InfluxDB 3 writes via the/api/v3/write_lpAPI. Opt-in via thesink_influxdb3feature (pulls a heavier dependency tree — Arrow/gRPC — so it is not in the default build).
Example commands:
# Using web/HTTP API -> InfluxDB 2
cargo run web <device IP> <API key> stream influxdb <url> <token> <bucket> <org>
# Using Modbus/TCP -> InfluxDB 2
cargo run modbus <device IP> stream influxdb <url> <token> <bucket> <org>
# Native InfluxDB 3 sink (requires the sink_influxdb3 feature)
cargo run --features sink_influxdb3 web <device IP> <API key> stream influxdb3 <url> <token> <database>Last but not least there is an example Grafana dashboard for a PowerChip heating (the only device this code has been tested with so far): 
- add modbus protocol
- CD using GH actions:
- automated build (- [ ] automated release to cargo - necessary?)
- build docker image and publish to GitHub Container Registry
cargo build --releaseShould give you a standalone executable for linux.
Pre-built Docker images are available from GitHub Container Registry for tagged releases.
The Docker image supports configuration via environment variables. All connection parameters can be set using environment variables:
docker run \
-e GUNTAMATIC_ADDRESS=192.168.1.100 \
-e GUNTAMATIC_TOKEN=your-api-key \
-e INFLUXDB_URL=http://influxdb:8086 \
-e INFLUXDB_TOKEN=your-influxdb-token \
-e INFLUXDB_BUCKET=guntamatic \
-e INFLUXDB_ORGANIZATION=myorg \
ghcr.io/swimmes/guntamatic:latestdocker run \
-e GUNTAMATIC_ADDRESS=192.168.1.100 \
-e GUNTAMATIC_TOKEN=your-token \
-e INFLUXDB_URL=http://influxdb:8086 \
-e INFLUXDB_TOKEN=your-influxdb-token \
-e INFLUXDB_BUCKET=guntamatic \
-e INFLUXDB_ORGANIZATION=myorg \
ghcr.io/swimmes/guntamatic:latest \
-vv modbus stream influxdbThe published Docker image is built with --all-features, so the influxdb3
sink is available out of the box:
docker run \
-e GUNTAMATIC_ADDRESS=192.168.1.100 \
-e GUNTAMATIC_TOKEN=your-api-key \
-e INFLUXDB3_URL=http://influxdb3:8181 \
-e INFLUXDB3_TOKEN=your-influxdb3-token \
-e INFLUXDB3_DATABASE=guntamatic \
ghcr.io/swimmes/guntamatic:latest \
-vv web stream influxdb3GUNTAMATIC_ADDRESS(required) - IP address of the Guntamatic deviceGUNTAMATIC_TOKEN(required) - Authentication keyGUNTAMATIC_INTERFACE(optional) - Local network interface IP to bind toGUNTAMATIC_POLL_INTERVAL_SECONDS(optional, default: 30) - Polling interval
InfluxDB 2 sink (stream influxdb):
INFLUXDB_URL(required) - InfluxDB server URLINFLUXDB_TOKEN(required) - InfluxDB authentication tokenINFLUXDB_BUCKET(required) - InfluxDB bucket nameINFLUXDB_ORGANIZATION(required) - InfluxDB organization name
Native InfluxDB 3 sink (stream influxdb3):
INFLUXDB3_URL(required) - InfluxDB 3 server URLINFLUXDB3_TOKEN(optional) - Auth token; omit for an unauthenticated InfluxDB 3 Core instanceINFLUXDB3_DATABASE(required) - InfluxDB 3 database name (the v3 equivalent of a v2 bucket)
# Build for linux/musl target first
cargo build --release --target x86_64-unknown-linux-musl
# Build Docker image
docker build -t guntamatic:local .Or use the provided build script:
./docker-build.shEasiest is to use https://www.gitpod.io: