[SOLVED] Integration give error: "Can't connect to ESP. Please make sure your YAML file contains an 'api:' line."

I am in the process of rebuilding my HA from scratch. I have the ESPHome add-on loaded and working perfectly. Currently it has no devices as I have not yet reloaded the yaml files. When I try to add the integration and add the ip address of my HA, I get the error “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.”

I have no idea what ‘api’ line it is referring to.

I do not recall ever getting that error on my first build.

Thanks in advance.

You said you are rebuilding, how old was your old build?
Esphome now requires an api encryption key.

If you add the integration, you have to add the IP of your ESP device, not your HA IP address.

1 Like

only if you use encryption, which is optional.

the the api should be activated in order to connect with it.

Ah!! Yeah, mine was about 2-3 years old

If I have no ESP Devices yet, shouldn’t I still be able to add the integration.

No, you can’t install the integration if no ESP available.

Ah! NOW it makes sense. Thanks