This is technically possible with zwave (“was physical” vs “was digital”), but the problem is that not all manufacturers follow the convention of reporting physical vs digital initiation and, even worse, if the message passes through a repeater the “was physical” information often gets lost, which means the method becomes unreliable. And some manufacturers, such as Evolve, always report every event as “physical.” And some switches don’t send the hub a report at all for physical events.
Put all of this together, and it’s both unreliable and a nightmare to troubleshoot. The issues went on for literally years (3, if I recall correctly), and eventually SmartThings did make the platform change to stop reporting the distinction.
So you could write a custom DTH to try to capture the information for some zwave models, but unless you knew the device would never use a repeater, it might still be unreliable.
There are some commercial installations which get around this by adding a sensor to detect the physical movement of the switch but that’s both expensive and tricky to set up. Then triggering on the sensor or switch and sensor combination. But I don’t think most residential households would like that approach.
(One example used in some secure facilities: put every switch inside a box and capture the box being opened with a contact sensor. Some banks have a pressure mat system under the floor near the switch. Etc)
So I suppose it depends on how important it is to you, and how much you’re willing to spend.
You could probably find some combination of specific zwave model switches in a specific layout that, combined with a custom DTH, might be fairly reliable.
Or you could go to the secondary sensor methods, but that would add a lot of cost and complexity.
(www.rboyapps.com - Making SmartThings Easy!)
To supplement what was mentioned by JD, if the command went from a SmartApp it would be logged in the device recently tap as xxx called by yyy.
As far as for a SmartApp subscribing to the DTH goes no reliable way as each DTH is different, some report digital other don’t and that too depends on how the manufacturer has designed the device.