From 02adc74c5a13186c1e9cc3ca31b5e5a5a01d5eab Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Wed, 25 Dec 2024 16:33:10 +0100 Subject: [PATCH] HomeAssistant: Add zigbee2mqtt --- hosts/franz/arion/smarthome/arion-compose.nix | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/hosts/franz/arion/smarthome/arion-compose.nix b/hosts/franz/arion/smarthome/arion-compose.nix index 0f84e60..db6204f 100644 --- a/hosts/franz/arion/smarthome/arion-compose.nix +++ b/hosts/franz/arion/smarthome/arion-compose.nix @@ -30,5 +30,47 @@ "dmz" ]; }; + mosquitto.service = { + image = "eclipse-mosquitto:2.0.20"; + volumes = [ + "/home/ghoscht/.docker/smarthome/mosquitto_config:/mosquitto/config" + "/home/ghoscht/.docker/smarthome/mosquitto_data:/mosquitto/data" + ]; + labels = { + "traefik.enable" = "true"; + "traefik.http.routers.mqtt.entrypoints" = "websecure"; + "traefik.http.routers.mqtt.rule" = "Host(`mqtt.ghoscht.com`)"; + "traefik.http.routers.mqtt.tls" = "true"; + "traefik.http.routers.mqtt.tls.certresolver" = "letsencrypt"; + "traefik.http.services.mqtt.loadbalancer.server.port" = "1883"; + }; + restart = "always"; + command = "mosquitto -c /mosquitto-no-auth.conf"; + networks = [ + "dmz" + ]; + }; + zigbee2mqtt.service = { + image = "koenkk/zigbee2mqtt:1.42.0"; + volumes = [ + "/home/ghoscht/.docker/smarthome/zigbee2mqtt_data:/app/data" + "/run/udev:/run/udev:ro" + ]; + labels = { + "traefik.enable" = "true"; + "traefik.http.routers.zigbee2mqtt.entrypoints" = "websecure"; + "traefik.http.routers.zigbee2mqtt.rule" = "Host(`zigbee2mqtt.ghoscht.com`)"; + "traefik.http.routers.zigbee2mqtt.tls" = "true"; + "traefik.http.routers.zigbee2mqtt.tls.certresolver" = "letsencrypt"; + "traefik.http.services.zigbee2mqtt.loadbalancer.server.port" = "8080"; + }; + devices = [ + "/dev/ttyUSB0:/dev/ttyUSB0" + ]; + restart = "always"; + networks = [ + "dmz" + ]; + }; }; }