Detect open toilet seat automation - need help please

hi there

sure, here is my code in config.yaml

  - platform: template
    sensors:
      toiletseat_angle:
        friendly_name: Toiletseat angle
        value_template: "{{ (state_attr('binary_sensor.vibration_6', 'orientation')[1] )}}"
        unit_of_measurement: '°'