For the sensor: an FSR strip under the mattress works but needs calibrating per mattress and drifts as the foam ages. Load cells under two legs are more reliable and don’t care about bedding. Avoid PIR, it can’t tell «in bed» from «standing next to the bed».
If it isn't logged, it didn't happen.

