When should you use it?
- You wake up too hot or too cold
- You already run a home server
- Your fan only has a physical switch
Not for: Shared bedrooms where others have not agreed to a camera; Anyone uncomfortable with a camera in the bedroom
What do you need, and what do you get?
You need
- A small always-on computer such as a Raspberry Pi
- Camera
- Pose detection model
- Switch-pressing device
You get
- Automatic fan switching through the night
- Night log of position changes
How does it work, step by step?
- Keep it localRun the camera and model on your own server with no cloud upload.
- Define the rulesMap limbs spread out to fan on and curled up to fan off.
- Add a delayRequire the same position for a few minutes before toggling to avoid flapping.
- Wire the switchConnect a button pusher or smart plug the server can trigger.
- Review the logCheck each morning which toggles were right and adjust the rules.
The prompt
Our own prompt, inspired by Pankaj (@the2ndfloorguy) and written to work in Custom agent. Values in lime are placeholders.
Fill in the blanks (optional; the copied prompt uses your values)
Write a small Python service for my {device} that reads frames from {camera}, runs a pose model locally, and classifies each minute as SPREAD (limbs out) or CURLED. Only toggle the fan via {switch_api} after {hold_minutes} minutes in the same state, at most once every {min_gap} minutes. Never save or upload images. Log timestamp, state and action to a local CSV.
Inspired by Pankaj (@the2ndfloorguy): i was tired of waking up at 3 am either sweaty or freezing. so i taught my ai roommate to automatically control the.... The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Blankets hide limbs and cause wrong reads, as the poster found.
- Frequent toggling wakes you up; add a minimum interval.
Our take
Pankaj (@the2ndfloorguy) built an AI roommate that watches him sleep: a MediaPipe pose model on his Raspberry Pi home server reads whether limbs are stretched or curled, then a button-pusher presses the fan remote. Everything stays on a home server, which is the only way most people would accept a bedroom camera. Test false positives that turn the fan on and off all night. Keep the camera and model on your own server with no cloud upload. Map positions to actions simply, and require the same position for a few minutes before toggling so the fan does not flap on and off. Blankets hide limbs and cause wrong reads, as Pankaj found, so check the morning log and adjust the rules. Use a button pusher or smart plug the server can trigger. Anyone else sleeping in the room must agree to the camera first. Add a minimum interval between toggles so the noise does not wake you.
Where the time goes back: No more waking to fiddle with the fan; the adjustment happens while you stay asleep.
FAQ
Does video leave the house?
Could a temperature sensor do this instead?
Source and credit
Inspired by Pankaj (@the2ndfloorguy). We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- i was tired of waking up at 3 am either sweaty or freezing. so i taught my ai roommate to automatically control the...
- Creator
- Pankaj (@the2ndfloorguy)
- Published on
- X
- Original date
- Feb 20, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Custom agent
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.