From 8e70b0246dd0a38e9e9d82fd98eb76f77c6da535 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Wed, 8 Jan 2025 10:04:40 +0100 Subject: [PATCH] homeassistant inkl. update Script. --- homeassistant/docker-compose.yml | 37 ++++++++++++++++++++++++++++++++ homeassistant/update-container | 5 +++++ homeassistant/update.sh | 10 +++++++++ 3 files changed, 52 insertions(+) create mode 100644 homeassistant/docker-compose.yml create mode 100755 homeassistant/update-container create mode 100755 homeassistant/update.sh diff --git a/homeassistant/docker-compose.yml b/homeassistant/docker-compose.yml new file mode 100644 index 0000000..bf470ad --- /dev/null +++ b/homeassistant/docker-compose.yml @@ -0,0 +1,37 @@ +--- +version: "3.2" +services: + homeassistant: + image: ghcr.io/home-assistant/home-assistant:stable + container_name: homeassistant + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/Berlin + volumes: + - /etc/localtime:/etc/localtime:ro + - /opt/homeassistant:/config + ports: + - 8123:8123 #optional + restart: unless-stopped + zwavejs2mqtt: + container_name: zwavejs2mqtt + image: zwavejs/zwavejs2mqtt:latest + restart: unless-stopped + tty: true + stop_signal: SIGINT + environment: + - SESSION_SECRET=geheimes_secret + - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db + # Uncomment if you want log times and dates to match your timezone instead of UTC + # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + #- TZ=America/New_York + devices: + # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time. + # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick. + - '/dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_d4e1c425a584ed11b7dad19f9d1cc348-if00-port0:/dev/zwave' + volumes: + - /opt/z-wave-js/:/usr/src/app/store + ports: + - "8091:8091" # port for web interface + - "3000:3000" # port for Z-Wave JS websocket server diff --git a/homeassistant/update-container b/homeassistant/update-container new file mode 100755 index 0000000..7aca12f --- /dev/null +++ b/homeassistant/update-container @@ -0,0 +1,5 @@ +#! /usr/bin/bash + +docker pull ${1} +docker rm -f ${2} + diff --git a/homeassistant/update.sh b/homeassistant/update.sh new file mode 100755 index 0000000..0ef73d3 --- /dev/null +++ b/homeassistant/update.sh @@ -0,0 +1,10 @@ +#! /usr/bin/bash + +export COMPOSE_IGNORE_ORPHANS=True +echo "pulling new images" +docker pull ghcr.io/home-assistant/home-assistant:stable +docker pull zwavejs/zwavejs2mqtt:latest +echo "removing container" +docker rm -f homeassistant zwavejs2mqtt +echo "creating new container" +docker-compose -f ./docker-compose.yml up -d