MQTT has a "last wish" or "testament". So you know that it went offline.
also, MQTT has a "retain" flag that lets a publish linger on a topic to be read later, even when the publisher has gone offline. Seems like "shadows" is a fancy name for what MQTT already gives you.