From 494892709d4e9e74c7bad220030d80bcff025358 Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Tue, 7 Jul 2026 21:38:10 +0200 Subject: [PATCH] Deploy Zigbee2MQTT in monitoring namespace and integrate Shelly weather station --- k8s/monitoring/README_Z2M.md | 76 ++++++++++++ k8s/monitoring/zigbee2mqtt.secret.yaml | Bin 0 -> 683 bytes k8s/monitoring/zigbee2mqtt.yaml | 163 +++++++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 k8s/monitoring/README_Z2M.md create mode 100644 k8s/monitoring/zigbee2mqtt.secret.yaml create mode 100644 k8s/monitoring/zigbee2mqtt.yaml diff --git a/k8s/monitoring/README_Z2M.md b/k8s/monitoring/README_Z2M.md new file mode 100644 index 0000000..2fb92bd --- /dev/null +++ b/k8s/monitoring/README_Z2M.md @@ -0,0 +1,76 @@ +# Zigbee2MQTT & Shelly Weather Station Integration + +This guide describes how to deploy Zigbee2MQTT in the `monitoring` namespace and pair your **Shelly Weather Station (Ecowitt WS90)** using the **SLZB-MR1U Zigbee multiradio** (`192.168.10.10`). + +> [!NOTE] +> These resources have already been successfully applied and verified running in the cluster. + +--- + +## 1. Deploy Zigbee2MQTT + +The Kubernetes secret and workload manifests are located in `k8s/monitoring/`: + +```bash +# 1. Apply the encrypted secrets (MQTT credentials & Traefik basic auth credentials) +# Note: Basic auth credentials are split into 'zigbee2mqtt-auth-secret' to satisfy +# Traefik's constraint requiring exactly one key in the basic auth secret. +kubectl apply -f k8s/monitoring/zigbee2mqtt.secret.yaml + +# 2. Apply the main deployment, PVC, ConfigMap, Service, Middleware, and Ingress +kubectl apply -f k8s/monitoring/zigbee2mqtt.yaml +``` + +--- + +## 2. Verify the Deployment + +1. Check that the Persistent Volume is provisioned and the pod starts: + ```bash + kubectl get pods -n monitoring -l app=zigbee2mqtt + ``` + +2. Inspect the logs to ensure Zigbee2MQTT connects successfully to the SLZB-MR1U coordinator (`192.168.10.10:7638` — port `7638` is the TI CC2652P7 coordinator chip on the MR1U) and the Mosquitto MQTT broker (`mosquitto.datalab.svc.cluster.local`): + ```bash + kubectl logs -n monitoring deploy/zigbee2mqtt + ``` + + **Expected healthy output:** + ``` + info: z2m: Starting Zigbee2MQTT version 1.40.1 (commit #403d3c0) + info: z2m: Starting zigbee-herdsman (0.57.3) + info: zh:zstack:znp: Opening TCP socket with 192.168.10.10:7638 + info: zh:zstack:znp: Socket connected + info: z2m: zigbee-herdsman started (resumed) + info: z2m: Connecting to MQTT server at mqtt://mosquitto.datalab.svc.cluster.local:1883 + info: z2m: Connected to MQTT server + info: z2m: Started frontend on port 0.0.0.0:8080 + info: z2m: Zigbee2MQTT started! + ``` + +--- + +## 3. Access the Dashboard + +The dashboard is exposed on your custom domain with TLS and basic authentication: +* **URL:** [https://zigbee2mqtt.moritzgraf.de](https://zigbee2mqtt.moritzgraf.de) +* **Username:** `admin` +* **Password:** `moritz-z2m-2026` + +*Note: You can change the basic auth password by running the `k8s/htpasswd.py` script on your machine to generate a new bcrypt hash, then updating the `users` value in `k8s/monitoring/zigbee2mqtt.secret.yaml`.* + +--- + +## 4. Pair the Weather Station (WS90) + +1. Open the Zigbee2MQTT dashboard and click **Permit join (All)** at the top right. +2. Go to your physical Ecowitt WS90 weather station and **double-press the physical CAL button** on the bottom of the sensor array. +3. The LED on the weather station should flash, indicating it is in pairing mode (active for 3 minutes). +4. Within a few seconds, the weather station will appear in the Zigbee2MQTT dashboard. You can rename it there (e.g. to `weather_station`). + +--- + +## 5. Verify Metrics flow + +* **Home Assistant:** The weather station will be automatically discovered via the MQTT integration. You can verify it under **Settings > Devices & Services > MQTT**. +* **Prometheus:** Home Assistant will automatically expose the new weather station entities. You can query them in Prometheus or Grafana (e.g. `homeassistant_sensor_temperature_celsius` or similar entity-based metrics). diff --git a/k8s/monitoring/zigbee2mqtt.secret.yaml b/k8s/monitoring/zigbee2mqtt.secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..95453961667870befc92a4dbbeda054d0fe95045 GIT binary patch literal 683 zcmV;c0#y9~M@dveQdv+`06OZ6jG}W02s`Q+83Pl-kyh-!M~uw79vTG6W`W`hUq zW(dp368ZLA;jy6##)vq}{E>&S%q$O&&d70(Ak{kH-k$gb@Cpo~AY)}N%Sb?i?L!DB z_Ecgk1Tag2!fB^Op%&@^^a5d6vS7&_Lfw^K_UrxzHhw!lu%uabd9=#5fHG;N8?pQx zZ4r+6?0K=?ki@zc!?fG6D1APr6pAbn4r1A=*Pwwa{BV+VNQ>r6Wj~hgvc^&Ktg?Ke zgb&$+%5GP{{M8{eHajlRS6<1%5WqyUii;3SSH7hoOO&jO#W%MU#cclAhI=1XHm{jo zR?@}a%hIaz5Dh`&teW?o(zn?LiXN|;tpX(-bIWz=|JPXM?%ldNnKFq zX-lLDBw7BQo72mQdu^N572CKous8RB!u|e=-{643>XW|FOZ3B}lH651-(te**IpgG z5hHc!U;r@kZ-;1AQY|V{9Z3T9*yxVINE|et|k9k}Xg2%&}Z*&RWs+i@lwAA)bDnaOULa z((MQ;+N|PJOg(G_8Tpea8p7RUg`