Hi!
I’m rather new on Home Assistant, and with ESPHome I started today.
I first added a Wemos D1 mini with a connected button and it work out really great. I got the status to be changed on the dash board and also trigger some notify automation to send e-mail and push notification to the Mobile app.
Next I tried to add another module I had laying. It is a 2 relay output unit for 230VAC and have a AI Thinker ESP8266MOD board on top. ESP Relay Board SPST - ElectroDragon
Revision 1.5.
It is no problem connecting to it and upload yaml config thru USB first time and OTA afterwords.
I also created the two relays as “switch”. But when upload is done I can’t find the entities and the log says that the Home Assistant API connection closed. I have tried different hardware (had 10 of them never used, bought back in 2017), I have also tried delete and re-create the unit in HA, also tried a couple of board models in the yaml config (esp12e, esp01_1m…) but it behavior the same all the time. Also tried with api password in clear text and in secret file, no difference.
From the log:
INFO Reading configuration /config/esphome/relay1.yaml...
INFO Starting log output from relay1.local using esphome API
INFO Successfully connected to relay1.local
[20:22:15][I][app:102]: ESPHome version 2021.12.1 compiled on Dec 15 2021, 19:57:22
[20:22:15][C][wifi:488]: WiFi:
[20:22:15][C][wifi:350]: Local MAC: A0:20:A6:32:8A:A0
[20:22:15][C][wifi:351]: SSID: [redacted]
[20:22:15][C][wifi:352]: IP Address: 192.168.2.155
[20:22:15][C][wifi:354]: BSSID: [redacted]
[20:22:15][C][wifi:355]: Hostname: 'relay1'
[20:22:15][C][wifi:357]: Signal strength: -48 dB ▂▄▆█
[20:22:15][C][wifi:361]: Channel: 1
[20:22:15][C][wifi:362]: Subnet: 255.255.255.0
[20:22:15][C][wifi:363]: Gateway: 192.168.2.1
[20:22:15][C][wifi:364]: DNS1: 192.168.2.1
[20:22:15][C][wifi:365]: DNS2: 8.8.8.8
[20:22:15][C][logger:233]: Logger:
[20:22:15][C][logger:234]: Level: DEBUG
[20:22:15][C][logger:235]: Log Baud Rate: 115200
[20:22:15][C][logger:236]: Hardware UART: UART0
[20:22:15][C][captive_portal:144]: Captive Portal:
[20:22:15][C][ota:082]: Over-The-Air Updates:
[20:22:15][C][ota:083]: Address: relay1.local:8266
[20:22:15][C][ota:086]: Using Password.
[20:22:15][C][api:134]: API Server:
[20:22:15][C][api:135]: Address: relay1.local:6053
[20:22:15][C][api:139]: Using noise encryption: NO
[20:22:15][C][mdns:084]: mDNS:
[20:22:15][C][mdns:085]: Hostname: relay1
[20:23:14][D][api:098]: Accepted 192.168.2.200
[20:23:14][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
[20:24:14][D][api:098]: Accepted 192.168.2.200
[20:24:14][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
[20:25:14][D][api:098]: Accepted 192.168.2.200
[20:25:14][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
[20:26:14][D][api:098]: Accepted 192.168.2.200
[20:26:15][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
[20:27:15][D][api:098]: Accepted 192.168.2.200
[20:27:15][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
[20:28:15][D][api:098]: Accepted 192.168.2.200
[20:28:15][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
[20:29:15][D][api:098]: Accepted 192.168.2.200
[20:29:15][W][api.connection:082]: Home Assistant 2021.12.1 (192.168.2.200): Connection closed
The yaml config is as basic as it can be right now:
Hi!
I didn’t get any question from HA about the password, I got that when adding the first ESP (Wemos), but not the other. So I assumed it should use the same.
Anyway I deleted the “password” line below the api and got a slightly different result, it was success one time then back to connection closed:
Now suddenly when removed the api password from esp config the module is working.
So the problem is api password related.
Just to clear things out: If I put a password for the api inside esp module yaml config file. I also need to specify that password in some other place so that HA could know what password is supposed to be used when authenticat to the ESP module over API. Is that password supposed to be inside the configuration.yaml?
I have now done exactly as you described, included the HA sectrets in ESPhom secrets.
This works great with the Wemos module but on the relay module it is back and giving “conection closed” on the API.
If I delete the password line in that config it is up and running okay, but as soon I add the passwod line again the same fault appear.
I even copied the first part of the config from the wemos file so just the names were different. Same problem, wemos is working but the other module is not. then just delete the password line and both modules are working at the same time.
Could one module support the api password function and the other not?
I am having the same issue … very odd.
2 identical led bulbs with same yaml files with just the name different, and one connects to HA without problem while the other gives errors.
The device itself works as expected. i can use the device using the webserver component directly without HA.
Same issue here 5 identical Esp32 boards with the same function (air quality temp & hum ) throughout the house and of them is giving me the same api 083 and 081
Did not change a thing.
Update:
I did a reinstall of the Esp32. So right bottom corner 3 dot, select install. After that it seemed to work again, for now.
Logger: homeassistant.components.esphome
Source: components/esphome/init.py:309
Integration: ESPHome (documentation, issues)
First occurred: 13 ottobre 2022 21:38:08 (1616 occurrences)
Last logged: 22:04:07
Name of device d1-mini-1 changed to esp8266-rgb, potentially due to IP reassignment
Well: d1-mini-1 was an old Esphome device created but no more used for a long time. esp8266-rgb was a NEW device that always connected and disconnected.
It has been enough to remove everything about the old d1-mini-1 device and everything worked fine.
So I think you should look for something device that shares resources with your problematic one.