Devices.yaml being ignored?

All,

Just wondering if I’m missing something here. My configuration.yaml contains:

devices: devices.yaml

That file exists in the same directory (data) and is writable for the user running zigbee2mqtt. However, all new devices get appended in configuration.yaml.

Any idea why?

Thanks!

You need to stop/start zigbee2mqtt in order that it use devices.yaml.
I use it here without any problems.

I’ve been trying to use the devices.yaml since I started using zigbee2mqtt, so I have restarted it plenty of times since then, to no avail.
Which section of the configuration.yaml do you have the option in?

soo, zigbee2mqtt is still running strong, but the problem I have remains. I’m rather surprised that nobody else seems to have it.

So is there anyone that can use a separate file for the devices (that they get added into upon pairing new devices)? If so, could you share your configuration.yaml?

Thanks!

I use a dedicated devices.yaml as well. I’ve had no issues so far. Maybe you had some devices in the main configuration.yaml when you added “devices: devices.yaml”? I would suggest, that you post your complete configuration.yaml here?

Sure, here it is.
Whatever I try, the devices.yaml gets ignored everytime and zigbee2mqtt appends the “newly” found devices to my configuration.yaml.

I obviously deleted the devices from configuration.yaml and put them in devices.yaml.
Is there a special format for the devices.yaml? Does it need to contain “devices:” as the first line?

And yes, the zigbee-port is a link to the real port, so that works.

homeassistant: false
permit_join: false
mqtt:
base_topic: zigbee
server: ‘mqtt://127.0.0.1:1883’
serial:
port: /dev/zigbee2
network_key:
- xx
- yy
- etc
advanced:
channel: 11
log_level: info
pan_id: 6755
experimental:
output: attribute
devices: devices.yaml
groups: groups.yaml
devices:
‘0x00000000001’:
friendly_name: Zigbee_Device_01
etc.

With improper formatting it’s hard to read. Maybe the devices keyword is indented? Here is my (stripped) config:

homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'
serial:
  port: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
  disable_led: false
advanced:
  pan_id: 0x0000
  network_key: '!secret network_key'

devices: devices.yaml
groups: groups.yaml

Check the indentation of your config. My devices.yaml looks just like this:

'0x842e14fffe8d7921':
  friendly_name: '0x842e14fffe8d7921'
'0x588e81fffe320e2b':
  friendly_name: '0x588e81fffe320e2b'

I don’t know how you did that, but even the “preformatted text” using backticks doesn’t show my indentations. Strange. No way to put in verbatim text, either.

But your assumption is correct, I have “devices.yaml” indented because I assumed that it belonged to the “experimental” section. That does not seem to be the case. I’ll remove the indentation and try again tonight.

Thanks!

Great, happy to help. :+1:

I had to figure out the formatting as well. One has to prefix each code line with four spaces.

It was the spaces, it’s working now as expected. Thanks again.
Still, for what it’s worth, I think the yaml-format IS a really weird configuration file format…