Esphome not giving encryption key for home assistant. When is that supposed to happen?

Hello all,

I’m having issues when building new esp devices. I am using the web interface and then discovering in esphome. After installing firmware in esphome, I auto discover in home assistant. At no point am I ever asked of given an api key for the connection between home assistant and esphome.

Also the api section of the esp code has no encryption: line or the code.

Can someone help me figure out what I am doing wrong and how to remedy?

To take this a step further. Do you even have to use the api encryption lines to use the esphome device with home assistant?

And lastly is there a way to get the encryption key to regenerate?

The reason I ask the follow ups is the controls seem to be working properly in home assistant for the esp device even though I don’t have the api information in the config.

I would prefer to have the api information in the config if possible.

Thank you all!!

Yes. You should add it along with any other desired config setting

api:
  encryption:
    key: "<your_key"

No. But you should as it is more secure