Bed Sensor using Aqara Door/Window Sensor

here i did this

look in the device classes

if its the wrong way round out of bed its shows occupied then you can create a other
binary_sensor

      in_bed_his_side:
        friendly_name: "In bed his side"
        value_template: >-
          {{not is_state("binary_sensor.bed_his_side",'on')}}
        device_class: occupancy

the new way to create a HELPER

a Template binary Sensor