Detect NodeMCU / MQTT Cover dropping out

I’m in the process of making a garage door controller, based on a NodeMCU and a relay for toggling the garage door motor, inspired by DrZzs’ YouTube video. Both reporting the state from the NodeMCU and commanding the NodeMCU to tripping the relay works fine. But I notice that Home Assistant does nothing when I pull the plug on the controller. Is it possible to have HA poll the controller every now and then, and indicate if the controller is disconnected?