Had my “home assistant green” set up with 2 voice PE for about a week. Then we recently switched to att fiber so I went to connect them to the new network. And I clearly messed up somewhere. Went through all the steps, connected to wifi, asked to add it to esphome then its requiring a host? What’s a host?? I don’t recall putting that info in and can’t find it in the online documents. I factory reset one of the Voice PE’s and followed the setup document, get to ESPhome again and it asks for the Host. I’m still VERY new to this and don’t really know much past the plug and play aspect, so speak to me like you teaching a toddler please lol
It’s asking for the hostname (or IP address) of the ESPHome device.
Entered the ip address into the esphost and got “Can’t connect to ESP. Please make sure Ο your YAML file contains an ‘api:’ line”
ESPhome uses the devices hostname to connect and make updates. It does not use the devices IP address. Think of hostnames like google.com. It is a word that can be translated, using DNS, to an IP address.
If I had to guess the hostname cannot be resolved (translated to IP) on your network and esphome is unable to update the devices wifi as a result. this is a guess.
Did you “take control” of the voice PE?
Did you try this?
I havent worked with the voice PE so not familiar with how it operates.
Do you have other esphome devices?
Setup asked me to turn on wifi and bluetooth.
The device was discovered, asked to connect to the same wifi my phone is using, 2.4ghz at the time. It says connecting, connected, then the lights flash white and the Please enter host* box pops up. Does asked anything about control this time around.
I dont think I have any other Esphome devices
I have a the HA green, Zigbee dongle, 4 Cync bulbs and thats it so far. (plus the two voice PE obvi) Oh and Flic buttons
what happens if you enter a hostname. for example, if this voice PE will be in living room make the hostname “living room”
“Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.”
Done twice on each devices, right back to the same input host “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.”
Are you sure it installed.
20th times a charm😁
Is your Voice PE on the same network as your HA installation? Or maybe in a separate vlan?
When I set up my Voice PE last week, I had this exact problem (Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line). Spent many hours troubleshooting, tried all the suggestions on the forum, but nothing worked.
For me, it turned out to be an “operator error” on my part.
I had put the Voice PE in vlan on my router that’s firewalled from the main network. Once I gave the PE device access to the main network, I was able to complete setup and the PE was up and running in less than 5 minutes!
Pretty sure its on the same network
…idk what a vlan is…so maybe?
How do I tell?
I don’t use Home Assistant Voice, but a LOT of ESPHome devices. Usually DIY devices. When the integration is asking for the host, it wants the name you gave it in the Yaml file:
esphome:
name: lamp
The IP of the device works as well. (I usually use the IP).
From your OP, I would guess that your new network means that your IP has changed.
Do you know the IP address of the ESPHome device?
Can you ping the ESPHome device from a Windows command line?
Can you ping the ESPHome device using: ping my_device.local /4?
What is the IP of your router?
What is the IP of your PC?
I suspect that we may see a clue in these answers.
Also, post your ESPHome device YAML file.
I never had to figure out any of this before with the first install so bear with me please!
Never named it,so idk
Router shows the IP of the Voice device as 192.168.68.0, which is reserved
Can you ping the ESPHome device from a Windows command line?
Can you ping the ESPHome device using: ping my_device.local /4?
I have no clue what this means…
IPv4 IP
104.185.178.27
As for the YAML…there doesnt appear to be one in the ESPHome folder?
Here is the dictionary definition:
A VLAN, or Virtual Local Area Network, is a way to segment a physical network into multiple, logically separated networks. Essentially, it allows you to create separate networks within the same physical infrastructure. Each VLAN acts like a distinct network, ensuring that devices within the same VLAN can communicate with each other, but devices in different VLANs cannot, unless specifically allowed.
In most homes, a VLAN offers little benefit. I use a VLAN strictly for router management. With over 100 clients, my client list is large and (at least in my router) I can easily filter what I am seeing.
This does not look right.
What is your Router and PC IP addresses?
ipconfig
Ipconfig returns a lot. Here is the first few lines from mine:
C:\Users\steve>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : lan
Link-local IPv6 Address . . . . . : fe80::cf04:ea0f:1dcd:2faf%7
IPv4 Address. . . . . . . . . . . : 192.168.1.159
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
The Default Gateway is your router’s IP. On my network, everything is on an IP of 192.168.1.x, where x can be anything from 1 to 254. So what are your router and PC IP addresses?
Next, find the IP of your ESPHome device. When you compiled the YAML configuration you would have had an opportunity to see the device IP address. Alternately you can use a free IP Scanner tool. By default, it scans your network for all devices from 192.168.1.1 to 192.168.1.254
What is the IP address of the ESPHome device?
Can you ping it?
C:\Users\steve>ping 192.168.1.124
Pinging 192.168.1.124 with 32 bytes of data:
Reply from 192.168.1.124: bytes=32 time=1ms TTL=64
Reply from 192.168.1.124: bytes=32 time=1ms TTL=64
Reply from 192.168.1.124: bytes=32 time=1ms TTL=64
Reply from 192.168.1.124: bytes=32 time=1ms TTL=64
Ping statistics for 192.168.1.124:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
This ping verifies that the device at 192.168.1.124 is on the same network as my PC.
Or by the “ESPHome device” do you mean the HA green?
ipconfig
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : attlocal.net
IPv6 Address. . . . . . . . . . . : 2600:1700:b0:9cc0::3a
IPv6 Address. . . . . . . . . . . : 2600:1700:b0:9cc0:79c8:9738:f032:4258
Temporary IPv6 Address. . . . . . : 2600:1700:b0:9cc0:4cf0:44f3:c0c9:36a6
Link-local IPv6 Address . . . . . : fe80::ae70:7eca:552d:d09e%16
IPv4 Address. . . . . . . . . . . : 192.168.1.234
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::9293:5aff:fe20:7428%16
192.168.1.254
The ESPhome Voice Device IP according to my router is 192.168.68.60
I never was prompted to configure a YAML to see it another way
C:\Users\Cody>ping 192.168.68.60
Pinging 192.168.68.60 with 32 bytes of data:
Reply from 192.168.68.60: bytes=32 time=150ms TTL=64
Reply from 192.168.68.60: bytes=32 time=67ms TTL=64
Reply from 192.168.68.60: bytes=32 time=60ms TTL=64
Reply from 192.168.68.60: bytes=32 time=71ms TTL=64
Can you ping it?
Ping statistics for 192.168.68.60:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 60ms, Maximum = 150ms, Average = 87ms
Please don’t post screenshots. They are usually illegible.
The YAML files are in /config/esphome.
➜ esphome ls -al /config/esphome
total 3728
drwxr-xr-x 19 root root 4096 Feb 5 01:25 .
drwxrwxrwx 22 root root 4096 Feb 5 07:45 ..
-rw-r--r-- 1 root root 233 Mar 4 2021 .gitignore
drwxr-xr-x 2 root root 4096 Jan 9 13:18 Archives
drwxr-xr-x 2 root root 4096 May 14 2021 Saved YAML files
-rwxr--r-- 1 root root 3250 Apr 11 2021 WemosSwitch - Copy.txt
-rwxr--r-- 1 root root 1036584 Dec 7 2019 arial.ttf
-rwxr--r-- 1 root root 980756 Dec 7 2019 arialbd.ttf
-rwxr--r-- 1 root root 721144 Dec 7 2019 arialbi.ttf
-rwxr--r-- 1 root root 717428 Dec 7 2019 ariali.ttf
-rw-r--r-- 1 root root 2306 Jun 24 2024 attic-sensors.yaml
-rw-r--r-- 1 root root 1490 Apr 8 2024 basement-sconces.yaml
-rw-r--r-- 1 root root 340 Nov 24 01:01 ble-tracker-test.yaml
-rw-r--r-- 1 root root 888 Jan 11 12:03 blink.yaml
-rw-r--r-- 1 root root 826 Nov 24 18:09 bluetooth-proxy-2.yaml
drwxr-xr-x 3 root root 4096 Oct 10 2021 closet_pir
-rw-r--r-- 1 root root 2486 Nov 13 18:04 closetpir.yaml
drwxr-xr-x 3 root root 4096 Jan 9 16:40 common
drwxr-xr-x 3 root root 4096 Mar 11 2022 components
-rw-r--r-- 1 root root 1303 Dec 28 23:45 desktop-pir.yaml
-rw-r--r-- 1 root root 729 Jun 27 2023 dining-room.yaml
-rw-r--r-- 1 root root 2199 Dec 5 2023 dinnerbell.yaml
-rw-r--r-- 1 root root 1366 May 28 2024 electric-fence.yaml
-rw-r--r-- 1 root root 8885 Nov 4 21:18 esp12f-relay-board.yaml
-rw-r--r-- 1 root root 572 Nov 24 00:16 esp32-bluetooth-prox
Scary, isn’t it?
There are, however, easier ways. When you installed ESPHome Device Builder, you should have a button on the sidebar. This is where you can manage and edit your YAML files for ESPHome devices.
Another way that I use a lot is using the Samba Share add-on. Add this to your HOme Assistant and the file structure of Home Assistant can be viewed on the Windows File Manager.
Wait, what?
Where did you get the ESPHome YAML file if you didn’t write it?
Is it pre-built into a device you bought?