ecowitt-mqtt

Crates.ioecowitt-mqtt
lib.rsecowitt-mqtt
version0.4.0
sourcesrc
created_at2024-08-15 02:41:39.061493
updated_at2024-08-19 00:36:31.042011
descriptionUpdate Homeassistant with data from your Ecowitt device
homepagehttps://git.sr.ht/~toddself/ecowitt-mqtt
repositoryhttps://git.sr.ht/~toddself/ecowitt-mqtt
max_upload_size
id1338239
size116,711
toddself (toddself)

documentation

README

ecowitt-mqtt

This is a rust program that will read data from an ecowitt weather station and soil moisture sensor and send it to an MQTT broker for Home Assistant to consume.

This only is known to work on the GW1000 and Soil sensor as these are the only devices I have access to. It does not support connecting to MQTT via TLS.

Why

The current Ecowitt integration requires that the Ecowitt device has access to the same network that Home Assistant is running on. As I am running this on a separate VLAN, I needed something that I trusted running on the same VLAN as Home Assistant but could read the data from Ecowitt.

Usage

Configuration can be done via environment variables. The following are the available environment variables:

export ECOWITT_HOST=http://[ ip address to ecowitt device ]
export MQTT_ADDRESS=[ip address of your MQTT broker]
export MQTT_PORT=[port your mqtt broker is listening on]
export MQTT_USER=[username, optional]
export MQTT_PASS=[password, optional]
./ecowitt-mqtt

You can also specify the configuration in a file named config.json in the same directory as the binary:

{
  ecowitt_host: "http://<ecowitt ip",
  username: "<username, or omit for no username>",
  password: "<password, or omit for no password>",
  mqtt_address: "<mqtt broker ip>",
  mqtt_port: <mqtt broker port>
}

Building

This project is built using cargo. You can build it by running cargo build --release. The binary will be in the target/release directory.

License

This projects is licenced under the AGPL-3.0 license. See the COPYING file for more information.

Copyright (c) 2024, Todd Kennedy

Commit count: 0

cargo fmt