u/Aggressive-Poem6911

▲ 55 r/CPAPSupport+2 crossposts

The problem

I have severe OSA. My AHI scores were inconsistent and I kept waking up exhausted despite being "on therapy." Figured out pretty quickly what was happening — I was unconsciously pulling my mask off during REM and deep sleep, the exact stages where OSA is worst, and not realising it until the morning summary. By then it was too late.

I wanted something that catches it the moment it happens and wakes me up on the spot.

How it works

A Tapo P110 smart plug sits between the CPAP and the wall. A Python script polls it every 2 minutes and reads the live wattage:

  • Mask on, therapy running: 3–7W
  • Mask off, machine idle: ~2W

When low wattage persists across multiple consecutive readings, it fires a Pushover emergency alert to my phone and Apple Watch — loud enough to bypass Silent mode, Sleep Focus, Do Not Disturb, all of it. I wake up, put the mask back on, go back to sleep.

Runs 24/7 on a Raspberry Pi Zero 2W sitting next to my machine. Silent, always on, costs nothing to run after setup.

My setup

  • ResMed AirSense 11 AutoSet
  • Tapo P110 smart plug (~₹1,500 / ~$18)
  • Raspberry Pi Zero 2W (~₹1,500 / ~$15)
  • Pushover app ($5 one-time) — alerts on iPhone and Apple Watch
  • That's it

The results

  • Nightly usage before: consistently 3–3.5 hours. I had no idea I was removing the mask that early.
  • Nightly usage now: consistently 6–7 hours, for 6 weeks straight.
  • AHI scores are down. I actually feel rested. It's not a fancy solution but it works.

The repo

MIT licensed, open source, runs on Mac / Linux / Raspberry Pi / Windows.

Full setup guide, calibration instructions, and Pushover setup for iOS and Android in the README.

👉 https://github.com/discocracker02/cpap-mask-monitor

Where I'd love help

  • Testing with other machines — BiPAP, AirCurve, Philips, Fisher & Paykel, older ResMed models
  • Testing with other smart plugs — Kasa, Sonoff, Tuya
  • Windows auto-start service
  • Any PRs welcome — roadmap is in the README

If you've solved this differently or have ideas for better detection methods, drop them in the comments.

Not a medical device. Personal project, shared freely. Full disclaimer in the repo. Use at your own risk.

u/Aggressive-Poem6911 — 20 days ago