Hi,
I’ve created two automation, however, the sensor has only 3 events as vibrate, freefall and tilt, there is no OFF state, how do I achieve to Startup the PC when vibration is detected + shut down the PC when no vibration is detected for 30 mins? if the vibration is detected within countdown minutes, these 30 minutes will reset and count down again.
Startup the PC by Vibration Sensor (it worked perfectly)
alias: Startup the PC by Vibration Sensor
description: ''
trigger:
- platform: event
event_type: xiaomi_aqara.movement
event_data:
entity_id: binary_sensor.study_room_vibration
movement_type: vibrate
condition: []
action:
- service: wake_on_lan.send_magic_packet
data:
mac: AA:BB:CC:DD:EE:FF
mode: single
Shutdown the PC by Vibration Sensor (It will not work as the sensor has only 3 events as vibrate, freefall and tilt), anyone has an idea how to achieve it?
alias: Shutdown the PC by Vibration Sensor
description: ''
trigger:
- platform: event
event_type: xiaomi_aqara.movement
event_data:
entity_id: binary_sensor.study_room_vibration
movement_type: ????
condition: []
action:
- service: hassio.addon_stdin
data:
addon: core_rpc_shutdown
input: MyPC
mode: single
Edit: I made a mistake in state: "Detected". It should be state: "true".
This is according to the documentation which states “The sensor is on if the template evaluates as true , yes , on , enable or a positive number. Any other value will render it as off.”
Hi, what device are you using? I have the Aqara vibration sensor but I don’t think it supports movement_type in its event data unless I’m mistaken. Could you share the model number of your device? Thanks!