Setting up ESPHome with Home Assistant running in docker

I wanted to start using some DIY smart home devices that I can build using ESP32s. To do so, I installed Home Assistant in docker on my Raspberry Pi that runs a NAS OS. After finding out that using the docker setup, I can´t install addons, I tried installing it the docker way, which I eventually figured out. So what I think I have right now is the following: Home Assistant running in docker, ESPHome running in docker. My question now is: How do I proceed installation to get an ESP32 devkit connected to Home Assistant? I have tried figuring something out following this guide but I was not able to follow the steps that were shown in the article. Somehow there aren´t as many tutorials out there as there are with many other platforms, I cannot find a lot of documentation and tutorials to somehow puzzle a solution together on my own.
Thank you for you tips

From your text I have no clue what you did and what did (not) work
this is my container and from there

docker run -d --name=esphome --net=host -e TZ=Europe/Paris -v [path_to_your_files]:/config esphome/esphome

[path_to_your_files] …this is where your yaml will reside and for me this points to a folder within the config of homeassistant

After that is running, you should be able to open it with http://ipofyourmachine:6052

There are! For Windows, Mac and Linux,

for Docker:

for Python (pip)

https://esphome.io/guides/installing_esphome.html

And as a extra tip: If you are not running a raspberry 4 don’t bother installing the esphome (dashboard) docker on it but rather go with a local pip/docker install on your workstation. The esphome integration is part of ha core and all esphome nodes will work without no matter where they are created (that’s what the esphome dashboard is for) :bulb:

Welcome :wink:

You run esphome, which you say you have installed.

Compile and upload the firmware.

Home assistant should discover it, but if it doesn’t go here Open your Home Assistant instance and show your integrations. and click “Add integration”, search for esphome. It will ask you for the ip address of the new device. Add it, and HA will become aware of the esphome device.

Just a few bits of assistance from someone who has probably been through the same learning curve from very basic beginnings:

  1. Set up your Raspberry PI and install docker as per the many on-line guides.
  2. Make sure that you so a full update and reboot:
    sudo apt update && sudo apt full-upgrade
    sudo reboot
  3. I personally then use portainer to manage and set up containers for ease…
  4. Create two volumes in portainer: one called “home-assistant” and one called “esp32”
  5. Create a container for HA. Give it the latest HA image, add a port (host:8123 container: 8123), in advanced settings (at the bottom) setup a Volume (container: /config volume: home-assistant - local); Run-Time & Resources: privileged mode = on
  6. Deploy the container and go to http://youripaddress:8123
  7. Repeat creating a container for esp32
  8. Give it the latest esp32 image (esphome/esphome:latest). Add a port (host:6052; container 6502)
  9. Add a volume (container /config volume: esp32 - local)
    10 Runtime & Resources: privileged mode = on.
  10. go to http://youipaddress:6052

I suspect its the port mapping in the docker environment that’s been your undoing, but you can then add the integration in HA as per the guidance above,

Hi. I would like to integrate ESPHome the way it integrates with corresponding addon from HAOS.
I managed to create a button on the left side with panel_iframe:

panel_iframe:
  esphome:
    title: "ESP Home"
    url: "https://my-host-name:1443/"
    icon: "mdi:chip"

But this still does not provide automatic key discovery and communication with dashboard regarding updates and their availability (2023.2: How can I Assist? - Home Assistant) - is there a way to get this hooked up having esphome running in one docker container and home assistant in another one?
I just cannot install the supervised version as everything is running on a synology NAS and docker is my only option…

Ps. This is my first post - you are doing a great work! I have already advanced home automation system running on FHEM decided to migrate it to Home Assistant mainly because of esphome :slight_smile: Really GREATly appreciate!

I can’t access http://localhost:6052 even though everything starts correctly. Inside the container log (0.0.0.0 looks suspicious to me):
2024-03-15 15:33:43 2024-03-15 15:33:43,655 INFO Starting dashboard web server on http://0.0.0.0:6052 and configuration dir /config…
2024-03-15 15:34:13 2024-03-15 15:34:13,400 INFO 200 GET /version (127.0.0.1) 1.10ms
2024-03-15 15:34:43 2024-03-15 15:34:43,434 INFO 200 GET /version (127.0.0.1) 0.38ms
2024-03-15 15:35:13 2024-03-15 15:35:13,469 INFO 200 GET /version (127.0.0.1) 0.37ms
2024-03-15 15:35:43 2024-03-15 15:35:43,504 INFO 200 GET /version (127.0.0.1) 0.36ms

That log looks correct.