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

Appid is unauthorized! Error. #1201

Closed
KyleStilkey opened this issue Jul 26, 2023 · 105 comments
Closed

Appid is unauthorized! Error. #1201

KyleStilkey opened this issue Jul 26, 2023 · 105 comments
Labels
bug Something isn't working

Comments

@KyleStilkey
Copy link

KyleStilkey commented Jul 26, 2023

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

image

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")

#1201 (comment) (Posted by Alex)

@alexbaucom17
Copy link

+1 this is also happening to me

@liamlain
Copy link

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:
image

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

@jiang123574
Copy link

+1 this is also happening to me

@rivasabb
Copy link

Add me to that list.

@The0cdguy
Copy link

The0cdguy commented Jul 26, 2023

Same here. Rebooted my Home Assistant today and the Sonoff integration stopped working. Everything had been fine for months. I can still control my lights and switches using the eWeLink app on my phone and the official integration in Home Assistant, but this SonoffLAN integration fails to work as of today.
sonoff-broken

-----Update-----
Works now after using the fix here: #887

@yousaf465
Copy link
Contributor

same here.

@csc003
Copy link

csc003 commented Jul 26, 2023

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

#887

@WilRyan
Copy link

WilRyan commented Jul 26, 2023

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

#887

Confirm also working after making that change

@The0cdguy
Copy link

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

#887

Thanks. This worked. Re-authenticated and back in control.

@csc003
Copy link

csc003 commented Jul 26, 2023

Thanks. This worked. Re-authenticated and back in control.

When the day starts like this lol :-) (mind you its night there now right?)

@smarthomefamilyverrips
Copy link

smarthomefamilyverrips commented Jul 26, 2023

@csc003 @allenbrandt @WilRyan are your devices also available through cloud? If I check my system information it says 0/10 devices are available through cloud

@caitotheonlypotato
Copy link

+1 for me, same error and big red reconfigure on integrations page with appid error. With the integration itself, I'm using auto mode, and I can control all devices via LAN that have LAN functionality built in, but the few devices that are cloud only (Kingart covers) won't work. Energy values however which I must assume are retrieved from the could show as unavailable.

@AlexxIT AlexxIT added the bug Something isn't working label Jul 26, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jul 26, 2023

Cloud API key was blocked. You need to comment this line:

("KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi", "4v0sv6X5IM2ASIBiNDj6kGmSfxo40w7n"),

So integration will use second key. But! Second key works only with Sonoff brand devices. It doesn't work with 3rd party ewelink devices...

@AlexxIT AlexxIT pinned this issue Jul 26, 2023
@david78455
Copy link

same to me . i also try to recover from yesterday backup, same problem

@dpgh947
Copy link

dpgh947 commented Jul 26, 2023

Cloud API key was blocked. You need to comment this line:

("KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi", "4v0sv6X5IM2ASIBiNDj6kGmSfxo40w7n"),

So integration will use second key. But! Second key works only with Sonoff brand devices. It doesn't work with 3rd party ewelink devices...

That would explain my R2 switches working and my non-sonoff 4-way relay not... big problem for me

@djgragra
Copy link

Cloud API key was blocked. You need to comment this line:

("KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi", "4v0sv6X5IM2ASIBiNDj6kGmSfxo40w7n"),

So integration will use second key. But! Second key works only with Sonoff brand devices. It doesn't work with 3rd party ewelink devices...

It's Work! thank you.

@leeandy1
Copy link

Is there likely to be any work around for this? I have a mix of Sonoff an ewelink devices. This is a major issue.

@dpgh947
Copy link

dpgh947 commented Jul 26, 2023

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)

@hguresci
Copy link

hguresci commented Jul 26, 2023

async def login(self, username: str, password: str, app=1) -> bool:

When I change the value of app from "0" to "1" in the line, Sonoff devices including Sonoff ZB work, but the thermostat working with Ewelink cannot be reached.
sonoff-04930f01baa1d9b59f89b55e99036f7c-Thermostat-4e37c0662c35c7a466c614145b8aa920.json.txt

@AlexxIT
Copy link
Owner

AlexxIT commented Jul 26, 2023

@dpgh947 Sonoff team gave personal key for me (second key). It support only Sonoff brand devices. They not plan open all devices for this key. Some licensing issue.

So I have been using a different key. Today it stopped working.

@yousaf465
Copy link
Contributor

@dpgh947 Sonoff team gave personal key for me (second key). It support only Sonoff brand devices. They not plan open all devices for this key. Some licensing issue.

So I have been using a different key. Today it stopped working.

Is any resolution in sight?

@smarthomefamilyverrips
Copy link

@AlexxIT so this renders 3rd party devices useless for good?

@yousaf465
Copy link
Contributor

but all my devices are sonoff.

@vaderag
Copy link

vaderag commented Jul 26, 2023

Same issue

@smarthomefamilyverrips
Copy link

smarthomefamilyverrips commented Jul 26, 2023

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

@leeandy1
Copy link

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

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

@ninoger
Copy link

ninoger commented Jul 26, 2023

@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 :)

Unfortunately it is not working for me .I am in the latest HA version

I can confirm the keys work with devices by Sonoff, DIYMORE, New Smart, Maker and BLu50.

I only replaced the first key and left line 107 as it was originally with the 0

I only replaced keys. No modify line 107 and 157. Ok all.

@nawafbana
Copy link

nawafbana commented Jul 26, 2023

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

@AlexxIT
Copy link
Owner

AlexxIT commented Jul 26, 2023

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.2

@AlexxIT AlexxIT closed this as completed Jul 26, 2023
@smarthomefamilyverrips
Copy link

smarthomefamilyverrips commented Jul 26, 2023

@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 :)

@AlexxIT Yes is working for my 3rd party PC switch by SANNTONG

@dinan5
Copy link

dinan5 commented Jul 26, 2023 via email

@dinan5
Copy link

dinan5 commented Jul 26, 2023 via email

@mabusdogma
Copy link

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.2

Perfect! Works just fine!

@smarthomefamilyverrips
Copy link

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.2

Perfect! Works just fine!

Same here! Thanks @AlexxIT !!!

@ninoger
Copy link

ninoger commented Jul 26, 2023

3.5.2 perfect. Thanks.

@Thessa
Copy link

Thessa commented Jul 26, 2023

Solved with 3.5.2. Thanks

@bwp91
Copy link

bwp91 commented Jul 26, 2023

@AlexxIT i dunno which app id and key you are using now, but this could be an interesting read:

homebridge-plugins/homebridge-ewelink#488

@hguresci
Copy link

Solved with 3.5.2. Thanks @AlexxIT you are fast and reliable man.

@StephenMilner
Copy link

Snappy resolution - Thanks @AlexxIT - Superstar.

I had a power cut at home and this issue raised itself straight after - Also Alexa had similar problems which seem to have been resolved overnight.

@Maderik72
Copy link

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
Schermata 2023-07-28 alle 13 24 19

@hguresci
Copy link

hguresci commented Jul 28, 2023 via email

@Maderik72
Copy link

Exactly as you said !!! Now it works, maybe I did not found the info before.
Thanks again
Mario

@TA2LSM
Copy link

TA2LSM commented Jul 28, 2023

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.

@gugaspinto
Copy link

gugaspinto commented Jul 31, 2023

updated to v352 with hacs... I still have issues with 3rd party brand . Something I need to do? Any one have the same issue?
If I change status with ewelink... the entities come available for some time... but after some minutes they go unavailable again. Thanks.

Edit: solved... an authentication problem

@tomasb82
Copy link

Still have probem with L1 and wireless sensors. All of them are ofline. In Ewelink app it is online.

@jalejandro0211
Copy link

Cloud API key was blocked. You need to comment this line:

("KOBxGJna5qkk3JLXw3LHLX3wSNiPjAVi", "4v0sv6X5IM2ASIBiNDj6kGmSfxo40w7n"),

So integration will use second key. But! Second key works only with Sonoff brand devices. It doesn't work with 3rd party ewelink devices...

It's Work! thank you.

it's works, tks ;)

@DIYtechie
Copy link

I have the latest version of the integration and still experienced this issue. Commenting out line 40 seemed to work though.

@hguresci
Copy link

hguresci commented Aug 4, 2023 via email

@Oskar505

This comment was marked as resolved.

@ivspbitec
Copy link

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
#887

Thanks. This worked well for me.

baugp added a commit to baugp/ewelink-api that referenced this issue Mar 28, 2024
@AlexxIT AlexxIT unpinned this issue Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests