There is nothing terribly wrong with the concept of "cloud variables" implemented as an MQTT "retained" message. This script should immediately display the last message stored at the MQTT backend
published earlier as "retained" with
It actually does, with the "retained" attribute (depending on the server implementation).