As a preface, I am new to Home Assistant as well as esphome. I have HA installed on a raspberry pi 3b that was lying around. The rpi is currently connected to ethernet due to it having a broken wireless adapter. I installed ESPHome through the supervisor and enabled the sidebar option but when I open it, it gives me a 502 error. I have tried changing the port in the configuration with no success but I am unsure if I did it correctly. I’ve looked at other posters that have had my issue but they don’t seem to find a fix I understand. Any help would be appreciated. Sorry if there’s something obvious about HA that I don’t know yet.
UPDATE:
The issue seems to have been fixed by an “update”. The author reverted back to version 2021.12.1 which has been working fine for me. Thank you for responding and for all your help.
[19:56:33] INFO: Starting ESPHome dashboard...
Traceback (most recent call last):
File "/usr/bin/esphome", line 33, in <module>
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/usr/bin/esphome", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: esphome
i updated to the most recent version of ESPHome earlier today and now I have the 502 error as well. Above are the logs from the ESPHome add-on. I’ve tried restarting the add-on, reinstalling, restarting Home Assistant and that’s about the extent of my abilities, hopefully someone can help.
Well, i spoke too soon…
First, i messed up… i guess OP was talking for ESPHome version, not HA… but, still, my statement "it works " was for HA2021.12.2, like i said above. Now i just updated to 2021.12.4 and it won’t open…nothing happens, just blank screen. ESPHome version is 2021.12.2.
ESPHome log is:
importlib.metadata.PackageNotFoundError: esphome
[07:13:36] INFO: Starting ESPHome dashboard...
Traceback (most recent call last):
File "/usr/bin/esphome", line 33, in <module>
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/usr/bin/esphome", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
raise PackageNotFoundError(name)
Yeah, well. that happens without having my morning coffee first…
i just noticed that with HA update to 2021.12.4 my ESPHome also updated from 2021.12.1 to 2021.12.2… oh, well…
EDIT: restore fo ESPHome 2021.12.1 solves the problem, BTW…
I switched to Nginx Proxy Manager from Caddy and not I’m getting 502: Bad Gateway on ESPHome.
I stopped Nginx Proxy Manager but the error continues.
Even stranger is, I’m getting the following from the ESPHome add-on logs:
[14:19:00] INFO: Waiting for dashboard to come up...
[14:19:00] INFO: Starting NGINX...
nginx: [emerg] invalid port in ":" of the "listen" directive in /etc/nginx/servers/ingress.conf:2
[14:19:01] INFO: Waiting for dashboard to come up...
[14:19:01] INFO: Starting NGINX...
nginx: [emerg] invalid port in ":" of the "listen" directive in /etc/nginx/servers/ingress.conf:2
[14:19:02] INFO: Waiting for dashboard to come up...
[14:19:02] INFO: Starting NGINX...
nginx: [emerg] invalid port in ":" of the "listen" directive in /etc/nginx/servers/ingress.conf:2
[14:19:03] INFO: Waiting for dashboard to come up...
[14:19:03] INFO: Starting NGINX...
nginx: [emerg] invalid port in ":" of the "listen" directive in /etc/nginx/servers/ingress.conf:2
The problem is not fixed.
Does anyone have a solution to this problem?
Home Assistant 2022.9.7
Supervisor 2022.09.1
Operating System 9.0
Frontend 20220907.2 - latest
ESPHome Current version: 2022.9.2
ESPHome home page → three vertical dots of your project → select “clean build files”.
When you get an error of any kind (in general) then always do this first - in many cases it helps. (like version update, going from arduino to esp-idf or reverse… in such cases some kind of errors are often shown).