ESPHome from remote location


I’m looking for the best way to setup ESPHOME, and use it from a remote location.

Setting up the wifi is no problem, but is it possible to use the API og would the best way be MQTT?

Anyone who has done anything like this?


@bloody2k can you explain a little more about your use case please?

Off course :blush: I got a small office a couple of km away from my home where I would like control a outlet.

To do that I was thinking about putting a sonoff, flashed with ESPHOME at the office, connected to the internet via WiFi at the location. But then I need to make a remote connection to my HASS-server at home, and I would like to know how to do that the best way.

A VPN possibly.

I’m not too sure if there is a way to do this using the ESPHome native API however there are a couple of options I can think of:

  1. Set up your ESPHome Sonoff device to use a MQTT server that is accessable via the internet (and disable the native API function - You could either open up your MQTT server running on your HA server (making sure it is setup securely with passwords and ssl) or you could use a public server. Problem with doing it this way is that you will loose the functionality of over the air updates and viewing logs via the ESPHome interface in Home Assistant.

  2. Another way of doing this is to set up a site to site VPN if your router(s) support this. I have ESPHome devices working over a site to site VPN. However, this will require some techical knowlege and the right equipment avaliable in order to set it up.

1 Like