From e0571eef88d489e9652037c80288a9f373a97cbb Mon Sep 17 00:00:00 2001 From: Domagoj Zecevic Date: Mon, 12 Oct 2026 13:40:30 +0200 Subject: [PATCH] changed mqtt ip --- README.md | 6 +++--- ROADMAP.md | 2 +- docker-compose.yml | 4 ++-- main.go | 2 +- main_test.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2307ad8..e57e6a8 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ docker compose logs -f laundry-status ``` Open `http://:8080/` on a phone connected to your home Wi-Fi. By -default the service connects to `192.168.1.12:1883` and subscribes to +default the service connects to `192.168.1.11:1883` and subscribes to `tele/tasmota_washingmashine_C21183/SENSOR`. No broker is included in the Compose file; it connects to your existing one. @@ -49,7 +49,7 @@ To override settings, export the environment variables below or place them in a local `.env` file before running Compose. For example: ```bash -MQTT_BROKER=tcp://192.168.1.12:1883 docker compose up --build -d +MQTT_BROKER=tcp://192.168.1.11:1883 docker compose up --build -d ``` Keep credential files local. The Docker build context excludes `.env` files. @@ -60,7 +60,7 @@ page; no volume or database is required. Stop it with `docker compose down`. | Variable | Default | Description | |----------|---------|-------------| -| `MQTT_BROKER` | `tcp://192.168.1.12:1883` | Broker URL, including scheme and port | +| `MQTT_BROKER` | `tcp://192.168.1.11:1883` | Broker URL, including scheme and port | | `MQTT_TOPIC` | `tele/tasmota_washingmashine_C21183/SENSOR` | Tasmota sensor topic | | `MQTT_USERNAME` | Empty | Optional MQTT username | | `MQTT_PASSWORD` | Empty | Optional MQTT password | diff --git a/ROADMAP.md b/ROADMAP.md index 96961d7..a44a34a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -9,7 +9,7 @@ Objective: show the laundry status from the last 3 one-minute power samples of t ### Decided - Data source: MQTT topic `tele/tasmota_washingmashine_C21183/SENSOR` (Tasmota JSON, field `ENERGY.Power` in watts). -- Broker: `192.168.1.12:1883`, no credentials assumed. Address, port, topic and credentials (optional) are configurable via env vars. +- Broker: `192.168.1.11:1883`, no credentials assumed. Address, port, topic and credentials (optional) are configurable via env vars. - Tasmota `TelePeriod` is 10 s, so the plug publishes about 6 messages per minute. - Architecture: small Go backend, packaged in Docker (Dockerfile plus docker-compose example), deployed by the user on their own server. - Subscribes to the broker over TCP and runs continuously, whether or not any page is open. diff --git a/docker-compose.yml b/docker-compose.yml index 05d645d..ac38a49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,9 +3,9 @@ services: build: . restart: unless-stopped ports: - - "8080:8080" + - "8089:8080" environment: - MQTT_BROKER: "${MQTT_BROKER:-tcp://192.168.1.12:1883}" + MQTT_BROKER: "${MQTT_BROKER:-tcp://192.168.1.11:1883}" MQTT_TOPIC: "${MQTT_TOPIC:-tele/tasmota_washingmashine_C21183/SENSOR}" MQTT_USERNAME: "${MQTT_USERNAME:-}" MQTT_PASSWORD: "${MQTT_PASSWORD:-}" diff --git a/main.go b/main.go index 923dbb4..91a0659 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func loadConfig() (config, error) { } return config{ MQTTConfig: sensor.MQTTConfig{ - Broker: env("MQTT_BROKER", "tcp://192.168.1.12:1883"), + Broker: env("MQTT_BROKER", "tcp://192.168.1.11:1883"), Topic: env("MQTT_TOPIC", "tele/tasmota_washingmashine_C21183/SENSOR"), Username: os.Getenv("MQTT_USERNAME"), Password: os.Getenv("MQTT_PASSWORD"), diff --git a/main_test.go b/main_test.go index db38591..f5b5ef9 100644 --- a/main_test.go +++ b/main_test.go @@ -13,7 +13,7 @@ func TestLoadConfigDefaults(t *testing.T) { if err != nil { t.Fatal(err) } - if got.Broker != "tcp://192.168.1.12:1883" || got.Topic != "tele/tasmota_washingmashine_C21183/SENSOR" || got.HTTPAddr != ":8080" || got.SampleInterval != time.Minute || got.Username != "" || got.Password != "" { + if got.Broker != "tcp://192.168.1.11:1883" || got.Topic != "tele/tasmota_washingmashine_C21183/SENSOR" || got.HTTPAddr != ":8080" || got.SampleInterval != time.Minute || got.Username != "" || got.Password != "" { t.Fatalf("defaults: %+v", got) } }