zigbee2mqtt / hassio-zigbee2mqtt

Official Zigbee2MQTT Home Assistant add-on
https://www.zigbee2mqtt.io
Apache License 2.0
1.02k stars 362 forks source link

Parts of my configuration.yaml are ignored (mqtt). How the heck can that be?? #611

Closed segdy closed 1 week ago

segdy commented 1 month ago

Description of the issue

I am just migrating from standalone z2m to the add-on.

I copied my previous config and it definitely works because it finds the devices in my network. However, it totally ignores what I have for MQTT server and always wants to connect to core-mosquitto:1883:

image
$ head /config/zigbee2mqtt/configuration.yaml 
homeassistant: {}
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://10.227.4.10:1884
  reject_unauthorized: false
  user: z2m
  password: *********
serial:

How on earth can that be? Again, the file is definitely correct because it successfully connects to my ser2net port which I have configured in the same file...

Addon version

1.37.1-1

Platform

Core: 2024.3.3 Supervisor: 2024.05.1 Operating System: 12.2 Frontend: 20240307.0

Logs of the issue (if applicable)

No response

torbacz commented 1 month ago

Facing the same issue.

From log: [2024-05-23 08:49:27] info: z2m: Zigbee: disabling joining new devices. [2024-05-23 08:49:27] info: z2m: Connecting to MQTT server at mqtt://core-mosquitto:1883 [2024-05-23 08:49:27] error: z2m: MQTT error: Connection refused: Not authorized [2024-05-23 08:49:27] error: z2m: MQTT failed to connect, exiting... [2024-05-23 08:49:27] info: z2m: Stopping zigbee-herdsman...

But the configuration got: mqtt: base_topic: zigbee2mqtt, server: "core-mosquitto-test" user: "a" password: "a"

Koenkk commented 1 month ago

Home Assistant addon MQTT settings are taken from the addon settings page

heisenberg2980 commented 4 weeks ago

I am facing a similar issue when changing the base_topic from zigbee2mqtt to zigbee2mqtt_garage in the addon settings. Z2M is completely ignoring it and sending the messages to the standard topic zigbee2mqtt.

This is the MQTT section in the addon settings:

mqtt:
  base_topic: zigbee2mqtt_garage

And these are the logs where the topic is zigbee2mqtt instead of zigbee2mqtt_garage (I have replace the device ID with xxxxxxx):

[2024-06-09 00:02:31] info:     z2m:mqtt: MQTT publish: topic 'homeassistant/binary_sensor/xxxxxxxxxxxxxxxxxxx/connection_state/config', payload '{"device":{"hw_version":"zStack3x0 20230507","identifiers":["zigbee2mqtt_bridge_xxxxxxxxxxxxxx"],"manufacturer":"Zigbee2MQTT","model":"Bridge","name":"Zigbee2MQTT Bridge","sw_version":"1.38.0"},"device_class":"connectivity","entity_category":"diagnostic","name":"Connection state","object_id":"zigbee2mqtt_bridge_connection_state","origin":{"name":"Zigbee2MQTT","sw":"1.38.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"offline","payload_on":"online","state_topic":"zigbee2mqtt/bridge/state","unique_id":"bridge_xxxxxxxxxxxxxxx_connection_state_zigbee2mqtt","value_template":"{{ value_json.state }}"}'
JSteunou commented 2 weeks ago

facing the same issue since upgrade to 1.38

everything was fine before in 1.37, I also have a renamed base_topic, since the upgrade it just dont care.

is there an override somewhere?

JSteunou commented 2 weeks ago

Trying to understand why such settings from the addon are not working, @Koenkk is it ok to not have base_topic listed here in schema validation ? https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/master/zigbee2mqtt/config.json#L57

Edit: manually edit my configuration.yml did the trick. The base_topic was not saved in. Did not try other attributes, but seems there is a little issue between the addon configuration page and the related yml file.

Koenkk commented 2 weeks ago

@JSteunou the base_topic can be added indeed (since it needs to be configurable before z2m starts). Could you make a PR for that?