Looks like a cool solution to the problem. I wanted to go the pressure sensor and esp32 route but for me that has a problem: I want the sensor to be able to detect who is sleeping on which side. Sometimes when I go to bed late my wife sometimes sleeps on my side. I want to detect the weight to recognize if it is me or my wife on each side of the bed as I want to run different sleep automations than her.
AFAIK the pressure sensors just detect weight or no weight. I think this solution could work as I am significantly heavier the angle would be different between us. Has anyone tested this?
Also one caveat I see is that we have a box spring bed with a 25 cm thick mattress plus a topper. It does not have slats. Has anyone made it work on a box spring?