From a25b2ab81fa53374aeb4c885ef429cd2565199ea Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 9 Jan 2025 19:11:23 +0100 Subject: [PATCH] CT Z2mqtt: Updated zigbee2mqtt install methode --- CT-Build/Alpine.yaml | 27 +-------------------------- CT-Files/hass/Scripts/Init.sh | 2 +- CT-Files/z2mqtt/Scripts/Init.sh | 13 +++++++------ Readme.md | 6 +++--- 4 files changed, 12 insertions(+), 36 deletions(-) diff --git a/CT-Build/Alpine.yaml b/CT-Build/Alpine.yaml index b3bacbd..bc65ccb 100644 --- a/CT-Build/Alpine.yaml +++ b/CT-Build/Alpine.yaml @@ -344,7 +344,7 @@ files: variants: - mqtt -#FileForMqtt +#FileForHass - path: /opt/Setup generator: copy source: CT-Files/hass @@ -508,31 +508,6 @@ packages: variants: - mqtt -#PKGS for Hass - - packages: - - git - - python3 - - py3-virtualenv - - py3-pip - - python3-dev - - ca-certificates - - libffi-dev - - openssl-dev - - nmap - - iputils - - build-base - - tzdata - - sudo - - jpeg-dev - - zlib-dev - - bash - - mariadb-dev - - eudev-dev - - ffmpeg-dev - - ffmpeg - action: install - variants: - - hass #PKGS for MailBackup - packages: diff --git a/CT-Files/hass/Scripts/Init.sh b/CT-Files/hass/Scripts/Init.sh index b000bcd..09c807c 100644 --- a/CT-Files/hass/Scripts/Init.sh +++ b/CT-Files/hass/Scripts/Init.sh @@ -8,7 +8,7 @@ adduser -h /opt/HomeAssistant/data -D -G hass -s /bin/sh hass chown -R hass:hass /opt/HomeAssistant sudo -u hass python3 -m venv /opt/HomeAssistant/srv -sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install --upgrade pip && pip3 install wheel mysqlclient && pip3 install homeassistant' +sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install --upgrade pip && pip3 install wheel isal zlib-ng mysqlclient && pip3 install homeassistant' #Install Home Assistant Community Store wget https://github.com/hacs/integration/releases/latest/download/hacs.zip -O /tmp/hacs.zip diff --git a/CT-Files/z2mqtt/Scripts/Init.sh b/CT-Files/z2mqtt/Scripts/Init.sh index 97fbab5..d921b91 100644 --- a/CT-Files/z2mqtt/Scripts/Init.sh +++ b/CT-Files/z2mqtt/Scripts/Init.sh @@ -1,14 +1,15 @@ #!/bin/ash +npm install -g pnpm #Run folowing commands as 'node' user sudo -u node ash << EOF #Install zigbee2mqtt -git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/node/zigbee2mqtt -npm --prefix /opt/node/zigbee2mqtt ci -npm --prefix /opt/node/zigbee2mqtt run build +git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/node/zigbee2mqtt +pnpm -C /opt/node/zigbee2mqtt i --frozen-lockfile +pnpm -C /opt/node/zigbee2mqtt run build ##Update config -sed -i -e '/port:/c\ port: \/dev\/ttyACM-Zigbee' /opt/node/zigbee2mqtt/data/configuration.yaml -printf "frontend:\n port: 5002" >> /opt/node/zigbee2mqtt/data/configuration.yaml +cp /opt/node/zigbee2mqtt/data/configuration.example.yaml /opt/node/zigbee2mqtt/data/configuration.yaml +sed -i -e '/# port:/c\# port: \/dev\/ttyACM-Zigbee' /opt/node/zigbee2mqtt/data/configuration.yaml #Install Z-Wave JS UI git clone https://github.com/zwave-js/zwave-js-ui /opt/node/ZwaveJsUi @@ -17,7 +18,7 @@ npm --prefix /opt/node/ZwaveJsUi run build #Save PM2 statup config pm2 install pm2-logrotate -pm2 start npm --name zigbee2mqtt --cwd /opt/node/zigbee2mqtt -- start +pm2 start pnpm --name zigbee2mqtt --cwd /opt/node/zigbee2mqtt -- start pm2 start npm --name ZwaveJsUi --cwd /opt/node/ZwaveJsUi -- start pm2 save pm2 kill diff --git a/Readme.md b/Readme.md index e528ccf..1cc2c3b 100644 --- a/Readme.md +++ b/Readme.md @@ -47,8 +47,8 @@ This can be done on a privileged Debian CT (make sure to enable the Fuse, Nestin | nodejs | Alpine | Basic nodejs install with pm2 | | nextcloud | Alpine | Nextcloud | | mqtt | Alpine | Mosquitto mqtt broker | -| hass `(Broken, Requires python 3.12)` | Alpine | HomeAssistant instance with HACS and mysql support | -| mailbackup `(Broken, Requires python 3.12)` | Alpine | Contains mail archive tools (MailBackup-sys) | +| hass `(Broken, Requires python 3.13)` | Alpine | HomeAssistant instance with HACS and mysql support | +| mailbackup | Alpine | Contains mail archive tools (MailBackup-sys) | | heimdall | Alpine | Heimdall, A application dashboard/launcher | | vouchproxy | Alpine | Vouch-proxy, A SSO solution for Nginx | | freshrss | Alpine | FreshRSS, a self-hosted RSS feed aggregator | @@ -204,7 +204,7 @@ lxc.cgroup2.devices.allow: c 188:* rwm lxc.mount.entry: /dev/ttyACM-Zigbee dev/ttyACM-Zigbee none bind,optional,create=file lxc.mount.entry: /dev/ttyACM-Zwave dev/ttyACM-Zwave none bind,optional,create=file ``` -* Zigbee2mqtt Available on http://``:5002 +* Zigbee2mqtt Available on http://``:8080 * Z-wave JS UI Available on http://``:8091 * in the Z-wave JS UI web ui set the Zwave serial port to /dev/ttyACM-Zwave * If a `Cannot lock port` error shows, please reboot the CT, if that does not fix it try rebooting the Proxmox server