Difference between software on and physical on?


(Chrisb) #1

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.


(Brian Steere) #2

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


(Chrisb) #3

Thx @Dianoga.

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

if (evt.isPhysical) {