Distinguish between physical button press and switch.turn_on service call?

I’m considering ordering a Sonoff ZBMini two control a bathroom vent fan. It seems like it is pretty easy to wire this up to a standard toggle switch and have it work as a two-way (press button on home assistant to turn on fan or toggle physical switch).

I’m trying to plan ahead ways to manage this smartly and I see that on my Sonoff S31 Lite the logbook distinguishes between the relay being toggled in HA (appears as *** turned on triggered by service switch.turn_on) vs pressing the physical button (appears as *** turned on). If I add an ZBMINI to an exhaust fan I’d like to be able to manage the state based on whether it was turned on by the physical control, in which case it would likely stay on until toggled back off, vs being turned on by automation.

There may be room to challenge this question in that it is possible to track via the automation that turned the switch on, but I’d really like to know if it’s possible to leverage the data that appears in the logbook to completely segment the behavior of the fan when it’s turned on via physical toggle vs software.

See this topic: