Any way to ping the SmartSense Multi for its state?


(Fusion) #1

Is there any way to ping the Multi sensor (or any SmartThing for that matter) for its state? I’m trying to use the threeAxis state to determine if my garage door is closed. It reports its state (open) when the door first starts to close and it can take up to 2.5 minutes to register as closed through the subscription.


(Dan Lieberman) #2

@fusiongroove – The Multi sends accelerometer events during motion, and at 2.5 minute intervals regardless of motion. This is designed to optimize the battery life of the sensor. The Multi should be reporting its threeAxis value several times through its journey from open to closed. You can always check the last reported threeAxis value by doing:

def currentThreeAxisValue = multisensor.currentValue("threeAxis")

But you shouldn’t need to do that - off the top of my head, try turning off event filtering in your subscription:

subscribe(multisensor, "acceleration", accelerationHandler, [filterEvents: false])

Also, there’s also already a device type for the Multi that can automatically set its open/closed state based on its Z-Axis value: SmartSense Virtual Open/Closed. This is designed specifically for the garage door monitoring use-case that you describe.

To set a Multi to be a SmartSense Virtual Open/Closed, you can retype it by selecting your device from the My Devices page in the IDE, clicking the Edit button, selecting SmartSense Virtual Open/Closed from the Type dropdown box, and clicking Update. This will change the behavior of the Multi to report the contact sensor as open when the Z-Axis value is greater than a specific value and report the contact sensor as closed otherwise.


(Fusion) #3

I tried using the virtual open/close device type, but after the change, it no longer showed up in the preferences set-up in the IDE (it was, however, in My Devices with the new device type). Has anyone else run into this problem?