A beautiful, user-friendly Python application to track CPAP (Continuous Positive Airway Pressure) device maintenance schedules and sync usage data from ResMed MyAir.
- ✨ Features
- 🚀 How to Run This App
- 📖 Usage Guide
- 🔧 Component Replacement Schedules
- 💾 Data Storage
- ❓ FAQ
- 🛠️ Troubleshooting
- 📞 Contact Information
- 🔐 Security & Privacy
⚠️ Disclaimer- 📄 License
✅ Track Multiple Components - Monitor filters, hoses, and masks with automatic date calculations
✅ Beautiful CLI Interface - Modern, colorful terminal interface with emojis and tables
✅ MyAir Integration - Fetch and display CPAP usage data from ResMed MyAir
✅ Daily CPAP Report - Automatically displays latest night's sleep data with component tracking
✅ Visual Status Indicators - Color-coded status with emojis (✅ OK, ⏰ Due Soon,
✅ Customizable Settings - Configure replacement intervals, equipment details, and contact information
✅ Cross-Platform Support - Works seamlessly on Windows, macOS, and Linux
✅ Easy to Use - Simple command-line interface with helpful scripts
✅ Automatic Calculations - Next replacement dates calculated automatically
✅ Data Export - Export all data to JSON or YAML for analysis and backup
✅ Persistent Storage - All data saved locally in JSON format
We've made it super easy to run this app on any platform! Just follow the instructions for your operating system below.
📚 Need more detailed instructions? See our Platform-Specific Guide for comprehensive troubleshooting and advanced setup options.
- Download or clone this repository
- Double-click
run.batin the project folder - That's it! The script will automatically:
- Check if Python is installed
- Install required dependencies
- Launch the CPAP Monitor
If you prefer to run it manually:
# Open Command Prompt in the project folder
python cpap_monitor.pyIf Python is not installed:
- Download Python from python.org
- Run the installer
⚠️ IMPORTANT: Check "Add Python to PATH" during installation- Restart your computer
- Run
run.batagain
- Download or clone this repository
- Open Terminal (press
Cmd + Space, type "Terminal") - Navigate to the project folder:
cd /path/to/cpap-monitor - Run the launcher script:
./run.sh
# Make sure you're in the project directory
python3 cpap_monitor.pyIf Python is not installed:
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python
brew install python3Then run ./run.sh in the project folder.
- Download or clone this repository
- Open your Terminal
- Navigate to the project folder:
cd /path/to/cpap-monitor - Run the launcher script:
./run.sh
# Make sure you're in the project directory
python3 cpap_monitor.pyUbuntu/Debian:
sudo apt-get update
sudo apt-get install python3 python3-pipFedora/RHEL:
sudo dnf install python3 python3-pipArch Linux:
sudo pacman -S python python-pipThen run ./run.sh in the project folder.
Simply run the application to see your maintenance status:
# Windows
python cpap_monitor.py
# macOS/Linux
python3 cpap_monitor.py
# Or use the launcher scripts
run.bat # Windows
./run.sh # macOS/LinuxFirst Run: The app will automatically initialize with October 13, 2025 as the replacement date and create a beautiful status display.
Daily CPAP Report: When you have MyAir data synced, the app automatically displays your latest night's sleep data alongside component maintenance tracking. This allows you to correlate component aging with sleep quality metrics!
python cpap_monitor.py --setup-myairYou'll be prompted to enter:
- Your MyAir username/email
- Your MyAir password
- Your region (EU for Europe, NA for North America)
Customize your equipment details and contact information:
python cpap_monitor.py --setup-preferencesYou can configure:
-
Equipment Information:
- CPAP machine model (optional)
- Mask model (optional)
- Filter replacement interval (default: 5 months)
- Tube/Hose replacement interval (default: 10 months)
- Mask replacement interval (default: 10 months)
-
Contact Information:
- Department name (optional)
- Department address (optional)
- Department email (optional)
- Department phone number with country code (optional)
All fields are optional. If not configured, the app uses default values.
python cpap_monitor.py --syncThis fetches your latest CPAP usage data from ResMed MyAir servers.
The latest night's data is automatically displayed in the main view! For all historical records:
python cpap_monitor.py --show-myairOr combine sync and display:
python cpap_monitor.py --sync --show-myairExport all your CPAP data (components and MyAir records) to a file:
# Export to JSON
python cpap_monitor.py --export json
# Export to YAML (requires pyyaml: pip install pyyaml)
python cpap_monitor.py --export yamlThe exported file includes:
- Component replacement schedules and dates
- Complete MyAir sleep data history
- Contact information
- Export timestamp
This is useful for:
- 📊 Analyzing trends over time
- 🔄 Backing up your data
- 📧 Sharing data with healthcare providers
- 📈 Creating custom visualizations
If you encounter authentication issues or other problems with MyAir sync, enable verbose mode to see detailed debugging information:
python cpap_monitor.py --sync --verboseVerbose mode will show:
- Detailed error messages from the server
- HTTP response codes and bodies
- Authentication flow details
- API request/response information
Example output:
[cyan]Verbose mode enabled - showing detailed debug information[/cyan]
[INFO] resmed_client: Authenticating with MyAir...
[ERROR] resmed_client: Authentication failed with status 401
[ERROR] resmed_client: Response body: {"errorCode": "E0000004", "errorSummary": "Authentication failed"}
This information is helpful for troubleshooting authentication problems or reporting issues to the developers.
When you run the app, you'll see a beautiful daily CPAP report like this:
💨 CPAP MAINTENANCE MONITOR
╔══════════════╤═════════════════╤═══════════════╤═════════════╤══════════════════╗
║ Component │ Interval │ Last Replaced │ Next Due │ Status ║
╟──────────────┼─────────────────┼───────────────┼─────────────┼──────────────────╢
║ Filters (×2) │ Every 5 months │ 13 Oct 2025 │ 12 Mar 2026 │ ✅ OK (148 days) ║
║ Hose │ Every 10 months │ 13 Oct 2025 │ 09 Aug 2026 │ ✅ OK (298 days) ║
║ Mask │ Every 10 months │ 13 Oct 2025 │ 09 Aug 2026 │ ✅ OK (298 days) ║
╚══════════════╧═════════════════╧═══════════════╧═════════════╧══════════════════╝
╭──────────────────────────── 🌙 Latest Night's Sleep Data ────────────────────────────╮
│ 📅 Date: 2025-10-13 │
│ ⭐ Sleep Score: 87/100 │
│ ⏰ Usage Time: 7.5 hours │
│ 💤 AHI: 2.1 events/hour │
│ 💨 Mask Leak: 8 L/min │
│ 🔄 Mask Events: 2 │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────── Contact Information ──────────────────────────────╮
│ 📞 Service: ARI Sleep Apnea Service │
│ ☎️ Phone: 01224550962 │
╰──────────────────────────────────────────────────────────────────────────────────╯
The latest night's sleep data is automatically displayed when MyAir data is available, creating a comprehensive daily CPAP report that shows both component status and sleep quality metrics!
Default replacement intervals are:
| Component | Default Interval | Quantity | Notes |
|---|---|---|---|
| 🔵 Filters | Every 5 months | 2 at a time | Optimized for higher pollution levels |
| 🟢 Hose | Every 10 months | 1 | Check for wear and tear regularly |
| 🟡 Mask | Every 10 months | 1 | Replace if seal is compromised |
💡 Tip: You can customize these intervals using python cpap_monitor.py --setup-preferences to match your needs or your healthcare provider's recommendations.
The application stores all data locally in JSON files:
maintenance_data.json- Component replacement dates and MyAir dataconfig.json- User preferences (equipment, contact info) and MyAir credentials
These files are automatically created on first run and updated as needed.
.gitignore to protect your privacy.
Q: Do I need an internet connection?
A: Only if you want to sync data from ResMed MyAir. The maintenance tracking works completely offline.
Q: Will my data be sent to any servers?
A: No! All data is stored locally on your computer. When you sync MyAir data, the connection goes directly to ResMed's servers - no third parties involved.
Q: Can I change the replacement intervals?
A: Yes! Use python cpap_monitor.py --setup-preferences to configure custom replacement intervals for filters, tubes, and masks. You can also set equipment details and contact information.
Q: What if I miss a replacement date?
A: The app will show your component as
Q: Can I customize the contact information?
A: Yes! Use python cpap_monitor.py --setup-preferences to set your healthcare provider's contact details including name, address, email, and phone number.
Q: I get "Python is not recognized" on Windows
A: Python isn't in your system PATH. Reinstall Python and make sure to check "Add Python to PATH" during installation.
Q: I get "permission denied" on macOS/Linux
A: Run chmod +x run.sh to make the script executable, then try again.
Q: The pip install command fails
A: Try using python -m pip install -r requirements.txt or python3 -m pip install -r requirements.txt instead.
Q: Is MyAir integration official?
A: No, this uses an unofficial community-discovered API. It may stop working if ResMed changes their systems.
Q: My MyAir credentials don't work
A: Make sure you're using the correct region (EU or NA) and your credentials are correct. Try logging into MyAir in a browser first to verify.
Q: Are my credentials secure?
A: Credentials are stored in plain text in config.json. Only use this on a personal, secure device. See Security & Privacy for more details.
Q: Can I use this with MyAir accounts from other regions?
A: Currently, only EU (Europe) and NA (North America) regions are supported.
Solution:
- Make sure Python 3.6+ is installed:
python --versionorpython3 --version - Check you're in the correct directory
- Try the manual method instead of the launcher scripts
Solution:
# Run this in the project folder
pip install -r requirements.txt
# Or use
python -m pip install -r requirements.txtSolution:
- Windows: Use Windows Terminal (from Microsoft Store) instead of Command Prompt
- All platforms: Make sure your terminal supports Unicode and ANSI colors
Solution:
pip install richSolution:
- Check your internet connection
- Verify credentials:
python cpap_monitor.py --setup-myair - Make sure you selected the correct region (EU or NA)
- Try logging into MyAir in a web browser to verify your account is active
- Use verbose mode for debugging:
This will show detailed error messages and API responses to help identify the problem.
python cpap_monitor.py --sync --verbose
Solution:
- Enable verbose mode to see detailed error information:
python cpap_monitor.py --sync --verbose
- Check the error messages for specific issues:
- 401 Unauthorized: Wrong username/password
- MFA Required: Multi-factor authentication is not supported
- Wrong region: Try switching between EU and NA regions
- Verify your credentials are correct by logging into MyAir website first
Open an issue on GitHub with:
- Your operating system and version
- Python version (
python --version) - Complete error message
- What you were trying to do
Default Contact Information
The app includes default contact information for the ARI Sleep Apnea Service. You can customize this to your healthcare provider using:
python cpap_monitor.py --setup-preferencesFor technical support with the app itself, please open an issue on GitHub.
✅ Local Storage Only - All data is stored on your device
✅ No Third-Party Servers - MyAir credentials go directly to ResMed
✅ Open Source - You can inspect all code
config.json
- Only use this on a personal, secure device - Don't use on shared computers
- Protect your config files -
config.jsoncontains your MyAir credentials - Keep your system secure - Use antivirus, keep software updated
- Unofficial API - MyAir integration uses an unofficial API that could change
This tool is designed for use with ResMed MyAir CPAP devices that report data to:
- 🇪🇺 Europe: myair.resmed.eu
- 🇺🇸 North America: myair.resmed.com
Disclaimer: This is a maintenance tracking and data viewing tool. It is not a medical device and should not be used for medical diagnosis or treatment decisions. Always consult with your healthcare provider for medical advice.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Some ideas for contributions:
- 🌍 Support for additional MyAir regions
- 📱 Mobile app version
- 📧 Email reminders for upcoming replacements
- 📈 Data visualization and trends
- 🔒 Encrypted credential storage
IMPORTANT: Please read this disclaimer carefully before using this software.
This Python program is an open-source, personal project distributed freely on GitHub. By using this software, you agree to the terms outlined below. For the complete disclaimer, see DISCLAIMER.md.
This software is licensed under the MIT License. The software is provided "as-is", without warranty of any kind, express or implied. The authors are not liable for any claims, damages, or liabilities arising from the use of this software.
- Use ONLY on your personal, trusted, and secured computer.
- DO NOT use on shared, public, or untrusted computers.
- You assume all responsibility and risk for credential security.
This software is NOT approved, sponsored, endorsed, or affiliated with:
- ResMed Inc. or any subsidiaries
- Aberdeen Royal Infirmary, NHS Grampian, NHS Scotland, the National Health Service (NHS), or any healthcare/governmental bodies
This software is not a medical device and has not undergone any official review or certification.
This is a personal project released under the MIT License. The author has no responsibility for how you use this software, the data it handles, or any consequences arising from its operation. You use this software entirely at your own risk.
All product names, logos, and brands are property of their respective owners. ResMed, MyAir, and other third-party trademarks belong to their rights holders. Their use does not imply affiliation or endorsement.
This project is licensed under the MIT License - see the LICENSE file for details.
TL;DR: You can use, modify, and distribute this software freely, even for commercial purposes, as long as you include the original license and copyright notice.
- ResMed MyAir for providing CPAP therapy data
- resmed_myair_sensors community project for API documentation
- Rich library for beautiful terminal formatting
- All contributors and users of this project ❤️
Made with ❤️ for better sleep health
⭐ Star this repo if you find it helpful!