I am planning to build a ESP8266 device that will be auto-discovered though MQTT.
As I was thinking about the heartbeat to send to HA (or whether to send one at all) I realized that I do not know why/when an entity becomes unavailable
in HA. Despite this being quite an obvious question, I did not see (= missed) the relevant documentation or discussions on that topic.
So how does an entity become unavailable
? Is it because of a lack of activity? Or a specific heartbeat message? Or something else?