Control a fan from sleep position
An AI roommate uses a pose model on a Raspberry Pi to watch the user sleep and presses a remote button to turn the fan on or off.
Done with Claude Code
What they did
The setup runs a MediaPipe pose vision model on a Raspberry Pi home server that watches the sleeping person via camera. It detects real-time sleep position and sends a signal to a remote button pusher: arms or leg out triggers fan on, arms curled triggers fan off. The person defined the position rules and installed the hardware.
How it went
The fan turns on or off automatically overnight without waking the user. Current version struggles with blankets at times.
Worth knowing
Demo uses a stock photo; blanket detection issues are being fixed.
Try it yourself with Claude Code
Help me build a project on a [Raspberry Pi model] with a camera that detects when I'm [asleep or in a certain pose] using a pose estimation model and then triggers [fan or other device] through [remote, relay, or smart plug]. Write the code, the setup steps, and a test mode that logs detections without controlling anything. Finish when I can run the test mode and see it working, and ask before enabling real device control.
Source on X - Feb 20, 2026
Read the original