Z2M won´t start - required add-on configuration 'data_path' option is missing!

Hi Community

I’m new to Home Assistant but have made some progress in configuring my smart home. However, I’ve encountered some devices that aren’t fully supported by ZHA, so I’ve decided to try Zigbee2MQTT.I’m currently running Home Assistant OS on a Raspberry Pi 5 with Sonoff E-dongle and following a video guide to set up Zigbee2MQTT. I’ve completed all the steps, but when I press “Start” on the add-on, the log is filled with repetitive errors:

INFO: Preparing to start...
ERROR: Something went wrong contacting the API
FATAL: A required add-on configuration option is missing!
FATAL: Please set a value for the 'data_path' option.
FATAL: If unsure, check the add-on manual for more information

I’m using the default data_path of /config/zigbee2mqtt. Here’s my current MQTT configuration:

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt: {}
serial:
  port: /dev/ttyACM0
  adapter: ezsp

I have tried to re-install the addon, tried also to restore from back up and re-install again with no luck.

I suspect that I might be missing something trivial but non-obvious to newbies . Please help me to understand:

  1. Where is the configuration file located in my installation?
  2. Why can’t I find the /config/zigbee2mqtt folder? Shouldn’t it be created automatically during installation?
  3. What should the correct setting for the data_path option be if it differs from the default?

Any guidance would be greatly appreciated! Thank you!

You need to specify an mqtt broker. It is after all zigbee to mqtt.

Do you have the mosquitto mqtt add-on installed?

Also search the forum for “USB serial by ID”. This value can change, breaking your system:

serial:
  port: /dev/ttyACM0

Serial by id will not change.

Hi Tom

Thnks for your reply.

I do have mosquitto mqtt add-on installed. I can´t figure out how this section of config is related to the data_path. mqtt: {}

And as far as i´ve understood from the oficial guide it can be left empty by default in case of mosquitto mqtt

If you are not using the Mosquitto broker add-on fill in your MQTT details (leave empty when using the Mosquitto broker add-on) under the mqtt section. [ :link: source ]

I have amended ´serial:´ section to serial by ID. It does not seem relevant to my ERROR, however thanks for advise.

  1. Where is the configuration file located in my installation? - I´m writing config through plugin interface, but can´t find where it is stored. I expected to find it in data_path /config/zigbee2mqtt but thre were no such folder created automatically.

  2. What should the correct setting for the data_path option be if it differs from the default? Is my understanding correct that data_path is the same folder where config of addon is located ?

It should not be in there at all. I could not find it in the documentation: Configuration | Zigbee2MQTT and it is not in my working config:

external_converters: []
devices:
  - devices.yaml
groups:
  - groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  user: <readcted>
  password: <readcted>
  server: mqtt://10.1.1.100:1883
  keepalive: 60
  reject_unauthorized: true
  version: 4
  include_device_information: true
serial: 
  port: tcp://10.1.1.210:6638  
advanced:
  log_level: warning
  pan_id: <redacted>
  channel: 25
  network_key:
    - <readcted>
  availability_blocklist: []
  availability_passlist: []
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental: {}
availability:
  active:
    timeout: 10
  passive:
    timeout: 1500

well… It is actually a compulsory field in the add-on interface and the value was pre-filled.

I´m using the addon from oficial z2m repo

Ok, you’re using the add-on interface rather than config/zigbee2mqtt/configuration.yaml to configure it. That’s ok to get it going. But you will have to use either that file or the web interface to continue configuring it later.

I’m almost certain the data_path is not your issue. It’s the missing mqtt user details. Add it.

I added and it did not help.

Also, the official guide says that the settings made in user interface overide the settings in config/zigbee2mqtt/configuration.yaml.

I have also tried to create the file and put config there. Same story :frowning:

As well as an mqtt user and password try adding the server

  server: mqtt://your_ha_ip_address_here:1883
INFO: Preparing to start...
ERROR: Something went wrong contacting the API
FATAL: A required add-on configuration option is missing!
FATAL: Please set a value for the 'data_path' option.
FATAL: If unsure, check the add-on manual for more information

The second line indicates that the add-on has problems connecting to the supervisor (which is responsible for connecting your add-on settings from the frontend with the add-on logic running zigbee2mqtt.) Is there anything in the supervisor logs? You are running OS and not supervised, right?