Git Product home page Git Product logo

Comments (6)

OliverHi avatar OliverHi commented on July 30, 2024 1

Hi, a short description of what you have tried so far would be helpful! From the log Connecting to MQTT server at mqtt://localhost I can see that most likely you have not shared your actual configuration here but instead pointed Zigbee2MQTT to localhost to find the MQTT server. This won't work as in this setup they are not actually running on the same machine but on different Docker containers.
If you are using my setup file here try it with either mqtt://mosquitto (uses the MQTT brokers container name) or the IP of your server like mqtt://192.168.2.4 for example in the zigbee2mqtt configuration and check the logs to see if mosquitto did actually start up properly.

from smarthomeserver.

kathodion avatar kathodion commented on July 30, 2024

Hi, a short description of what you have tried so far would be helpful! From the log Connecting to MQTT server at mqtt://localhost I can see that most likely you have not shared your actual configuration here but instead pointed Zigbee2MQTT to localhost to find the MQTT server. This won't work as in this setup they are not actually running on the same machine but on different Docker containers. If you are using my setup file here try it with either mqtt://mosquitto (uses the MQTT brokers container name) or the IP of your server like mqtt://192.168.2.4 for example in the zigbee2mqtt configuration and check the logs to see if mosquitto did actually start up properly.

Thank you @OliverHi
I will have a look later. I was confused about the server ip setting part.

mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.2.4 # your mqtt broker IP

What IP I should use. Because I have all services in one compose file (grafana, influx, mqtt, mosquitto etc.)

Give a Update here later

from smarthomeserver.

kathodion avatar kathodion commented on July 30, 2024
Using '/app/data' as data directory
Zigbee2MQTT:info  2022-12-28 13:07:53: Logging to console and directory: '/app/data/log/2022-12-28.13-07-53' filename: log.txt
Zigbee2MQTT:info  2022-12-28 13:07:53: Starting Zigbee2MQTT version 1.28.4 (commit #52e545f)
Zigbee2MQTT:info  2022-12-28 13:07:53: Starting zigbee-herdsman (0.14.76)
Zigbee2MQTT:info  2022-12-28 13:07:54: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-12-28 13:07:54: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":114,"product":0,"revision":"0x26720700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info  2022-12-28 13:07:54: Currently 0 devices are joined:
Zigbee2MQTT:warn  2022-12-28 13:07:54: `permit_join` set to  `true` in configuration.yaml.
Zigbee2MQTT:warn  2022-12-28 13:07:54: Allowing new devices to join.
Zigbee2MQTT:warn  2022-12-28 13:07:54: Set `permit_join` to `false` once you joined all devices.
Zigbee2MQTT:info  2022-12-28 13:07:54: Zigbee: allowing new devices to join.
Zigbee2MQTT:info  2022-12-28 13:07:55: Connecting to MQTT server at mqtt://localhost
Zigbee2MQTT:error 2022-12-28 13:07:55: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:error 2022-12-28 13:07:55: MQTT failed to connect, exiting...
Zigbee2MQTT:info  2022-12-28 13:07:55: Stopping zigbee-herdsman...
Zigbee2MQTT:error 2022-12-28 13:07:56: MQTT error: connect ECONNREFUSED 127.0.0.1:1883
Zigbee2MQTT:info  2022-12-28 13:07:57: Stopped zigbee-herdsman
Using '/app/data' as data directory

dump from the Zigbee2MQTT container. I think the container does not pick up the container config.

docker compose part of Zigbee2MQTT

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    depends_on:
      mosquitto:
        condition: service_started
    restart: unless-stopped
    ports:
      - 6090:8080 # if you enabled the web UI
    volumes:
      - ${DATADIR}/zigbee2mqtt:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/ttyACM0:/dev/ttyACM0 # or whichever port your Zigbee stick is connected to
    environment:
      - TZ=${TZ}

zigbee2mqtt config file

homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://172.18.0.6 # your mqtt broker IP
serial:  
 port: /dev/ttyACM0
frontend: true
advanced:
  network_key: GENERATE # generates a new key on first start and automatically replaces this

compose logs
myDockerCompose.log

How do I tell zigbee2mqtt to grab which config file?

from smarthomeserver.

OliverHi avatar OliverHi commented on July 30, 2024

Your Zigbee container is using the shared folder - ${DATADIR}/zigbee2mqtt:/app/data so you should check ${DATADIR}/zigbee2mqtt on your file system. Move a file called configuration.yaml with the content of your zigbee2mqtt config file there and restart the container. It should now use the configurations from this file.
If all containers are in the same yaml file then using mqtt://mosquitto as a server name in the config should work.

from smarthomeserver.

kathodion avatar kathodion commented on July 30, 2024

Your Zigbee container is using the shared folder - ${DATADIR}/zigbee2mqtt:/app/data so you should check ${DATADIR}/zigbee2mqtt on your file system. Move a file called configuration.yaml with the content of your zigbee2mqtt config file there and restart the container. It should now use the configurations from this file. If all containers are in the same yaml file then using mqtt://mosquitto as a server name in the config should work.

at first thank you @OliverHi for your support.

I got my containers running with your help and some other resource.
I also update my conbee2 to the latest firmware - this might also be an issue.

This setup works for me now

zigbee2mqtt yml

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    restart: always
    # ports:
    #   - 6090:8080 # if you enabled the web UI
    volumes:
      - ${DATADIR}/zigbee2mqtt/data:/app/data/
      # - /run/udev:/run/udev:ro
    devices:
      - /dev/ttyACM0:/dev/ttyACM0 # or whichever port your Zigbee stick is connected to
    environment:
      - TZ=${TZ}
    depends_on:
      - mosquitto
    network_mode: host

zigbee2mqtt config file

homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.0.177:2800
  client_id: zigbee2mqtt
  include_device_information: true
frontend: true
serial:
  port: /dev/ttyACM0
  disable_led: false
  adapter: deconz
advanced:
  homeassistant_discovery_topic: homeassistant

mosquito yml

  mosquito:
    container_name: mosquitto
    image: eclipse-mosquitto
    restart: unless-stopped
    volumes:
      - "${DATADIR}/mosquitto:/mosquitto/config"
      - "${DATADIR}/mosquitto:/mosquitto/data"
      - "${DATADIR}/mosquitto:/mosquitto/log"
    ports:
      - 2800:2800
      - 9100:9100
    stdin_open: true
    tty: true
volumes:
  config:
  data:
  log:

mosquito config file

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
allow_anonymous true
# password_file /mosquitto/config/pwfile
listener 2800
listener 9100
protocol websockets

from smarthomeserver.

kathodion avatar kathodion commented on July 30, 2024

issues resolved

from smarthomeserver.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.