How to re-enable a device

I have a SOnOff device that I use for testing. When I got done with testing a while ago, I disabled the device and the entities, and deleted the device from the ESPHome tab. I need to do more testing, so I re-enabled the device and its entities, but the switch is still grayed out. I believe that this is because the device does not show up in the ESPHome tab, but I am not sure what to do.

I could add a new device, but I don’t know if this is the right thing to do. Any suggestions?

Showing up in the esphome tab (I assume you mean the esphome UI) has nothing to do with the device’s interaction with HA.

I solved this issue, possibly the hard way, by finding every instance of the device name in /config/*, removing them, then starting over…