The fan follows how he is lying
Pankaj taught an agent to turn the fan on and off from his sleep position. An arm or a leg out means on. Arms curled means off. A physical button pusher hits the switch. He writes that the demo is a stock photo, and that blankets are still hard.
Done with Valgfri agentAdvanced
What was done
On 20 February 2026 Pankaj writes that he was tired of waking at 3, either sweaty or cold. He taught the agent a rule. An arm or a leg out means he is hot, and the fan should turn on. Arms curled means he is cold, and the fan should turn off. The agent uses a remote that physically presses the fan switch. The vision model mediapipe runs on his raspi home server. It reads the position and sends the signal. He writes that the demo uses a stock photo, not a picture of him. The current version struggles with a blanket sometimes. The profile says Bengaluru, India.
How it went
The fan should turn on when an arm or a leg is out, and off when the arms are curled. The post does not say how often the rule is right.
Worth knowing
The demo is a stock photo. He writes that the version struggles with a blanket sometimes. The post does not say how often the position is read correctly.
How to do it
- Write the rule with two positions: out means on, curled means off.
- Use a physical switch you can see, so the press is visible.
- Do not let it press the switch until you say yes.
Try it with Valgfri agent
If [limb] is sticking out, the fan should turn on. If the arms are curled, it should turn off. Use [switch], not a hidden call. Do not change the fan until I say yes.
Replace text in brackets with your own.
Done when. You have confirmed the rule, and the switch was not pressed before you said yes.
Safety rule. The fan is not changed until you have said yes. The demo in the post is a stock photo.
Read the original
Read the original · @the2ndfloorguy on X ·