Home Assistant gives compatible Shelly Gen2 and newer devices a Last command source reading. It identifies whether a change came from a physical button, the Shelly app or cloud, MQTT, a timer or a protection event such as overheating.
The diagnostic sensor appears for supported components that report a source, including switches, covers and lights. It helps explain whether a device was operated locally, commanded remotely or responding to one of its own safeguards.