opendtu-logger/README.md

31 lines
736 B
Markdown
Raw Normal View History

2024-02-21 11:23:11 +01:00
# OpenDTU logger
OpenDTU logger connects to the OpenDTU livedata websocket and captures metrics.
These metrics are inserted into a PostgreSQL database.
2024-02-23 12:11:34 +01:00
Optionally, TimescaleDB can be used.
## PostgreSQL setup
```sql
CREATE DATABASE opendtu_logger;
CREATE USER opendtu_logger WITH password 'SECRET';
GRANT ALL privileges ON DATABASE opendtu_logger TO opendtu_logger;
GRANT ALL ON SCHEMA public TO opendtu_logger;
```
Optional: enable TimescaleDB extension
```sql
\c opendtu_logger
CREATE EXTENSION OF NOT EXISTS timescaledb;
```
2024-02-21 11:23:11 +01:00
## Environment variables
```conf
REMOTE_URL="opendtu:80"
DB_URL="host=localhost port=5432 user=postgres password=secret dbname=dtu sslmode=disable"
TIMESCALEDB_ENABLED="true"
TZ="Europe/Amsterdam"
```