#Trying to switch from ZHA to Zigbee2MQTT, docker-compose help

1 messages · Page 1 of 1 (latest)

hard void
#

Hello, its finally time for me to take the plunge and move away from ZHA. I am just trying to confirm my docker compose is OK.

services:
homeassistant:
container_name: home-assistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /mnt/torrent/homeAssistant/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
ports:
- 8123:8123
restart: unless-stopped

mosquitto:
container_name: mqtt-broker
image: eclipse-mosquitto:2.0
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- /mnt/torrent/homeAssistant/mqtt/config:/mosquitto/config
- /mnt/torrent/homeAssistant/mqtt/data:/mosquitto/data
- /mnt/torrent/homeAssistant/mqtt/log:/mosquitto/log
command: mosquitto -c /mosquitto/config/mosquitto.conf

zigbee2mqtt:
container_name: zigbee2mqtt
image: ghcr.io/koenkk/zigbee2mqtt:latest
restart: unless-stopped
depends_on:
- mosquitto
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
volumes:
- /mnt/torrent/homeAssistant/zigbee2mqtt/data:/app/data
- /mnt/torrent/homeAssistant/zigbee2mqtt/config:/app/config
ports:
- "8081:8080"
environment:
- TZ=America/New_York

My main concern is the USB0 thing (it is what I used before, with HA, under the home assistant service, and it worked flawlessly). Is this the correct method? Do my volumes make senes? I'm sure I could just run this and see for myself but I am worried about things spiraling out of control a bit

cursive jacinth
#

first, do a backup of current config.

hard void
#

backup already done, ZHA device already removed. I have the backup and zigbee.db saved, and the automations yaml as well

cursive jacinth
#

dont know about docker handling migration. try, you have backup 😉

hard void
#

OK. The container for HA booted OK (which is expected, nothing has changed really).

But for zigbee2mqtt I get
`
Node.js v22.16.0
Using '/app/data' as data directory
node:internal/modules/cjs/loader:1404
throw err;
^

Error: Cannot find module '/app/index.js'
at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Function._load (node:internal/modules/cjs/loader:1211:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v22.16.0
Using '/app/data' as data directory
node:internal/modules/cjs/loader:1404
throw err;
^

Error: Cannot find module '/app/index.js'
at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Function._load (node:internal/modules/cjs/loader:1211:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v22.16.0
`

over and over

#

wait actually, maybe its because i am missing mosquito.conf

hard void
#

OK. I got mosquito up and running, but Zigbee2MQTT is still down. Looking into it though

hard void
#

OK, finally got everything set up and added to zigbee2mqtt. What in the world is mosquitto for though

rapid urchin
#

It's an MQTT broker