History records all events. When triggered by an HA automation, history identifies the source. Events triggered manually using HA or through a 3rd party app appear the same, the source is not identified.
I suggest that history record when an event, such as toggling a switch, is triggered manually using HA. Such as, “Turned off triggered by switch” or equivalent.
This would enable users to determine if an event is triggered by an HA automation, HA manual switch, or an external source. An external event will have no source in history.
I wasted a bit of time trying to figure out what was turning off a switch. It turned out to be a forgotten external automation.
This is independent of manufacturer and integration, such as TP-Link Tapo, Tuya and Shelly outlet plugs.