SonoffLAN: Appid is unauthorized! Error.
Just started happening to my setup, it removed my access to my devices and wanted me to reconfigure the setup, trying to configure it again or even a full reinstall gives a Appid error for a response.
appid is unauthorized! KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi
Temporary work around is to manually change the API keys in your Sonof Cloud file found at /custom_components/sonoff/core/ewelink/cloud.py to the keys listed below. You can either replace or add a new line and comment out the other keys with a #
("4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak", "oKvCM06gvwkRbfetd6qWRrbC3rFrbIpV")
https://github.com/AlexxIT/SonoffLAN/issues/1201#issuecomment-1652142335 (Posted by Alex)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 42
- Comments: 105 (12 by maintainers)
Commits related to this issue
- Add new cloud key #1201 — committed to AlexxIT/SonoffLAN by AlexxIT a year ago
- updated cloud key https://github.com/AlexxIT/SonoffLAN/issues/1201#issuecomment-1652142335 — committed to baugp/ewelink-api by baugp 3 months ago
https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.2
Check this key pair for 3rd party devices:
+1 this is also happening to me
Cloud API key was blocked. You need to comment this line: https://github.com/AlexxIT/SonoffLAN/blob/9c9b7f0a676cff6dab0c1c89f4dbefec341b95d5/custom_components/sonoff/core/ewelink/cloud.py#L40
So integration will use second key. But! Second key works only with Sonoff brand devices. It doesn’t work with 3rd party ewelink devices…
This keys fix the problem. All devices ok. Thank you
Confirm also working after making that change
Just had the same issue.
DId the line changing edit (line 107 and 157) in the /custom_components/sonoff/core/ewelink/cloud.py restarted HA and all good now
https://github.com/AlexxIT/SonoffLAN/issues/887
use a file browser add on to edit it https://github.com/alexbelgium/hassio-addons
in this case is better to leave the password field empty as it not does cloud syncing in that case, you will not have updates if you add a new device or have the devices available when using “cloud” in configuration but will still have all your devices (also 3rd gen) working in “auto” or “local” configuration IN CASE you already did use the fix you will need to replace the .JSON in config/.storage/sonoff with a old version where your 3rd party devices still where listed
+1 this is also happening to me
I updated the plugin. Still all of my devices were unavailable. So I deleted the plugin and installed again. Now there are no devices. ??
EDIT: Ok I waited a while so all devices are back now.
Exactly as you said !!! Now it works, maybe I did not found the info before. Thanks again Mario
You don’t need to change anything. update the plugin to the new version. All problems will be fixed.
Hakan Güreşçi
With Mobile
-------- Orijinal mesaj -------- Kimden: Maderik72 @.> Tarih: 28.07.2023 14:36 (GMT+03:00) Alıcı: AlexxIT/SonoffLAN @.> Cc: Hakan Güreşçi @.>, Comment @.> Konu: Re: [AlexxIT/SonoffLAN] Appid is unauthorized! Error. (Issue #1201)
Hi guis, I’m facing still issues. please give a look on what I changed and the error message: Have you other solutions?
[Schermata 2023-07-28 alle 13 24 39]https://user-images.githubusercontent.com/114488345/256811130-ac1ed66d-12b4-417c-a682-f5f1ab61d19a.png [Schermata 2023-07-28 alle 13 24 19]https://user-images.githubusercontent.com/114488345/256811133-4d23b80d-5b95-448d-8c71-0c9df30213e0.png
— Reply to this email directly, view it on GitHubhttps://github.com/AlexxIT/SonoffLAN/issues/1201#issuecomment-1655534908, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6WXBZM32CT5XV5KZOZFZMTXSOP3DANCNFSM6AAAAAA2YA5EBA. You are receiving this because you commented.Message ID: @.***>
GIZLILIK NOTU: Bu mesaj ve ekleri yalnizca gönderildigi kisi(lere) ozeldir ve gizlidir. Mesaj sizin adiniza degilse, içerigini ve varsa ekindeki dosyalari kimseye göndermeyiniz ya da kopyalamayiniz. Bu mesajin herhangi bir sekilde açiklanmasi, kullanilmasi, kopyalanmasi, yayilmasi veya mesaj içerigi ile ilgili olarak herhangi bir islem yapilmasi kesinlikle yasaktir. Böyle bir durumda lütfen göndereni uyarip, mesaji siliniz. Alan adi sahibi bu mesajin içerigi ve ekleri ile ilgili olarak hiçbir hukuksal sorumlulugu kabul etmez. CONFIDENTIALITY NOTICE: This message and attachments are confidential and intended solely for the individual(s) stated in this message. If you received this message although you are not the addressee, you are responsible to keep the message confidential. If you are not the intended recipient please notify the sender immediately and destroy this e-mail. Owner of the domain does not accept legal responsibility for the contents and the attacments of this message.
you will only get local access no cloud features
Is there likely to be any work around for this? I have a mix of Sonoff an ewelink devices. This is a major issue.
Perfect! Works just fine!
I changed:
line 107: async def login(self, username: str, password: str, app=0) -> bool: to
async def login(self, username: str, password: str, app=1) -> bool:
line 39: added: (“4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak”, “oKvCM06gvwkRbfetd6qWRrbC3rFrbIpV”)
comment this line: (“KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi”, “4v0sv6X5IM2ASIBiNDj6kGmSfxo40w7n”),
now every thing is working fine sonoff and third party
Great job Alexx, thank you all for your support
Unfortunately it is not working for me .I am in the latest HA version
@ninoger @leeandy1 @smarthomefamilyverrips all of you have third-party devices and can confirm this key can control them? Sonoff brand devices are not interesting. They can be controlled with my key.
The problem is that this key is not allowed to get the user’s homes list 😃
Only make the key changes. With the key changes, the other changes aren’t needed any longer.
From: david78455 @.> Sent: Wednesday, July 26, 2023 2:38 PM To: AlexxIT/SonoffLAN @.> Cc: dinan5 @.>; Comment @.> Subject: Re: [AlexxIT/SonoffLAN] Appid is unauthorized! Error. (Issue #1201)
I have finally managed to solve the problem by changing the keys, the three keys of line 40 I have put these (“4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak”, “oKvCM06gvwkRbfetd6qWRrbC3rFrbIpV”),
Is there a possibility of using third-party devices like the ones I have for blinds that can work locally? At the moment they do not have for local mode, if I mark the option it does not work.
Please explain should i replace your line with the original kine no 40 ? and what about line 107 & 147 shout I do that change also ? Thanks David
Reply to this email directly, view it on GitHubhttps://github.com/AlexxIT/SonoffLAN/issues/1201#issuecomment-1652309377, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARAH6ECPVRN56RK5YYLGE7DXSFPYHANCNFSM6AAAAAA2YA5EBA. You are receiving this because you commented.Message ID: @.@.>>
I can also confirm the new key pairs works.
Great work @AlexxIT
Place the code in the cloud.py under custom_components/sonoff/core/ewelink/cloud.py in row 39 there you see some more appkey´s than restart HA and it should work.
3thrd party devices are for example ewelink devices like king art switches for shutters
works fine as long you not use 3rd party devices 😉
+1 Same here after Reboot HA
But by changing the line 107, the integration works fine again Try changing the 0 to 1 in line 107 of /custom_components/sonoff/core/ewelink/cloud.py
[SonoffLAN/custom_components/sonoff/core/ewelink/cloud.py]
async def login(self, username: str, password: str, app=0) -> bool: async def login(self, username: str, password: str, app=1) -> bool:
How do you do that?
This works for me. Thank you
Same problem, hopefully it can be solved since it works much better than the official one from EWeLink
@leeandy1 I can not confirm, but even if it does it by far not have same control possibilities as this integration … personally I think the add-on is pretty useless
@leeandy1 indeed is not the most pretty, but I think we all use this integration for local support and this still will works now… only downside is that IF you add a new device to your ewelink cloud account it will not be detected/added to your HA integration… but even in that case you could temporary comment out the key in line 40 OR change line 107 and 157 to 1 from 0, “not forget to make a copy of your JSON file first” after do a reboot and manually add the missing 3rd party devices to the newly created JSON file… after that undo changes to line 40 OR line 107 and 157 restart HA and reconfigure again without using password 😃
But let’s hope @AlexxIT can come up with a fix that syncs all devices from cloud, 3rd party included
Same problem here
same error here
I can confirm this is working for now. Not great but at least things are working. - My advice would be to take a back up of the .JSON in config/.storage/sonoff
Same issue
I have sent a question to sonoff tech support asking if this is an intended change (stopping non-branded devices from working), or a mistake/bug that will be fixed. I will post their response (if I get one)
Thanks. This worked. Re-authenticated and back in control.
Same happend
The Sonoff intergation was no problem until i restart my HA ,it showing RECONFIGURE But when when login my id and pwd it showing like pic i attatched below:
Attached log:
This error originated from a custom integration.
Logger: custom_components.sonoff Source: custom_components/sonoff/core/ewelink/cloud.py:150 Integration: Sonoff (documentation, issues) First occurred: 1:12:38 PM (1 occurrences) Last logged: 1:12:38 PM
Can’t login with mode: auto Traceback (most recent call last): File “/config/custom_components/sonoff/init.py”, line 206, in async_setup_entry await registry.cloud.login(username, password) File “/config/custom_components/sonoff/core/ewelink/cloud.py”, line 150, in login raise AuthError(resp[“msg”]) custom_components.sonoff.core.ewelink.cloud.AuthError: appid is unauthorized! KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi
Logger: homeassistant.config_entries Source: config_entries.py:414 First occurred: 1:12:38 PM (1 occurrences) Last logged: 1:12:38 PM
Config entry ‘Sonoff’ for sonoff integration could not authenticate: appid is unauthorized! KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi