Newbies first automation event

Hello all
i am trying to create an event when a aqara vibration sensor is set to attribute (orientation: 3,0,87)
then it turns a light on.
just can’t get the attribute to work.

triggers

have been using HomeSeer for a while but, I am very interested in home assistant

Thanks in advance
Paul.

you can use ON or OFF and it works, but when i try and use other features of the vibration sensor (orientation: 3,0,87) bo workie. tell me you can use more than just on or off to trigger an action.
Paul.

I don’t have any Aqara devices, so I can’t give you specifics, but the state will report on/off. The orientation is a state attribute. The easiest method would be to create a sensor template for the orientation attribute. After you setup the sensor template as below, you’ll need to restart Home Assistant, then your new sensor can be used in an automation. You would then choose Entity sensor.t_vibration_sensor_orientation

Add to your configuration.yaml

sensor:
  - platform: template
    sensors:
      t_vibration_sensor_orientation:
        value_template: '{{ states.binary_sensor.t_vibration_sensor.orientation }}'
        friendly_name: 'Vibration Sensor Orientation'

If you have broken out your sensors into a separate yaml file, you would simply remove the ‘sensor:’ line from above.

Hope that gets you pointed in the right direction until someone with the sensor can come along with specifics.