Difference between software on and physical on?

Is there a way, in a smart app, to differentiate between when a device is turned on via the Hub (ie, via a SmartApp) and when the the device is turned on via the physical switch?

I’m playing with an app that should behave a certain way if someone turned on a light switch physically, but should NOT do anything if it’s turned on via the Hub.

Yes there is. The event has an isPhysical method you can use for this very purpose (https://graph.api.smartthings.com/ide/doc/event)

1 Like

Thx @Dianoga.

For anyone else looking, the method for calling it goes like this:

if (evt.isPhysical) {