Many bindings will set an Item to UNDEF in the event of communications failure.
That’s a bit harder when you are relying on incoming unsolicited messages, like MQTT.
Expire binding was invented for this (but has a lot of other uses!)
But MQTT itself does have a feature that you should be able to exploit, LWT.
Example -