ESPhome device builder: how to add include files?

I’m using the latest version of the ESPhome device builder.
I want to add a .h include file to a project.
I know I have to link it in the main esphome section:

esphome:
  includes:
    - usb_relay.h

but where do I put that .h file? should I upload it via web GUI? I don’t see any way to do that.

  1. First, install Advanced SSH & Web Terminal app.
  2. Go to the Info tab and disable Protection mode.
  3. Go to the Configuration tab of the app and scroll down to the ssh section.
    Set the username to root.
    Type in a password of your choice.
    Set sftp to true (enable).
    Set compatibility_mode to true (enable).
  4. Click Save.

Now you have access to your Home Assistant environment via SSH and SFTP.
If you use Linux, you can access it via the terminal using ssh and scp. If you prefer Windows, you can run ssh and scp directly from the Command Prompt (cmd) or PowerShell. If you prefer a graphical user interface (GUI), I highly recommend using WinSCP.

Once you can see the file listing in your Home Assistant environment, you will find your ESPHome files under the config/esphome directory.

I hope a GUI will be provided for it sometime in the future.

Another way to do it.
Install the Samba app (Common tasks - Home Assistant Operating System - Home Assistant). Then your HA system files can be accessed via a network share from any computer on your network, with logon credentials of your choosing.

The Esphome directory is \config\esphome

Another option: Create a new file using the simple File Editor integration and cut, paste and save it to your server location direct from the GUI. Simplez!

Gotcha: bet your included file has other includes. It gets messy. Try the Arduino IDF option.

I use the HA container so no apps for me. Accessing via SSH or SFTP is the only way.