Problem integrating vibration sensor (for Dryer Done alert)

I have a Vision Wireless Shock Sensor (brand new though battery at 66% already)

I’ve searched and found a variety of code for Device Types and Smart Apps that seem to relate, but I’m having difficulty understanding what I need to do to get to my goal.

I was able to set up a Custom monitoring rule, though my device is only seen as an Open/Close sensor…which I assume is why I can’t use it in some of the existing SmartApps that want a vibration sensor.

I’d also like to be able to flash a light for a short period of time, but the Custom rule only seemed to let me set brightness and color.

How do I modify the configuration of the device, or adjust the SmartApps to get what I’m looking for?

I am a programmer, but I’m a little unclear how to use a custom Device Handler vs. a Smart App.

Total newbie…and haven’t read a manual yet…but I’d have thought this would be a feature already in place, and not require any custom programming. Its been a bit confusing that code and comments seem to relate to an older version of the SmartThings portal, so some terms have changed etc.

A Device Handler is what allows the “thing” to communicate with SmartThings. The SmartApp is what controls the “thing” by sending it commands.

If you have added in a custom Device Handler Type into the IDE already, you can go in and select that Device in the list from My Devices, then change the Device Type to the custom code (these custom ones are at the bottom of the drop down list).

To do this, you go to the device and click on it. Scroll down and click on the big Edit button at the bottom. Locate the drop down menu for Type and find the custom device type you added. Select it and hit Update.

If you still need to add in the custom Device Handler Type, log into the IDE and go to My Device Handlers at the top.
Click on the green +Create New Device Handler in the top right corner.
Click on the tab for From Code and paste in the code you find on here or GitHub.
Save it and click Publish -> For Me.

To do a Smart App, it’s the same way except under the My SmartApps tab.

1 Like

[Quote=“cmeans, post:1, topic:38289”]
I was able to set up a Custom monitoring rule, though my device is only seen as an Open/Close sensor…which I assume is why I can’t use it in some of the existing SmartApps that want a vibration sensor.
[/quote]There’s often a better Device Handler than the one that ST automatically assigns to a device. If you go into the devices section of the IDE ( http://graph.api.smartthings.com ), you can change the “Type” to a different device handler. If you want to detect vibration, the device needs to support the Acceleration capability.

[quote=“cmeans, post:1, topic:38289”]
I am a programmer, but I’m a little unclear how to use a custom Device Handler vs. a Smart App.
[/quote]You should be able to get a general understanding of the differences between the two by skimming the SmartApps and Device Handlers sections of the documentation. One simple home system. A world of possibilities. | SmartThings.

[quote=“cmeans, post:1, topic:38289”]
I’d have thought this would be a feature already in place, and not require any custom programming
[/quote]SmartThings falls short in this area, but there’s a custom SmartApp called Rule Machine that allows you to do pretty much anything you can think of without having to write any code.

2 Likes

Thanks! Being able to change an existing device’s Device Type did the trick (using the new Device Type Handler I’d found).

1 Like