ResMed CPAP Sensor integration in HACS

Hi everyone. I’ve been using Home Assistant for just a few weeks and already have a list of custom integrations I want to build.

Here is my first one, and it is pretty niche: Sensors for ResMed CPAPs.

CPAPs are devices used by people with sleep apnea to help them breathe at night. Many of these have integrated SIM cards that report information every morning for insurance/medical reasons.

Resmed has a service called myAir where this data can be viewed in an app or on the web. This is nice, but of course let’s put it into Home Assistant.

Here is the output of the currently included sensors(I had a bad night!)

This integration was reversed-engineered from myAir’s website, so it is at risk of breaking at anytime.
The EU and US websites work differently, so the feature sets are slightly different. Please see the package readme for more

Also not that this integration does need your username/password. myAir uses Okta under the covers, but refresh tokens are short-lived so this was the best I could come up with.

I hope this is useful to someone out there.

The repo can be added to HACS at prestomation/resmed_myair_sensors

Please open issues or feature requests at the repo above, I don’t get notifications for replies here so please use github.

13 Likes

I don’t use my CPAP anymore since it seemed to be more trouble than it was worth for my very minor apnea.

I had a pretty extensive set of automations surrounding my CPAP machine and sleep info but I would have found this pretty useful too.

thanks for sharing it.

1 Like

Hi Prestomation
It is really nice of you to make integration for this device.
But I am from Europe(Belgium), and would like to use the integration.
Can you explain me how i can use this?
Greetings

Hello! I assume you are gkrallo on github. I replied to your message with some instructions on how you can help add EU support

Hello! i’m not gkrallo, i don’t know him, but we send you at the same time. I saw your comment on github and i’m going to try it to make it work.

First of all thanks for this great integration,

I have one question, is it possible to add multiple CPAPs?
For now I can add one and if I try the second one I get a message “Device is already configured”
I’m a EU user and have 1 ResMed-AirSense 10 AutoSet and 1 ResMed-AirSense 10 Elite each with his own account(login).
Any help is welcome :wink:

1 Like

Thanks! Works perfect for me!

1 Like

WOW nice … i had a friend making a google function a few years for me to use this - but i will start testing this right now! im having a resmed device as well…

1 Like

Hi Alwin.

I know what the issue is. I don’t have access to an EU account, and EU works very differently from US, so I will need some help from an EU account holder. I have opened an issue on github for you, if you could follow the instructions and send me a HAR file I can fix this: Multiple instances of the integration doesn't work for EU users · Issue #6 · prestomation/resmed_myair_sensors · GitHub

Thanks for your quick response, I’ve post my .HAR file on your github.

1 Like

Thanks for this. I just started CPAP this week.

1 Like

I just saw the post - thanks for doing this. I am US resmed user and will add this to my HA.

1 Like

Do you mind sharing what types of automations you had? I have a couple based on a power sensor its plugged into to kick things off when I go to bed/wake up but could use some fresh ideas.

I don’t mind sharing but I’m not sure how much use you would get out of a lot of it.

Most of it was used when I first started using it and was trying to get used to wearing it at night.

The requirement for the insurance to pay for it was that it had to be used for > 4 hours a day for so many days a month in 3 months. and all of that was a rolling time frame.

so in order to ensure I met the requirements I tried to make sure I used it for at least 4 hours and 15 minutes every night.

There was no way that I was going to get up and check my watch in the middle of the night to see how long I had it running so I came up with the idea to turn on a dim LED light ( I used the LED indicator on a spare zigbee outlet that I hadn’t purposed for anything else yet) that I could see at night that turned on when I turned on a “master control” switch signaling I started running it and then it would turn off 4 hours and 15 minutes later. That way if the light was off I new I had met the minimum requirements and I could take it off it was bothering my sleep too much.

Then I had a system that I could use to increase the timer for the LED indicator by a set amount every few nights so I could force myself to keep it on longer so I would start getting better benefits by wearing it longer.

eventually I got to the point I didn’t need the crutch and could wear it most of the night.

Then the other twist in the system is that I work a rotating shift so I initially needed a way to have the indicator work both during the day when I was sleeping from night shift and at night sleeping for day shift. I needed a light to be bright enough to see during the day but dim enough to use at night

So I had a dimmable lamp for the day time and the indicator system would transition between the dimmable light and the LED depending on the sun postition.

But again eventually I got away from using that system once I got more used to wearing the mask for longer periods.

The most useful automation I had was a sleep movement counter to tell me how much I was tossing & turnng at night so I could compare the nights I used the mask to the nights I didn’t to try to get some indication if I was actually resting better using the mask.

That automation is the only one I still actually use.

I had such a minor apnea it ended up not really helping at all and after a year of use I stopped using it. But since I fully own the machine now (those things are expensive without the insurance covering a portion of it!) I still have it if I think I may actually need it in the future.

After all of that if you still think you might find anything useful here is the link to the github repo for the package:

1 Like

Good ideas to get through the hoops insurance gas for these. I struggled at first and this would have certainly helped know if I had hit the minimum use for the night. Thank you for sharing!

2 Likes

Can I suggest an improvement? You should register a service that allows the integration to be forced to refresh. I know if my CPAP machine is running or not based on its plug, so it would be nice to be able to force an immediate refresh when it turns off so that I can delay the stats on my dashboard. Others may want to compare the time to their compliance requirement if the CPAP turns off and do something if the time hasn’t been met.

1 Like

@prestomation

Just came across this. Tried to set it up, but my login keeps failing. I’m in Australia if that makes a difference. I log on at https://myair2.resmed.com/.

If you need help to setup something up, or diagnose, please let me know.

Hi cjsimmons, Sorry to hear you’re having troubles. Could you open an issue on github so we can track this?

Please include a HAR file from your browser from after you login and refresh the dashboard. This will help me figure out what’s going wrong

Instructions:
To address this I need a HAR file for the MyAccount Profile

  1. Login to myAir
  2. Open the developer console in your browser.
  3. Open the page that contain your scores
  4. Export a HAR file
  5. Send this HAR file to me or attach it on the github issue.
    For step 4, here are some instructions for Chrome: Capture web session traffic - Google Ad Manager Help

Be careful to NOT enter your password when you have the network tab open. This may end up including your myAir password in the har file which we want to avoid. Login first and then open the developer console, open the page, and capture the HAR file.

Also, when the login fails, you should see an error in your Home Assistant Logs(Configuration → Settings → Logs tab). You should see a red section with the words resmed_myair. Please copy the whole section and paste them in the issue as well.

Done. I’ve PM’d you the HAR file. Hope I’ve done it right.

1 Like

Thanks! I’ve pushed a fix that I hope will fix your issue.