WTH can entity disable / enable only be done via web UI and not API or service call?

I regularly have ESPhome devices go offline in HomeAssistant due to a temporary communications problem. The device recovers (or never loses) its network connectivity, but once HA has lost the connection it doesn’t re-establish communications. The solution is to manually disable the device in the web UI, then re-enable it, then wait 30 seconds and everything is back to working.

The problem is that quite some time can go by until I realize that a device needs a “reset” in this way, and in the meantime the temperature somewhere is getting out of whack, or other undersirable results. If there were an API to disable and enable entities then I could automate this.

I am not the only one with this problem, lots of threads in which people complain about ESPhome devices losing comms with HA. And the API would serve other purposes as well:

1 Like

Thanks for sharing this, Frenck. Your readme is entertaining and sufficiently discouraging that I will take this is as a reference example and not something to actually be used as-is.

Did anyone test spook?