Mi Connector Vibration Sensors HELP!


I have mentioned this before but if anyone is currently using the xiaomi vibration sensors with the Mi connector they do not work as vibration sensors and work as buttons. This makes them completely useless for what they where designed for. If anyone is able to help resolve this fault that would be amazing I have messaged the developer several times but with no response over the last 4 months. I have tried to edit the code myself with no success. I really want to get them working correctly so I can secure the house at night and when not at home.

SmartThings doesn’t have a specific Vibration capability so it needs to be mapped on to something that does exist. I must admit that, while perhaps useful for some, using a button doesn’t strike me as ideal because it doesn’t have binary attribute states (active/inactive, open/closed etc). However if the device/connector only sends ‘vibration’ events, and never ‘no vibration’ events, using a button is an understandable path to take as there is a one to one mapping with what the device actually does.

So what did you have in mind for vibration? Having it respond as something like a motion sensor that SHM or STHM will definitely recognise perhaps?

What have you tried in the way of editing the device handler? It ought to be possible to add the ‘Motion Sensor’ capability and add a sendEvent() to set motion active as well as sending a button push. The very slightly more fiddly part is handling setting it back to inactive again, you’d probably need a runOnce() to do that after a certain delay.

The other option is to create a Simulated Motion Sensor device and use something like webCoRE to set it active on a button press, and then automatically reset it.


Thanks for getting back to me orangebucket (EPIC NAME BTW) so as your see below the following device handlers on that is used by Mi Connector and the other is used without the Mi connector that worked as a vibration sensors.

Device handler (Works as vibration sensors)

Device handler (Does not work as vibration sensors)

I have no way of testing this, but I think I would edit the Mi Connector device handler and add the Motion Sensor capability.

capability "Sensor"
capability "Button"
capability "Configuration"
capability "Refresh"
capability "Motion Sensor" // Add this line.

Then I’d have vibration send a motion active event and also schedule a reset of motion:

if(params.data == "vibrate") {
    buttonEvent(1, "pushed")
    sendEvent( name: "motion", value: "active" ) // Add this line.
    runIn( 65, resetMotion )                     // Add this line.
} else if(params.data == "tilt") {

Then finally at the bottom I’d add:

def resetMotion()
    sendEvent( name: "motion", value: "inactive" )

I’m sure I’ll have forgotten something.

No luck on that front just keeps checking for the status and not connecting, maybe I added it in wrong but its looking for it as a motion sensors rather than vibration, I know in the past with that device handler it did work when it was hit ect. as they are used for the windows in the house if anyone was to break in via the window.

All (well now just both …) my devices that try to display the connection status on tiles in the new app have been permanently stuck on ‘Getting status’ for weeks now. The device detail pages still work when you click on them, it is just the tiles that are hosed. I tried reporting the issue but didn’t get any response.

There is no specific vibration sensor capability. There is an acceleration sensor but I suggested using motion sensor as I know it works with SHM and STHM and also because it is what the ‘bspranger’ device handler does (it uses the acceleration capability for tilt). It may well play with the description of the events to mention vibration (I can’t remember) but it is pretending to be a motion sensor.