I’m trying to setup an external connection with an ESP32 running ESPhome, with the WireGuard component. I’m having trouble adding the esphome device using the WireGuard IP.
Cannot connect to ESP. Please check that your YAML file contains an ‘api:’ line.
A couple of things to note:
I’m running HAOS on Virtual Box, with the host machine running Windows 10.
I’m using the WireGuard add-on, from the add-on store in HA.
HA is going to use it’s default gateway for outbound comms. I’m going to assume the VM is a bridged network with HA pulling DHCP from your router (and having your router set as the gateway). If that’s the case, you need a static route on the router or directly in HA to point to the Wireguard add-on for the Wireguard subnet.
You are right!
The solution is to run this bash script on the CLI (via add-on ssh): host_result=$(host a0d7b954-wireguard); addon_ip=${host_result##* }; ip route replace 192.168.1.0/24 via $addon_ip; echo $addon_ip
Where 192.168.1.0/24 is the subnet of the WireGuard server.