No zigbee2mqtt frontend in the HA UI

Hello,

I have a functional Docker installation of Home Assistant, coupled with MQTT and zigbee2mqtt.
While I can access the Z2M frontend on a web browser on the localhost at port 8080, I cannot access it via the HA User Interface.

Here follow my Z2M configuration:

homeassistant: true
permit_join: false
frontend: true
mqtt:
  ...
serial:
  ...
devices:
  ...

In the HA configuration file I have:

panel_iframe:
  portainer:
    title: "Portainer"
    url: "http://192.168.xx.xxx:9000/#/containers"
    icon: mdi:docker
    require_admin: true

  zigbee2mqtt:
    title: "Zigbee2mqtt"
    url: "http://192.168.xx.xxx:8080/#/"
    icon: mdi:zigbee
    require_admin: true

I can access the Portainer UI within the HA UIā€¦but not Z2M.

Looking to some other pertinent information: in the docker-compose file, I have for Portainer (and similarly for Duplicati, which I can also access via iframe in the HA UI)

    ports:
      - "9000:9000/tcp"

while for the other containers I set network_mode: host.
Would that cause the issue ?

It shouldnā€™t, but the documentation for zigbee2mqtt no longer recommends using host networking mode. The only container I use host networking mode with is home assistant. For zigbee2mqtt, Try changing it to a bridge network with port 8080 defined instead. See link below.

Also, you generally canā€™t access local lan ip urls using iframes externally. You will need to configure a reverse proxy and setup the iframe url with the external url that will resolve through the proxy.

Hello,

thanks for your advice.
Actually, when I started to build my Home Assistant configuration, I was using ports.
However I had issues since Z2M was not able to connect to MQTT (as I reported here). This issue was solved by setting everybody as ā€˜hostā€™.

Meanwhile my comprehension of Docker has improved and I guess that another solution would have been, for Z2M, to link not only the 8080 port (as I already did at that time) but also the 1883 so that it could reach the MQTT brokerā€¦but I may be wrong, since I did not see this second port configuration for Z2M on the documentationā€¦ :thinking:

No you specify 1883 for mosquitto only, and my zigbee2mqtt only opens port 8086 for the frontend so you wouldnā€™t also specify 1883. You only list the port one way that ā€œbindsā€ to the container youā€™re running to make the port available for incoming connections outside of itself. If you tried also adding 1883 as a port to zigbee2mqtt as well, you would get an error the port is already in use and the container would fail to start.

I run mosquitto directly on the bare metal of the host Ubuntu OS though and not docker, so that could be the difference. So, that would be the equivalent of running my mosquitto in host networking mode if it were docker. I donā€™t see the harm in running them in host networking mode though and donā€™t think that is causing your issue on its own. Youā€™re just giving it access to more ports then it really needs.

Iā€™ve run zigbee2mqtt both in bridge and host networking mode. The one thing I noticed about accessing the zigbee2mqtt UI is that in host mode,under settings, frontend, frontend binding host, I had to type out the full 192.168.0.whatever IP address to access the UI. In bridge mode with the -ports option, I put frontend binding host in as 0.0.0.0. . Also, make sure the frontend binding port is right- in your case 8080.

1 Like