I think the first thing you need to do is capture the events from the sensor using Developer Tools - Events, enter “zha_event” and press “Start Listening” and you should see something like this:
You can then use this information in an automation trigger and conditions as per the example below:
alias: Aqara D1 Automation
description: Under test
trigger:
- event_data:
device_ieee: '00:15:8d:00:04:77:6a:37'
event_type: zha_event
platform: event
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command in [''left_single''] }}'
sequence:
- device_id: 5320c28c7c1e45c580aa9a5ad9bc4432
domain: light
entity_id: light.kitchen_lights
type: toggle
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command in [''right_single''] }}'
sequence:
- device_id: 92c52b6d053e42e5a472e7b017c60032
domain: switch
entity_id: switch.sonoff03
type: toggle
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command in [''left_double''] }}'
sequence:
- entity_id: input_select.kitchen_scenes
service: input_select.select_previous
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command in [''right_double''] }}'
sequence:
- entity_id: input_select.kitchen_scenes
service: input_select.select_next
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command in [''left_long press''] }}'
sequence:
- device_id: 5320c28c7c1e45c580aa9a5ad9bc4432
domain: light
entity_id: light.kitchen_lights
type: toggle
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command in [''right_long press''] }}'
sequence:
- device_id: 92c52b6d053e42e5a472e7b017c60032
domain: switch
entity_id: switch.sonoff03
type: toggle
default: []
mode: queued
max: 3
I don’t have a vibration sensor so I could be wrong however there would be no harm trying the above.