ESPHome out of no where api error

I have had ESPHome running for a very long time now and several of my lights that are controlled by a ESP board quit responding. I looked and the boards in question are showing up as newly discovered devices for some reason and when I go to configure them again, I am getting the Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line. error.

I can ping the devices no problem and the yaml files look fine (all have some API lines in them), so maybe I’m missing where to add something related to an API line. I have read everything I can find that would solve this problem and everything I find mentions putting in an EPI line, which again I think is there. There’s nothing in the logs that I can find either. Where can I look specifically or what I can post back that woudl help someone be able to point me in the right direction? I did recently update HA and then subsequently restored an backup hoping that would fix it as well as uninstalling ESPHome and reinstalling it, again, to no avail. Help please!

There should be only one api: line in your ESPHome yaml code.
Post an example yaml file.