Xiaomi Vibration Sensor Use Cases

Hello, owners of this sensor :slight_smile:

Could anyone tell me whether this sensor is suitable on doors to detect loud + hard knocking?

I’ve read there are thieves who knock on people’s front doors while observing the house, if they don’t see any activity, they mark it as a target.
My idea is to have this sensor on the inside of the door, set to high sensitivity. If no one is home and knocking is detected, then turn on a few bedroom lights at night.

I’ve just recently installed it on my washing machine. The washing program is pretty distinctive, the ends all have quite a bit of vibrations to get the water out of the clothes. What I do is using a history statistics sensor in count mode, if there are 5 vibrations reported in the last 10 minutes I trigger an automation that delays another 15min (usually the machine has a couple of minutes after the vibrations before it finishes) and then gives me a push notification on my phone.

@wyx087 I guess it depends how rigid your door is and how hard you knock.

2 Likes

I have two attached to two vacuum robots without HA integration. I display status and measure cleaning time.

Hello, I just read this thread. my first thought was the “washing machine” but that’s the classic. The second thought … suppose you have a wooden staircase, then you attach a vibration sensor to level 1, and the second vibration sensor to level 7. Through the status query you can now see whether you have gone up or down the stairs.

2 Likes

Can you share some code of this? I’m also trying to get this to work, but without success…

I’ll copy paste the code here somewhere this week :slight_smile:

Automation:

- id: '1580327578161'
  alias: Alert Wasmachine Finished
  description: ''
  trigger:
  - above: '4'
    entity_id: sensor.wasmachine_vibrations
    platform: numeric_state
  condition:
  - condition: state
    entity_id: input_boolean.wasmachine_programma
    state: 'off'
  action:
  - entity_id: input_boolean.wasmachine_programma
    service: input_boolean.turn_on
  - delay: 00:15:00
  - data:
      data:
        tag: 891
      message: Wasmachine is klaar!
    service: notify.mobile_app
  - data:
  - entity_id: input_boolean.wasmachine_programma
    service: input_boolean.turn_off

Sensor:

  - platform: history_stats
    name: Wasmachine Vibrations
    entity_id: sensor.vib_wasmachine_action
    state: 'vibration'
    type: 'count'
    end: '{{ now() }}'
    duration:
      minutes: 10

That should give you a hand in creating your own :slight_smile:

1 Like

So after a vibration is detected, 15mins later you already receive a notification?

If 5 vibrations are detected within 10 minutes, the automation is triggered, I then wait 15min because after the spinning, the machine needs about 10 or so minutes before it is actually finished with the program.

I will try and see if it also works for my washing machine. Thanks for the info!

I have tried to use the vibration sensor on both my washer and dryer with no luck. (vibrations are strong enough to trigger the sensor)
I have increased the sensitivity to the max also and its still not enough
Im now contemplating pulling the washing machine apart to mount the sensor directly to the barrel as I can imagine there will be a lot more movement there than on the exterior of the machine… has anyone tried this approach?

anyone using this to detect wind and close awnings ?

1 Like

I have put one under the mattress of my bed to see if it can track sleep cycles like deep sleep and REM sleep. At this point I’m just logging the data to see if there is anything interesting in the raw data. Might need to tweak the sensitivity (is at the factory default now). Below you is a graph of some of the values the sensor emits for one night.

4 Likes

Hi …

Have a Smartthings hub and a few lights that flip on with a ST sensor which is set to turn them off after 30 minutes of no motion. I’m looking for exactly the same setup you seem to have (lights to NOT go off when I’m sitting at the desk at which time the motion sensor won’t detect me).

Would you be willing to share the set up you have currently? Specifically

  1. What sensor do you have placed under the desk
  2. Where have you placed that sensor “strategically” (could you share a picture)
  3. What are this sensor’s settings?

Thanks

Hi there.
I’m using the vibration sensor with the conbeeII usb dongle. great integration.
Does anybody know how to see tilt vibration and inclination value of the sensor to be used as trigger or condition in hass.io?

Pretty sure it breaks those out into different sensors. Find the I’d of your sensor then run a find function for that I’d and you will see all of the sensor options. Think there is around 3-4 different ones. Vibration and bed are 2 off top of my head.

I started this topic ages ago and still don’t have a decent use case yet.

1 Like

Mailbox? At least that was my original idea

I have one there but it’s too far from my gateways. Think maybe bed presence sensor.

Cranked open the washing machine and stuck the sensor next to the dum and its much better but every time I need to replace battery or change sensitivity I have have to open the washing machine’s back case. Tiz much easy to use the power status via Sonoff.

for what its worth here is my washing machine code

- alias: WashingMachineActivate
  trigger:
    platform: event
    event_type: xiaomi_aqara.movement
    event_data:
      entity_id: binary_sensor.vibration_158d0002a54c7d
      movement_type: vibrate 
  action:
    - service: timer.start
      entity_id: timer.washmachine_timer

- alias: WashingMachineWorking
  trigger:
    platform: state
    entity_id: timer.washmachine_timer
    to: "active"
    for:
      seconds: 185
  action:
    - service: input_boolean.turn_on
      entity_id: input_boolean.washmachine

- alias: WashingMachineFinish
  trigger:
    platform: event
    event_type: timer.finished
    event_data:
      entity_id: timer.washmachine_timer
  condition:
    condition: state
    entity_id: input_boolean.washmachine
    state: 'on'
  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.washmachine  
    - service: notify.mobile_app_bertybassettiphone11promax
      data:
        title: "Home Assistant"
        message: "The washing machine has completed it cycle, please remove your clothes"  
1 Like

I taped a disk magnet to the sensor with the adhesive ring and stuck it to the dryer door (I have a stacked washer/dryer unit, dryer on top). I am using zigbee2mqtt and set the sensitivity of the sensor to “high”. This by itself gave too many false positives, so I implemented a statistics sensor:

  - platform: history_stats
    name: vibe_count
    entity_id: sensor.aqara_vib_action
    state: 'vibration'
    type: count
    end: '{{ now() }}'
    duration: 00:10:00

Everything else is similar as posted above. If vibe_count goes above 4 the dryer timer gets cancelled & started again (there was a bug where timers wouldn’t reset if you just started them again, cancelling them first is the workaround, this might be gone by now, I haven’t checked). If the timer expires, I get a message over Alexa. This is sensitive enough to detect both washer and dryer cycles ending.

1 Like