infrapuzzle/k8s/monitoring/README_Z2M.md

3.3 KiB

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/:

# 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:

    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):

    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:

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).