New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple instances of the integration doesn't work for EU users #6
Comments
Thanks for your quick reply. Here's my har file as requested myair.resmed.eu.har.zip . |
@HummelsTech I have pushed an update. Please try upgrading through HACS to 9139e29 and let me know if it works |
Now I can add both CPAPs, but the readings for both are the same. The second sensor gives me the same values as the first. |
For cpap_sleep_data_last_collected, this is a bug. This only works in NA right now, but the wrong sensor was excluded. the next update will fix this. As for both devices reporting the same data, let me dig into this. |
There is some information you can collect for me that will help.
|
Sorry for the delay, but here is my output: |
After install second account all values are correct, but after a restart of home assistant both sensors are unavailable. { |
When I deactivate CPAP2 and reboot the values off CPAP1 are came up again. |
See: #6 My best guess here is that the same cookie jar is used in both instances, because it is likely shared state from a shared client provided by home assistant. This would lead to the observed behavior, whenever one of the coordinators runs it overrides the cookies shared by both, so they effectively get the same data. With this, each client has its own cookie jar so this sharing risk should go away. Testing: * Legacy tests still pass. The aiohttp mock we use doesn't seem to support cookies in such a way that we can test this further
Thanks for the information. I have found a subtle bug that might be causing this and have pushed a fix. Please update, test and let me know. Thank you also for the icon suggestion. |
Thanks again, but now I can't load the integration. |
Uhoh! Can you send a screenshot of what you see regarding ResMed in the logs in Settings->Logs? |
I've fixed an issue I found, please try updating again to latest. |
@HummelsTech I'm going to close this issue, but please re-open if you still have issues. |
Sorry again for the delay, but with last update the first bug came up again. when I config the second CPAP it gives me message: Device is already configured |
hm, so for the EU the email address is used to determine if a device is already configured. I'm assuming these devices must have different email addresses for their associated accounts, right? Here is something to try:
|
Can only add one CPAP when I try to add the second I get the message |
I understand, but I need the associated log messages when this happens |
I try to find those, look at it tomorrow when I'm at my PC |
Logger: homeassistant.components.sensor Error while setting up resmed_myair platform for sensor The above exception was the direct cause of the following exception: Traceback (most recent call last): |
Interesting! This looks like maybe your internet was having a hiccup, but this should have been retried and I don't think is the cause of our issues. were you able to turn on Info logging and find the lines about serial numbers? |
Strange but true. Now it works I think my account had a hick-up thanks for all your help and understanding. |
Yay! I'm going to close this but please open a new issue if you have issues or feature requests. thanks! |
Is your feature request related to a problem? Please describe.
When adding a second login from the EU, the second integration won't add as it says it is a duplicate
Describe the solution you'd like
A second instance of the integration should work
Describe alternatives you've considered
N/A
Additional context
General support for multiple instances was added to the integration in #3.
This works in the US, but the problem is the integration relies on each CPAP having a unique serial number.
This is setup in the US version, but in the EU version the serial number is not plumbed through. This is because it does not show up on the dashboard which is the only information I had an example from when adding EU support, as I do not have an EU account and cannot create one.
To address this I need a HAR file for the MyAccount Profile
For step 4, here are some instructions for Chrome: https://support.google.com/admanager/answer/10358597?hl=en
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.
The text was updated successfully, but these errors were encountered: