NickWaterton / eWeLink-mqtt

Bridge to control Sonoff Devices via MQTT
MIT License
19 stars 5 forks source link

[D Main.EwelinkClient ] received response status: 200 #2

Closed skycrack-77 closed 2 years ago

skycrack-77 commented 3 years ago

Hello, i get an error after run the App

[E Main ] Error: 'info' Traceback (most recent call last): File "./ewelink_server.py", line 250, in main loop.run_until_complete(client.login()) File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "/root/PROJECT/new1/eWeLink-mqtt/ewelink_client.py", line 356, in login self.logger.error('login error: %d, :%s' %(json_response['error'], json_response['info'])) KeyError: 'info' [D Main ] Program Exited

I would glad for a hint.

NickWaterton commented 3 years ago

Are you providing your correct login info for your account? ie email and password

What region are you in? I have only used NA accounts (I can't test any other region).

NickWaterton commented 3 years ago

OK, I forgot, they changed the login method a while ago (which I fixed), but forgot to push the fix to github.

latest version on github should now work.

skycrack-77 commented 3 years ago

"pip3 install zeroconf" is needed and i change to the EU Server in File ewelink_client.py

155: self.apiHost = 'eu-api.coolkit.cc:8080' 156: self.webSocketApi = 'eu-pconnect3.coolkit.cc' works fine. Thanks for the amazing work on this App.

NickWaterton commented 3 years ago

Yes you need zeroconf for the new discovery service. I just added that, and the documentation hasn't been updated yet.

There was a PR to add the region to the config.yaml file. I'll look into it.

NickWaterton commented 3 years ago

OK, region added as a command line option (either us or eu), and as an option in the config.yaml file.

I updated the documentation also.

Try it out and see how it works.

skycrack-77 commented 3 years ago

Its fantastic for Europe User. I check this out and it works just fine with the Region Parameter. :-) Im so happy with your App. I has so long search for a way to use the original Ewelink Devices in my FHEM Home Automatisation. Realy nice an thank you for your time an the extremly fast support. Have a nice Day

skycrack-77 commented 2 years ago

Hello Nick, how are you tdoay. Hope all is fine. Im Back with a smal issue of ewelink-mqtt

Since a reboot of my Fhem Automatisation Unit i get the foling Output and no Connect to the api.

[D Main.EwelinkClient ] received response status: 200 [D Main.EwelinkClient ] received response: { "error": 403, "msg": "Sign:oauthClient enable invalid" } [E Main.EwelinkClient ] login error: 403, :None [W Main ] Client Disconnected

Have you any Idea? Best Wishes,

Rene Hartmann

NickWaterton commented 2 years ago

Yes, the old key and authorization we used is no longer valid. There are new ones available though.

I fixed mine a few weeks ago, but I may not have pushed the fix.

Let me check.

NickWaterton commented 2 years ago

Ok, I did a big re-write a few weeks ago when this happened to me, and i haven't pushed the fixed version yet.

As a quick fix, you can make the following changes to ewelink-client.py: change line 181 from: self._appid = 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq' to: self._appid = 'KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi'

change line 332 from: decryptedAppSecret = '6Nz4n0xA8s8qdxQf2GqurZj2Fs55FUvM' to: decryptedAppSecret = '4v0sv6X5IM2ASIBiNDj6kGmSfxo40w7n'

The old appid and secret no longer work. New appid and secret work fine though.

I'll try and push the new version tomorrow, if you prefer to wait.

NickWaterton commented 2 years ago

Ok I just pushed the new version now. I haven't tested this one in a while, as I have a totally new version in the works (which I'm using now).

Let me know if the updated version works Ok.