You guys are way overthinking the problem of determining whether or not someone is in the bed. Use a pulsor sensor:
http://www.iautomate.com/pulsor.html
They attach to the bottom of a roof, floor joist, etc. They are just a sensor from a digital scale that detects the flex in whatever you attach it to. You adjust the sensitivity on the controller unit to trip it when it changes more than a certain amount. They are very sensitive. Just attach it to the bottom of the bed frame, the middle of the platform in a platform bed, or a cross brace on the box spring. Set the threshold/weight on the controller, and it will trip an output wired to an input on your HA controller.
Oh, if life was so easy. First of all, you need more then the sensor, you also need the processor that goes with it. This is an additional cost. Second, they aren't a "scale" they are a stress sensor. And most important, they don't detect if someone is present or not, they ONLY detect when someone enters or leaves the area where they are mounted. In other words, if you want to use them to trigger an alarm when someone steps on the area they are located, great application. If you need to know if someone is standing there or not, IT WON'T WORK. The output goes ON when someone steps in the area, but resets to OFF a few seconds later.
I've actually spoken to the inventor of these devices on the phone and he confirmed there is NO WAY for them to detect weight or presence, only a CHANGE in weight or presence. You can build a bed sensor with these but it will only tell you when someone GETS INTO BED, NOT if someone is in bed or not.