AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.58k stars 405 forks source link

Failed to setup : APPID HAS EXPIRED #1374

Closed Markii2430 closed 2 months ago

Markii2430 commented 3 months ago

Hello, all my sonoff devices are now offline because of this error appid has expired anyone has the same issue?

POMIN-163 commented 3 months ago

Me too, this has been the problem since the beginning, I don't know what happened.

Markii2430 commented 3 months ago

@AlexxIT hello sir how to troubleshoot this issue?

POMIN-163 commented 3 months ago

@AlexxIT hello sir how to troubleshoot this issue?

The problem was resolved when I deleted the original sonoff from custom_components and decompressed the latest version of the source.

wbertoncello commented 3 months ago

I tried several things including re-installing and re-configuring with no success at all but then taking and old issue from https://github.com/AlexxIT/SonoffLAN/issues/1249 I edited the file custom_components/sonoff/core/ewelink/cloud.py with my country code (in my case +54 there was a default contry code +86) and also edited the regioncode (in my case us there was eu by default). Restarted and everything is now working. PS: all the information needed I took it from ewelink app seeing my user country code and wich server it pointed to (in my case us)

StefanoGiu commented 3 months ago

I have the same issue here... I tried to install latest component, update country code to +39, restart HA several time, but I still have this issue...

AlexxIT commented 3 months ago

https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#issues

StefanoGiu commented 3 months ago

1) Sonoff Version 3.5.4 (c67dc99) Cloud devices online 0 / 1 Local devices online 1 / 1

2) Logger: homeassistant.config_entries Source: XXX\site-packages\homeassistant\config_entries.py:468 First occurred: 09:20:57 (1 occurrences) Last logged: 09:20:57

Config entry 'XXX@XX' for sonoff integration could not authenticate: appid has expired

3) 2024-04-02 10:20:39.477 WARNING (MainThread) [homeassistant.config_entries] Config entry 'XXXXX@XXXX' for sonoff integration could not authenticate: appid has expired

AlexxIT commented 3 months ago

This is not latest version

StefanoGiu commented 3 months ago

I installed the latest version... same issue:

Sonoff Version 3.6.0 (6886372) Cloud devices online 0 / 1 Local devices online 1 / 1

GrinchUA commented 3 months ago

{'error': 407, 'msg': 'the path of request is not allowed with appid:4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak', 'data': {}}

R8Oq3y0eSZSYdKccHlrQzT1ACCOUT9Gv - appid has expired

StefanoGiu commented 3 months ago

By the way the error message is clear... appid is expired... maybe the code will need to generate and use a new appid ?

StefanoGiu commented 3 months ago

I installed HA 2024.4.0... same issue

AlexxIT commented 3 months ago

I have another version after install latest release: 3.6.0 (8dd8af9).

This problem is not present for the rest of the users. What countries are you from? Italy and Argentina?

StefanoGiu commented 3 months ago

Italy, why? What's wrong with Italy and Argentina?

AlexxIT commented 3 months ago

This error only for your servers. I don't know how many servers ewelink uses for their cloud.

StefanoGiu commented 2 months ago

How can I fix it then?

AlexxIT commented 2 months ago

Maybe buy new app key from ewelink. Just a few thousand dollars.

StefanoGiu commented 2 months ago

oh... ok.... so I will need to keep the error, not being able to fix it?

AlexxIT commented 2 months ago

I need to find some free time first. Then create an account in your country to repeat the problem. Then look where I can find another working key. Or you can try to do it all yourself.

StefanoGiu commented 2 months ago

If you explain me what to do, I can work by myself and then we can fix it together.

I have eWeLink app on the phone, and I also used HTTP Toolkit in the past with Android emulator to sniff some traffic from apps :)

karlbreit commented 2 months ago

I had the same problem when logging in with a -91 number. Updated to 3.6 and updated all the other integrations HA wanted me to update, and it works fine now.

StefanoGiu commented 2 months ago

I'm on 3.6 and everything is updated now... but still it doesn't work.

Have you modified the code manually?

I just set 1 in those two lines: custom_components\sonoff\core\ewelink\cloud.py --> async def login_token(self, token: str, app: int = 1) -> bool: custom_components\sonoff\core\ewelink\cloud.py --> async def login(self, username: str, password: str, app=1) -> bool:

StefanoGiu commented 2 months ago

Please let me know if I can help fixing it somehow... I have experience in python coding.

AlexxIT commented 2 months ago

Perhaps someone with a problem can give me their login/password. You can change your password beforehand or create a new account that has the same error. You can reach me in the Telegram or Discord.

StefanoGiu commented 2 months ago

Can you give me your Telegram id ?

AlexxIT commented 2 months ago

I can confirm that app=1 has expired. But this is NOT default appid. Default appid works fine.