Add additional descriptions and installation instructions to README.
All checks were successful
Build Docker image / build (push) Successful in 1m13s
Build Golang packages / release (push) Successful in 1m29s

This commit is contained in:
Pieter Hollander 2024-03-18 11:23:35 +01:00
parent 531c527d68
commit 8b8da8d0f7
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

View file

@ -4,7 +4,29 @@ OpenDTU logger connects to the OpenDTU livedata websocket and captures metrics.
These metrics are inserted into a PostgreSQL database. These metrics are inserted into a PostgreSQL database.
Optionally, TimescaleDB can be used. Optionally, TimescaleDB can be used.
## PostgreSQL setup ## Install instructions
### Docker
```sh
docker pull git.hollander.online/energy/opendtu-logger:0.0
```
Preferably, run the Docker image using the Docker compose examples provided in the `./docker` folder.
### Binary
Go to the [releases page](https://git.hollander.online/energy/opendtu-logger/releases) and download the most recent stable release.
#### Running example
```sh
REMOTE_URL="opendtu:80" DB_URL="host=localhost port=5432 user=postgres password=secret dbname=dtu sslmode=disable" TIMESCALEDB_ENABLED="true" TZ="Europe/Amsterdam" ./opendtu-logger
```
### PostgreSQL setup
The OpenDTU logger logs to a PostgreSQL database and optionally supports TimescaleDB. Create a separate database and user using the following commands.
```sql ```sql
CREATE DATABASE opendtu_logger; CREATE DATABASE opendtu_logger;
@ -22,9 +44,24 @@ CREATE EXTENSION OF NOT EXISTS timescaledb;
## Environment variables ## Environment variables
The following environment variables are required for OpenDTU Logger to be configured.
```conf ```conf
REMOTE_URL="opendtu:80" REMOTE_URL="opendtu:80"
DB_URL="host=localhost port=5432 user=postgres password=secret dbname=dtu sslmode=disable" DB_URL="host=localhost port=5432 user=postgres password=secret dbname=dtu sslmode=disable"
TIMESCALEDB_ENABLED="true" TIMESCALEDB_ENABLED="true"
TZ="Europe/Amsterdam" TZ="Europe/Amsterdam"
``` ```
## Grafana
The `grafana` folder contains example dashboards.
- The `opendtu_` dashboards contain visualisations for each table the OpenDTU logger records to.
- `PV.json` is a dashboard which combines the visualisations of each table that I found to be most useful.
- `Zonnepanelen.json` is the same as `PV.json`, but in Dutch language.
## Known issues
- The logger will currently log every event posted by OpenDTU to the websocket. Checks still need to be added to determine the uniqueness of an event. For more information, see also [this OpenDTU Github issue](https://github.com/tbnobody/OpenDTU/issues/1800).
- Upon restart of the OpenDTU, OpenDTU Logger will need to be restarted manually as well. Automatic reconnection logic is a work in progress.