Wireguard in an esphome device

Hello all,

I have been thinking about running a remote sensor (by that I mean that the sensor is nowhere near my house and my network) that can be connected to my HA. The sensor is connected to an esp8266 or an esp32 which is connected to the wifi in the remote location.

Now, I imagine that this esp must somehow connect to my HA at home but it needs some sort of vpn tunne to do it. For that I found this interesting project:

However, I am a bit puzzled by how to use it for my case. The question is:

can I modify the code that is written by esphome when you “burn” it on the esp device, to include the wireguard code from this project?

This way I could have the esp device connected to the remote network, then conect itself to wireguard which would bring it into my home network and from then on it would be a regular esp device in HA.

Is such a thing possible?

Hi, I’m in a same boat. There is a feature request: WireGuard Support for ESP32 · Issue #1444 · esphome/feature-requests · GitHub

EDIT: I got my esphome project compiled with wireguard added but I don’t know how to configure it.

1 Like

I’m completely new in ESP, but also interested in this topic.

Have we made any ground on this? Would be great!

The WireGuard component has now officially been released by ESPhome in the 2023.9.0 release.

1 Like