tuya-home-assistant icon indicating copy to clipboard operation
tuya-home-assistant copied to clipboard

Tuya login error: code 500 please contact the admin

Open lucasmenno opened this issue 2 years ago • 22 comments

I was having some trouble with migrating from Tuya v1 to Tuya v2 and had both installed in my Home Assistant. The V1 was loading quicker than the V2. Now i removed V1 and after re install and new config V2 is trowing the error "Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634386363393}"

Screenshot

Home Assistant Version Home Assistant 2021.10.5

2021-10-16 14:24:30 DEBUG (MainThread) [custom_components.tuya_v2] Tuya async setup conf None 2021-10-16 14:24:30 DEBUG (MainThread) [custom_components.tuya_v2] tuya.__init__.async_setup_entry-->{'o0o0o0': '0ec3f726b3c3fd24964ad2c9f9700a83fc5f9ce42c137675d5529bb9e5d80233c3ac84211ff4ca2323e24bb79e70d2860d6c69597498ca9adc1c0a0bdbc5cb9c987493a90cf4dea4ae630c9462c5e222d55ff04f888649ceeceb1616c6a0ba3607d31b666c88d8b5a9a38d4272c324e6514acf84999e071b8138daa9e1d3710edc5f6589b6d0153eb2b3c5dc4c92331d33ce07b3c5af86881721c9a7ab51a16725740140d0ad9e2dc2c59855926a2361acda76ecdfa005c952c98022e94c6c5b63e682b6d0bb7c2422b61f36edcb4ea63696256d64f65b8d6c705296d2721c93cd9b3793196aae0036614642c54cece3c747313cc21b0a96b354eb8a3b94a3416f17856878f74bf4eec9f80d2b8fabf37fe692fb5e984b054767fff067f3682f', '00oo00': 'AQNRWyUFFlQbEBRAQAhYQl1bAgpXEwJfUkMeGUVCCQo=', 'oo00oo': '96ecec3c862cec5141e34f76434cc2b3cacb031de5f29368e02cae550cf29dc3'} 2021-10-16 14:24:30 INFO (MainThread) [custom_components.tuya_v2] tuya.__init__.exist_xor_cache-->True 2021-10-16 14:24:30 DEBUG (SyncWorker_2) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/iot-01/associated-users/actions/authorized-login, params = None, body = {'username': '[email protected]', 'password': '***', 'country_code': 'DE', 'schema': 'Smart Life'}, t = 1634387070809 2021-10-16 14:24:31 DEBUG (SyncWorker_2) [tuya iot] Response: { "code": 500, "msg": "system error,please contact the admin", "success": false, "t": 1634387070989 } 2021-10-16 14:24:31 ERROR (MainThread) [custom_components.tuya_v2] Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634387070989}

Which admin should i contact ? :)

lucasmenno avatar Oct 16 '21 12:10 lucasmenno

Im having the same issue

cooltech786 avatar Oct 16 '21 18:10 cooltech786

I am having the exact same issue as well...

l33tconsultant avatar Oct 16 '21 18:10 l33tconsultant

same here after update from 1.5 to 1.6....revert did not helped

bobrik1978 avatar Oct 16 '21 20:10 bobrik1978

yup. the same....

patrik-malina avatar Oct 16 '21 21:10 patrik-malina

the same... Cette erreur provient d'une intégration personnalisée

Logger: custom_components.tuya_v2 Source: custom_components/tuya_v2/init.py:153 Integration: Tuya v2 (documentation) First occurred: 16 octobre 2021 à 21:57:32 (3 occurrences) Last logged: 22:09:08

Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634421452088} Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634422050014} Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634422148212}

mureaul avatar Oct 16 '21 22:10 mureaul

schema of the transmitted data is Smart Life. This must be smartlife originally.

In other words, there is a lack of processing to convert user input from Smart Life to smartlife.

vwt12eh8 avatar Oct 17 '21 01:10 vwt12eh8

Same here

erwinf avatar Oct 17 '21 01:10 erwinf

exact same issues

nsyvr avatar Oct 17 '21 02:10 nsyvr

Attending fix, you can modify the /config/custom_components/tuya_v2/const.py L40 with : TUYA_APP_TYPES = {"TuyaSmart": "tuyaSmart", "smartlife": "smartlife"} After restart HA and cache empty, it work...

mureaul avatar Oct 17 '21 09:10 mureaul

@mureaul it's working now. thanks

patrik-malina avatar Oct 17 '21 10:10 patrik-malina

Made the fix suggested by @mureaul and although it doesnt show the error anymore, no devices are popping up for me. Thoughts? I can see my devices listed on the IoT cloud website so that doesnt seem to be the issue.

My hass setup is on a raspberry pi with home assistant OS installed. The tuya developer page seems to imply that they want Home Assistant Core instead. For those that this worked for, whats your setup? Thanks!

cooltech786 avatar Oct 17 '21 12:10 cooltech786

I got the same as @cooltech786 . My log file says 2021-10-17 14:37:07 DEBUG (Thread-106) [tuya iot] connecting ssl://m1.tuyaeu.com:8883 2021-10-17 14:37:07 DEBUG (SyncWorker_7) [tuya iot] Response: { "code": 28841105, "msg": "No permissions. This project is not authorized to call this API.", "success": false, "t": 1634474227513 }

Has something changed with region codes? :x

lucasmenno avatar Oct 17 '21 12:10 lucasmenno

Attending fix, you can modify the /config/custom_components/tuya_v2/const.py L40 with : TUYA_APP_TYPES = {"TuyaSmart": "tuyaSmart", "smartlife": "smartlife"} After restart HA and cache empty, it work...

i fixed it by just adding all options from the previous version TUYA_APP_TYPES. my code looks like TUYA_APP_TYPES = {"TuyaSmart": "tuyaSmart", "smartlife": "Smart Life", "SmartLife": "smartlife"}
restart HA and devices showed up on the dashboard

nsyvr avatar Oct 17 '21 16:10 nsyvr

I still have an error: Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634557287935} I corrected line 40. No change...

Suchy197 avatar Oct 18 '21 11:10 Suchy197

I think there's something wrong with the new 1.6.0 integration, I pulled the latest update from the master branch and it works (not getting the 500 http error), but the device is not updating it's state even though in the logs it received the mqtt message. The state changed if you restart HA.

So in the end, I downgraded the integration to version 1.5.0 and changed line 40 in const.py to:

TUYA_APP_TYPES = {"TuyaSmart": "tuyaSmart", "SmartLife": "smartlife"}

Just like the const.py file in the master branch. And it works!

fauzanardh avatar Oct 18 '21 17:10 fauzanardh

Showing this error as well. Corrected the TUYA_APP_TYPES dic, but still getting:

Tuya login error response: {'code': 500, 'msg': 'system error, please contact the admin', 'success': False, 't': 1634690431549}

I saw a commit that looked hopeful, but not sure it'll quash this bug entirely...

kbromer avatar Oct 20 '21 00:10 kbromer

This is so weird. I'm having the same problems. 1.6.0 isn't working with that fix provided, 1.5.0 incl. fix showed up an configuration issue, so I reverted to 1.4.2.

chrismanivong avatar Oct 21 '21 10:10 chrismanivong

When I decided to automate my house, I was just looking for convenience and comfort. Unfortunately these TUYA devices give more headaches than convenience. Devices are a fruit salad (various manufacturers), identical devices but from different manufacturers, such as opening/closing sensors work differently. There are Tuya devices that connect to the Tuya hub, there are others that do not. A lay person would never be able to integrate Tuya devices with HomeAssistant. The person has to visit the website (iot.tuya.com) create a project, relate the project to a device and so on. You pay for the device and maybe tomorrow if you want it to work you will have to pay to use it via API, it's not clear if in the future there will be a charge. I am seriously disappointed, I am seriously considering switching everything to another solution/manufacturer. I know the team of developers are working to officially bring Tuya devices to HomeAssistant, however they cannot release a version that breaks the functionality. I don't know what to do to reverse things, and I don't see an answer from the development team regarding the solution.

Turbovix avatar Oct 25 '21 11:10 Turbovix

@Turbovix I completely agree with you, but this here is the development and beta testing version. I know from my own instance of home assistant, that not all devices are being recognised within the home assistant Tuya Integration which is for production purposes - the reason why I still use the instabie branches here.

But as you already said, it's much to difficult to setup developer accounts for noob. With this approach, Tuya & Home Assistant in combination will always stay a hassle. It will never become a convenient solution to everybody.

chrismanivong avatar Oct 25 '21 12:10 chrismanivong

I have same error massage. Try many times. Finally, I install V1.4.2, restart add Integrations, Tuya V2. after completed all Tuya devices, update V1.4.2 to V1.6.0 then restart Now, my Tuya V2 can use without error

Aood2005 avatar Oct 26 '21 07:10 Aood2005

  1. Delete all Tuya integrations that you have and Restart HA
  2. Install 1.4.2 via HACS
  3. Update Line 40 of const.py with TUYA_APP_TYPES = {"TuyaSmart": "tuyaSmart", "SmartLife": "smartlife"}
  4. Restart HA
  5. Add tuya v2 on integrations
  6. Restart HA
  7. Update on HACS 1.4.2 to 1.6
  8. Restart HA

Enjoy.

otomay avatar Jan 04 '22 16:01 otomay

Hi everyone

I agree with @otomay solution with small differences

  1. Delete all Tuya integrations that you have and Restart HA
  2. Install 1.4.2 via HACS
  3. Update Line 40 of const.py with: TUYA_APP_TYPE = {"TuyaSmart": "tuyaSmart", "SmartLife": "smartlife"}

There wasn't the "S" at the end of "TYPE" in version 1.4.2

  1. Update Line 93 of config_flow.py with: api.endpoint = "https://openapi.tuyaeu.com"

Maybe different regarding to your location, I'm in France and without this integration give me an authentification error

  1. Restart HA
  2. Add tuya v2 on integrations
  3. Restart HA
  4. Update on HACS 1.4.2 to 1.6
  5. Restart HA

Works for me

Spirit1240 avatar Feb 04 '22 00:02 Spirit1240