How to launch docker image koenkk/zigbee2mqtt?

Hello can somebody test if it is possible to run this https://www.zigbee2mqtt.io/information/docker.html on balena? I change docker-compose.yml version to 2.1 but still cannot start with command balena push home.local it gives me some weird errors.

Hey @Dzheky,

What are the errors that you’re getting? It might be helpful to post your docker-compose too.

here is the Error I am getting, I am sorry I am new to dockers, I don’t know where docker compose is, it is not my project, so I guess I use default everything from zibgee2mqtt
05

I’m assuming you’re using the docker-compose here:

 version: '3'
  services:
    zigbee2mqtt:
      container_name: zigbee2mqtt
      image: koenkk/zigbee2mqtt
      volumes:
        - ./data:/app/data
      devices:
        # CC251
        #- /dev/ttyUSB_cc2531:/dev/ttyACM0
        # CC2530 / GBAN GB2530S
        #- /dev/ttyUSB_cc2530:/dev/ttyACM0
      restart: always
      network_mode: host
      environment:
        - TZ=Europe/Amsterdam

if so, I guess the docker-compose parser does not like the lack of any device entry in the devices field. I’m not sure which you need, I guess that would be based on your device type and hardware attached. Which device type are you trying to deploy this on, and which zigbee hardware are you using?

ahh I see what you mean, I am using CC2530, so I need to uncomment this line #- /dev/ttyUSB_cc2530:/dev/ttyACM0, but I still get another error :smiley:
28

I am trying to deploy on Raspberry pi 3+ B

Ah yes I didn’t notice that at first. Balena devices are slightly different in that you need to first define the volume you want to use, so at the top level you want to add something like:

volumes:
  my-volume: {}

Then replace the line

- ./data:/app/data

with

- my-volume:/app/data

and you should be good to go.

1 Like

Yay, this worked, thank you!!

Glad to hear :smiley:

Well I think I am facing another problem that I don’t understand :smiley:
The Docker seems to start and everything good, but the there is inifine

Device state not settled, retrying in 1000ms

and sometimes this

[9/19/2019, 10:45:18 PM] Starting service 'zigbee2mqtt sha256:3e9330c77f739cdb526390f41334ebc92071ad585b428f910c9d9323f8bd4bd6'

This is because you’re running with DEBUG=1, and this will be repeated until the device has finished reaching target state (which means that the application containers have fully started up). If you give it a little bit of time it should get to the point where the device state has settled you should be good to go.