Skip to content
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

Unable to connect to Meross account #186

Closed
ayoward opened this issue Apr 7, 2022 · 23 comments
Closed

Unable to connect to Meross account #186

ayoward opened this issue Apr 7, 2022 · 23 comments
Labels
bug Something isn't working question Further information is requested

Comments

@ayoward
Copy link

ayoward commented Apr 7, 2022

Hello,

I have recently installed Home Assistant so am fairly new to this, but I like to think I am IT literate (I have managed to make a career out of it) however, I am struggling with getting Home Assistant/Meross LAN to connect to my account for the device key.

I bought a Meross Smart WiFi Surge Protector specifically because of the Home Assistant integration and while I have successfully attached it to the WiFi, set up a Meross account on the app and linked the device, installed Meross LAN via HACS, but when it comes to the configuration, which rightly or wrongly I set as Cloud Retrieval (not sure how to change that now, but that's another issue) it is asking for my credentials for Device Key Retrieval which when I put them in, it fails every time.

Does anyone know what I am doing wrong? I know the credentials are correct as I have them stored in my password vault.

Any help would be greatly appreciated.

Thanks,

Andrew

Meross

@krahabb
Copy link
Owner

krahabb commented Apr 8, 2022

Hello @ayoward ,
I see by the screenshot you get an 'unable to connect' error so I would investigate why you can't reach to the meross login servers which (as implemented in meross_lan) should respond on 'https://iot.meross.com/v1/Auth/Login'

@squaredcircle
Copy link

I also have this problem - same error message "unable to connect". My instance of Home Assistant can communicate with https://iot.meross.com/v1/Auth/Login as seen here:

image

Anything I can try to make this work?

@krahabb
Copy link
Owner

krahabb commented Jun 25, 2022

Hello, I've checked the meross_lan code in search of clues and I have to admit the 'unable to connect' error is raised on any error, I've also seen that now, if you enter wrong credentials, the actual flow implementation just 'works' by returning an empty key with no error warning to the user so I'm going to try refactor the code a bit trying to add more detailed informations on the error.

@krahabb
Copy link
Owner

krahabb commented Jun 25, 2022

Hello @squaredcircle,
I've just released an 'alpha' with a small fix so to have better insights on this error. You should see an additional field on the form stating the actual reason for the error so we might have a better chance to further investigate it

@squaredcircle
Copy link

Hey @krahabb,
I updated to the new alpha and tried again - here's the error:

image

@krahabb
Copy link
Owner

krahabb commented Jun 26, 2022

Awww..
this message looks like the key field is missing from the server response. The reason is still unclear though since this error happens in an unexpected piece of code. The server response usually carries the reason but we've missed that.
I'll better refine the error handling so to try have this 'reason' shown in the form

@aaronschriever
Copy link

HI guys, Not sure if this is helpful or not. I had a " character in my original password for meross which broke the api call. Once the password was changed not to contain that character it was fine.

@squaredcircle
Copy link

Just checked - my password also contains multiple symbols, including a " character.

@krahabb
Copy link
Owner

krahabb commented Jul 6, 2022

HI guys, Not sure if this is helpful or not. I had a " character in my original password for meross which broke the api call. Once the password was changed not to contain that character it was fine.

Hello @aaronschriever , that could explain the issue. I'll check if the password encoding needs some extra care when using these characters

EDIT:
the username/password encoding in meross_lan was a bit optimistic about the values and was likely failing to encode in a proper way. Next release should fix this kind of issues with cloud key retrieve

@krahabb krahabb mentioned this issue Jul 15, 2022
@krahabb krahabb added bug Something isn't working fixed Upcoming fix/feature already on dev labels Jul 20, 2022
@krahabb krahabb closed this as completed Jul 20, 2022
@bossloper
Copy link

I had an ! (exclamation mark) in my password. It failed to log in to the cloud unless I changed my password to not have it.
v2.6.2

@krahabb
Copy link
Owner

krahabb commented Oct 9, 2022

Hello @bossloper ,
I'll review the actual implementation to try understand why!
Thank you for sharing this

@krahabb krahabb reopened this Oct 9, 2022
@krahabb krahabb removed the fixed Upcoming fix/feature already on dev label Oct 9, 2022
@cpighin
Copy link

cpighin commented Nov 21, 2022

Hello,
I also have an authentication error problem. I just installed Meross LAN 2.6.2 on Home assistant and tried to integrate a SmartPlugEnergyMonitor. The integration process fails as in the picture
Schermata del 2022-11-21 16-40-12

Claudio

@krahabb
Copy link
Owner

krahabb commented Nov 23, 2022

Hello @cpighin,
I still haven't checked the code for this and I guess the issue lies in some special character not being encoded correctly (like the '!' in the previous post).
Can you share, if any of these specials is used inside your password ? or just say 'yes there are a ton of them' :)

@cpighin
Copy link

cpighin commented Nov 23, 2022

Hallo krahabb,

thanks for replying ... NO, my Meross password consists only of lowercase and uppercase letters and numbers :(

@krahabb
Copy link
Owner

krahabb commented Nov 23, 2022

I'm in the process to update the login flow in order to better report the error codes from the server so to have a better understanding of what went wrong. The reasons for failures might range from incorrect pwd/login to server unavailability or even 'too many requests'...
I've actually retested it and the formatting of any character including specials seems to work fine in my tests. Of course I cannot try any possible combination since I risk getting banned from Meross :(

@cpighin
Copy link

cpighin commented Nov 23, 2022

Well, so I just have to wait for a new version of Meross LAN and try the integration again, counting on the possibility of reporting a more precise error message?
From the information you have, do you think there are many or few users who are unsuccessful with the integration in Home Assistant?

@krahabb
Copy link
Owner

krahabb commented Nov 24, 2022

It's hard to say...since I don't have the big picture of how many users are actually using meross_lan. I guess some in the like of 1 every 10 has few issues actively reported

@cpighin
Copy link

cpighin commented Nov 24, 2022

thanks

krahabb added a commit that referenced this issue Dec 8, 2022
@andrelung
Copy link

This was my previous password:
garlicky-allergen-knowing-jalousie

changing it to something simpler (and shorter) made the integration work.

@krahabb
Copy link
Owner

krahabb commented Jan 9, 2023

Hello @andrelung,
Did your 'long' password fail on latest alpha too (2.7.xxx) ?

@krahabb krahabb added the question Further information is requested label Jan 9, 2023
@andrelung
Copy link

Sorry, I've only tested the version which is available in HACS

@krahabb krahabb mentioned this issue Feb 4, 2023
@krahabb krahabb closed this as completed Apr 30, 2023
@TheMastro-11
Copy link

Hi, same problem, more specific error:int([x]) -> integerint(x, base=10) -> integerConvert a number or string to an integer, or return 0 if no argumentsare given. If x is a number, return x.__int__(). For floating pointnumbers, this truncates towards zero.If x is not a number or if base is given, then x must be a string,bytes, or bytearray instance representing an integer literal in thegiven base. The literal can be preceded by '+' or '-' and be surroundedby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.Base 0 means to interpret the base from the string as an integer literal.>>> int('0b100', base=0)4

@DrOctogone
Copy link

Hi, same problem, more specific error:int([x]) -> integerint(x, base=10) -> integerConvert a number or string to an integer, or return 0 if no argumentsare given. If x is a number, return x.__int__(). For floating pointnumbers, this truncates towards zero.If x is not a number or if base is given, then x must be a string,bytes, or bytearray instance representing an integer literal in thegiven base. The literal can be preceded by '+' or '-' and be surroundedby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.Base 0 means to interpret the base from the string as an integer literal.>>> int('0b100', base=0)4

Hello, I had the same problem as you. I simply deactivated 2-factor authentication with the application and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

9 participants