How to configure ESPhome with HA core

Hello

I’m busy with the configuration of my ESP home in combination with HA core. After adding the docker container with this configuration:

esphome:
    container_name: esphome
    image: ghcr.io/esphome/esphome
    volumes:
      - /var/lib/docker/data/esphome/config:/config
    restart: always
    privileged: true    
    ports:
      - '6052:6052'
      - '6053:6053'
    environment:
      - USERNAME=esphome
      - PASSWORD=esphome

I get the web GUI, I add the api: text in de config file as described in the manual.
When I try to add the integreatin in HA I got the error:
“Cannot connect to ESP. Make sure your YAML file contains an ‘api:’ line.”
What do I wrong?

That is only for devices flashed with ESPHome. There is no integration for the docker, it is a stand-alone programming environment.

That’s hard, so there is no way to communicate with HA core and ESPHome?

Even with HA OS or Supervised and the add-on, there is little communication. All the add-on does is communicate if a device can be updated. And that is the only thing the docker can’t do between any version of HA. The ESPHome environment (either add-on, docker or python) is really only meant to program ESPHome devices.

I installed a dummy ESP32 with ESPHome (Download by serialport), but the device is not popping up in de webGUI. This means that there is something wrong with my network config (Docker thing?)?

if your ESP yaml contained the line

api:

You have to add the integration to HA

Maybe this will help:

If you run HA core, add-ons are not supported. If you want add-ons, pick another installation method. Add-ons are just nicely packaged software subsystems (standalone applications). The ESPHome add-on is to flash ESPHome devices — nothing more.

Integrations are components in HA to communicate with external services or devices. The ESPHome integration is to connect devices to HA using the HA API. ESPHome devices can also be configured to use MQTT, in which case it will use the MQTT integration (which means you also need an MQTT broker, either installed yourself on a system running HA core, or as an add-on or Docker image).