hassio-zigbee2mqtt icon indicating copy to clipboard operation
hassio-zigbee2mqtt copied to clipboard

Frontend url configuration is overwritten by addon entrypoint

Open mik-laj opened this issue 11 months ago • 0 comments

Description of the issue

Hello,

I would like to have links in Z2M on the device details screen. Similar to what WLED integration provides: Screenshot 2025-01-03 at 16 16 01 ("VISIT" button)

On the HA side, to do this, we need to set the configuration_url field in MQTT config. It is covered by: https://www.home-assistant.io/integrations/mqtt/ Zigbee2mqtt implements the appropriate code that sets this field. https://github.com/Koenkk/zigbee2mqtt/blob/902db5ea5b12ddf7053faae32df4b6b4c48f269b/lib/extension/homeassistant.ts#L1962-L1983 This requires the frontend/url config to be set. Unfortunately, this addon overwrites the entire frontend section configuration. https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/f8e493f2c4610d6f062b6d1082e18f3d53e8d5a6/common/rootfs/docker-entrypoint.sh#L70

Environment variables have higher priority than the configuration file: https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/util/settings.ts#L387-L388

And if we configure an entire section, all section options are overwritten. https://github.com/Koenkk/zigbee2mqtt/blob/902db5ea5b12ddf7053faae32df4b6b4c48f269b/lib/util/settings.ts#L459-L465

It would be great if the extension automatically set the frontend/url value, or at least allowed overriding the value in the configuration file.

Best regards, Kamil Breguła

Addon version

1.42.0-2

Platform

N/A

Logs of the issue (if applicable)

No response

mik-laj avatar Jan 03 '25 15:01 mik-laj