Skip to content

Addon config editor strips adapter: ember and mis-indents YAML in Zigbee2MQTT options #822

@rgbigel

Description

@rgbigel

Description of the issue

When configuring Zigbee2MQTT via the Home Assistant addon options UI:

  • The editor rewrites the YAML and removes or misplaces the adapter: ember line.
  • It also mis-indents keys, placing adapter under serial: instead of at the top level.
    This causes Zigbee2MQTT to start without the correct adapter setting, leading to errors such as:

zh:adapter:discovery: Unable to match USB adapter: ember
port: /dev/serial/by-id/...
zh:ember:uart:ash: ======== ASH stopped ========
Error: No such file or directory, cannot open port

Steps to reproduce

  1. Open the Zigbee2MQTT addon options in Home Assistant.
  2. Enter values for:

serial:
__port: /dev/ttyUSB0
__baudrate: 115200
__rtscts: true
adapter: ember

Click Save.
The editor strips empty lines and moves adapter: ember inside serial: instead of keeping it at the top level.
Restart Zigbee2MQTT → startup fails with ASH errors.

Expected behavior
The addon should:

Preserve adapter: ember as a top-level key in the YAML.
Avoid altering indentation of valid keys.

Additional context
Editing /config/zigbee2mqtt/configuration.yaml directly via File Editor works correctly. The bug only occurs when using the addon options UI.
(Side note: I entered "port: /dev/ttyUSB0" in the port section, and the YAML doubled the port: into
port: port: /dev/ttyUSB0. I assume was a change or some documentation is off, even in videos, where it is entered exacly the way I did.)

Addon version

2.6.3-1

Platform

Home Assistant OS 12.3
Zigbee2MQTT addon (2.6.3-1)
Sonoff Dongle Plus MG24, flashed with EmberZNet 8.0.2 Coordinator firmware
or
SMLIGHT SLZB-07, flashed with the SMLIGHT online Flasher (newest stable 4.0.x)

Logs of the issue (if applicable)

This is the correct indentation:

serial:
__port: /dev/ttyUSB0
__baudrate: 115200
__rtscts: true
adapter: ember

but it generates:

serial:
__port: /dev/ttyUSB0
__adapter: ember
__baudrate: 115200
__rtscts: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions