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

When trying to list devices I'm getting error "params incomplete" #20

Open
marcinlubojanski opened this issue Apr 13, 2020 · 5 comments · May be fixed by #25
Open

When trying to list devices I'm getting error "params incomplete" #20

marcinlubojanski opened this issue Apr 13, 2020 · 5 comments · May be fixed by #25

Comments

@marcinlubojanski
Copy link

marcinlubojanski commented Apr 13, 2020

I'm logging in properly, then when I try to get list of devices I'm getting error in response

('response :', {u'msg': u'params incomplete', u'error': 400})

Response code: 200

Tried with 2 accounts, one has 2 devices (POW R2 and 4CH), the other has just one shared from the first one (POW R2).
If it makes any difference, both were created from Android app, not iPhone.

@lucien2k
Copy link
Owner

Do you have the right region selected? I seem to remember getting this when I changed region to the wrong one

@marcinlubojanski
Copy link
Author

Yes, it was correct.
I've managed to get list of devices by using the request from HASS-sonoff-ewelink project.
r = requests.get('https://{}-api.coolkit.cc:8080/api/user/device?lang=en&apiKey={}&getTags=1&version=6&ts=%s&nonce=%s&appid=oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq&imei=%s&os=iOS&model=%s&romVersion=%s&appVersion=%s'.format( self._api_region, self.get_user_apikey(), str(int(time.time())), ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)), self._imei, self._model, self._romVersion, self._appVersion ), headers=self._headers)
Also modified the do_login to include those variables.

Now I'm fighting with websocket issues... but it might be that my python is missing something (like f.e. logger - I had to remove it from the code) as I'm trying to run it on a WiFi router with entware

@mrave
Copy link

mrave commented Apr 28, 2020

@marcinlubojanski did you manage to get this to work?
I still get empty lists...

@marcinlubojanski
Copy link
Author

yes, it work for me with the change as written above. Do you also get "params incomplete" error message ?

@mrave
Copy link

mrave commented Apr 28, 2020

yes, it work for me with the change as written above. Do you also get "params incomplete" error message ?

I do indeed get the message. I used your PR and it worked, this should be merged - thanks!

Jacotsu added a commit to Jacotsu/sonoff-python that referenced this issue Jul 31, 2020
This commit fixes the 'params incomplete' error that prevents
the correct list of devices from being returned

closes lucien2k#20
@Jacotsu Jacotsu linked a pull request Jul 31, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants