prestomation / resmed_myair_sensors

This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API
MIT License
93 stars 9 forks source link
cpap hacs homeassistant resmed

resmed_myair

GitHub Downloads GitHub Release GitHub Activity License

hacs Project Maintenance Discord Community Forum

This component will set up the following platforms.

Platform Description
sensor Show info from the myAir API.

Installation

Installation via HACS

Unless you have a good reason not to, you probably want to install this component via HACS (Home Assistant Community Store)

  1. Ensure that HACS is installed.
  2. Navigate to HACS -> Integrations
  3. Open the three-dot menu and select 'Custom Repositories'
  4. Put 'https://github.com/prestomation/resmed_myair_sensors/' into the 'Repository' textbox.
  5. Select 'Integration' as the category
  6. Press 'Add'.
  7. Find the ResMed integration in the HACS integration list and install it
  8. Restart Home Assistant.
  9. Add a configuration for the integration in the standard integration UI in Home Assistant.

Manual Installation

You probably do not want to do this! Use the HACS method above unless you have a very good reason why you are installing manually If you do need to install manually, you will know how this is done. You can install from source or use the latest release.

Features

This integration creates sensors from your myAir CPAP data like AHI Events/hr, Usage Minutes, Mask On/Off count, Mask Leak %. There is also a Last Sleep Data Recorded sensor to tell you the last date that myAir has recorded. This can be used to, say, notify you of your scores when they are updated in myAir in the morning.

By the nature of CPAP data, sensors will only update once per day (assuming your CPAP is used every day). For this reason, the integration only polls every 30 minutes. A service exists for each config that will force update if you want to automate the sync after you wake up.

Sensors

The following sensors are supported in all regions:

  1. CPAP AHI Events Per Hour
  2. CPAP Usage Minutes
  3. CPAP Mask On/Off Count
  4. CPAP Current Data Date
    1. This is the last date currently being displayed by the other sensors
  5. CPAP Mask Leak %
  6. CPAP Total myAir Score
  7. CPAP Sleep Data Last Collected
    1. This is the datetime the CPAP uploaded the most recent data
  8. Most Recent Sleep Date
    1. This is the most recent date for which data is available. This will match Current Data Date if you use your CPAP every day. An automation that triggers when these two sensors are different will signal that you have missed a night

Services

Each config entry for this integration will create a service called resmed_myair.force_poll_{username} that will force an update from myAir.

Known Issues

This integration was reversed engineered from the myAir website. There are no guarantees that this will continue to work, as this is up to the whims of ResMed. Please DO NOT rely on this for any health-related matters.

This integration currently only connects to accounts from North America, Europe, and Australia. If you are in Asia, please open an issue and offer yourself as a test subject.

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

If you want to support the development of this component, please don't donate to me but instead donate to the Home Assistant development team.