# Home Assistant integration (MQTT discovery)
homeassistant: true
# allow new devices to join
permit_join: false
# MQTT settings
mqtt:
# MQTT base topic for zigbee2mqtt MQTT messages
base_topic: zigbee2mqtt
# MQTT server URL
server: 'mqtt://localhost'
# MQTT server authentication, uncomment if required:
# user: my_user
# password: my_password
# Serial settings
serial:
# Location of CC2531 USB sniffer
port: /dev/ttyACM0
From a web browser I can access zigbee2mqtt UI by:
http://x.y.z.ĂĄ:8080
I was assuming it should be possible to access to the same web page by clicking on the icon in HA . It is not, not for me at least.
Also, please notice that in the HA configuration file, I have hard coded the IP address “172.18.0.2:8080” whereas when connecting to the mqtt host, I can write localhost and from the beginning I assumed that I could write http://localhost:8080, but I get a message that localhost can not be resolved.
So, I assume I am doing something wrong, but have looked at my lines of code to long …
The iframe is an iframe, it is not being proxied by Home Assistant. Thus you need to use whatever IP address you use to access the zigbee2mqttui in the browser. It is just like using a bookmark.
Localhost of course doesn’t work, because localhost is 127.0.0.1 so will only be access resources on the computer you are actually using the Home Assistant web interface on.
Yeah, localhost don’t work but zigbee2mqtt does not work either. I was reluctant to use IP because I am afraid that any change in docker-compose file can change allocated IP
But, that is how it is… I still cant access zigbee2Mqtt UI page from within HA. I get e timeout error.
You don’t have an option. Again - it is NOT being proxied by Home Assistant, it is no different to using a bookmark. You have to use whatever IP address you use to access it from any other device on the network. You cannot access it via it’s internal docker IP address nor can you access it via localhost.
If however you spin up NginxProxyManager it can be used to proxy the interface.
Because that IP address is only available on the same physical computer that is running the docker containers. If you are accessing the Home Assistant Web interface from a DIFFERENT computer - then it has no knowledge of that IP address, nor any way to reach it.
But this also means that I have unwanted dependencies in my configuration file.
What I mean is, at the moment I am testing new stuff on my development computer.
When I move this configuration to my server I need to edit configuration files.
Is there a clever way to avoid this, like using environment variables or simular?
Somehow your environment variable defined in the compose file does not make it into the container. Did you use docker-compose up -d to re-create the stack?
The error is caused by your compose file where you define the environment twice. The later definition counts and superseeds the first appearance. You can check the outcome of compose file interpretation by running docker-compose config.