The problem that I have is that it exposes a UI on port 6052 and I have no idea how to open it.
I have tried localhost:6052, my-ip:6052 and it does not work.
How can I open port 6052 in a browser?
Removing network_mode: host and manually adding the port folder let me see the UI, but it can not connect to the outside to get the libraries needed to build.
Looks like this is a problem with mac ( I am using a mac). The docker run command from the FAQ works but I need to set up it as a part of a docker-compose and I can not find the way.
brings the UI, I see my config files, and If I open a device log it eventually opens, but the dashboard shows it continuously as offline.
I also see continuos 304 logs on the terminal:
esphome | 2023-02-19 18:59:43,744 INFO 304 GET /devices (172.22.0.1) 3.31ms
esphome | 2023-02-19 18:59:49,732 INFO 304 GET /devices (172.22.0.1) 2.36ms
esphome | 2023-02-19 18:59:55,343 INFO 304 GET /devices (172.22.0.1) 2.98ms
esphome | 2023-02-19 19:00:01,839 INFO 304 GET /devices (172.22.0.1) 2.23ms
esphome | 2023-02-19 19:00:07,600 INFO 304 GET /devices (172.22.0.1) 3.03ms
esphome | 2023-02-19 19:00:12,739 INFO 304 GET /devices (172.22.0.1) 4.34ms
esphome | 2023-02-19 19:00:18,523 INFO 304 GET /devices (172.22.0.1) 3.35ms
esphome | 2023-02-19 19:00:24,765 INFO 304 GET /devices (172.22.0.1) 3.49ms
esphome | 2023-02-19 19:00:31,047 INFO 304 GET /devices (172.22.0.1) 2.35ms
esphome | 2023-02-19 19:00:36,344 INFO 304 GET /devices (172.22.0.1) 3.74ms
esphome | 2023-02-19 19:00:41,608 INFO 304 GET /devices (172.22.0.1) 2.48ms
esphome | 2023-02-19 19:00:47,520 INFO 304 GET /devices (172.22.0.1) 4.46ms
I ran into a similar issue when trying to configure an ESPHome container on my Mac. Specifically, I couldnāt access the ESPHome dashboard front end and once I figured that out, all of my ESP devices were showing offline even though they were online. The issue is Docker for Mac does not support the network_mode=host, so you have to manually expose port 6052 as mentioned above.
While this allows you to access the ESPHome dashboard, it relies on the host network mode for discovering ESP devices via mDNS. This does not work unless youāre using the host network mode, so the alternative is to set the environment variable ESPHOME_DASHBOARD_USE_PING=true in your docker compose which will use ICMP checks instead of mDNS to check the status of your ESP devices.
Hereās an example of my docker compose entry for ESPHome. Of note, I found that I had to define platform: "linux/amd64" to force using an amd64 container. Iām on a Mac Mini M2 and when it uses the ARM containers, thereās some dependencies that werenāt working.