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

Tuya IoT "your ip(XX.XXX.128.108) don't have access to this API" error 1114 #635

Open
mrrepel opened this issue Oct 27, 2021 · 28 comments
Open
Labels
bug Something isn't working

Comments

@mrrepel
Copy link

mrrepel commented Oct 27, 2021

Describe the bug
Can control Tuya with TuyaSmart and IoT Platform, can read "status" with Home assistant, cannot change status with Home assistant (example, switch on or off). Problem since a few days, worked fine before.

Expected behavior
Home assistant control Tuya devices, not just show the status (example on or off)

Home Assistant Version
2021.10.5

Additional context
When i go to the website https://openapi.tuyaeu.com/v1.0/devices/xxxx/ (one of my devices) i get:

code 1114
msg "your ip(XX.XXX.128.108) don't have access to this API"
success false
t 1635339362943

As far as i can see in the logs there is no API / login problem.

The log when i try to swtich the switch:
2021-10-27 14:26:26 DEBUG (Thread-5) [tuya iot] _on_log: Sending PINGREQ
2021-10-27 14:26:26 DEBUG (Thread-5) [tuya iot] _on_log: Received PINGRESP
2021-10-27 14:26:39 DEBUG (SyncWorker_0) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/xxxxx/commands, params = None, body = {'commands': [{'code': 'switch_1', 'value': False}]}, t = 1635337599476
2021-10-27 14:26:39 DEBUG (SyncWorker_0) [tuya iot] Response: {
"result": true,
"success": true,
"t": 1635337599572
}

Full log for logging in to Iot / API

2021-10-27 13:49:19 DEBUG (MainThread) [custom_components.tuya_v2] Tuya async setup conf None
2021-10-27 13:49:19 DEBUG (MainThread) [custom_components.tuya_v2] tuya.init.async_setup_entry-->{'o0o0o0': '34ddf78c5c8d6a8517d19ebb3555891b0014427aa529fabd173f387fad5596ace57360d75fb2bd215011704c50a77cf4502d5bbd73a2248b48f6d7ada5e9748983afb0d1b812f3630cc72f403666ebaeb281a8c08ed678ae1a4473e0f0f6e1b916f7b1d0355865a820563d9619c192ff0fc983fffb07751867e259bc65dc14be50d1ee337d52c0ab5cf10c017e0dd9885aaacdXXXXXX'}
2021-10-27 13:49:19 INFO (MainThread) [custom_components.tuya_v2] tuya.init.exist_xor_cache-->True
2021-10-27 13:49:19 DEBUG (SyncWorker_1) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/iot-01/associated-users/actions/authorized-login, params = None, body = {'username': 'XXX', 'password': '', 'country_code': '49', 'schema': 'tuyaSmart'}, t = XXXX
2021-10-27 13:49:19 DEBUG (SyncWorker_1) [tuya iot] Response: {
"result": {
"access_token": "
",
"expire_time": 7200,
"platform_url": "https://openapi.tuyaeu.com",
"refresh_token": "",
"uid": "
"
},
"success": true,
"t": XXXX
}
2021-10-27 13:49:20 DEBUG (MainThread) [tuya iot] start
2021-10-27 13:49:20 DEBUG (Thread-4) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/iot-03/open-hub/access-config, params = None, body = {'uid': '', 'link_id': '', 'link_type': 'mqtt', 'topics': 'device', 'msg_encrypted_version': '1.0'}, t = XXX
2021-10-27 13:49:20 DEBUG (SyncWorker_0) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/users/eu1626865384210GhnXe/devices, params = None, body = None, t = XXX
2021-10-27 13:49:20 DEBUG (Thread-4) [tuya iot] Response: {
"result": {
"client_id": "",
"expire_time": 7200,
"password": "
",
"sink_topic": {
"device": "cloud/token/out/{device_id}"
},
"source_topic": {
"device": "cloud/token/in/391b55312XXXX"
},
"url": "ssl://m1.tuyaeu.com:8883",
"username": "cloud_391b55312b11eXXXXX"
},
"success": true,
"t": XXXX
}
2021-10-27 13:49:20 DEBUG (Thread-4) [tuya iot] connecting ssl://m1.tuyaeu.com:8883
2021-10-27 13:49:20 DEBUG (Thread-4) [tuya iot] _on_log: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'cloud_XXXX5eedc'
2021-10-27 13:49:20 DEBUG (SyncWorker_0) [tuya iot] Response: {
"result": [
{
"active_time": 1628412520,
"biz_type": 0,
"category": "kg",
"create_time": 1628412520,
"icon": "smart/product_icon2/kg_1.png",
"id": "vdevoXX",
"ip": "",
"lat": "
",
"local_key": "",
"lon": "
",
"model": "HYS-00-001-HYS",
"name": "Smart Switch-vdevo",
"online": true,
"owner_id": "XX",
"product_id": "XX",
"product_name": "Smart Switch",
"status": [

@mrrepel mrrepel added the bug Something isn't working label Oct 27, 2021
@mrrepel mrrepel changed the title Home assistant sees status, cannot control Tuya devices Tuya IoT "your ip(XX.XXX.128.108) don't have access to this API" error 1114 Oct 27, 2021
@renaudallard
Copy link

I have the same issue and If I use the cloud IP whitelist to add my IP, it tells me:

Warning
The IP address you added has exceeded the service range of the current data center, and there will be data security compliance risks. It is recommended that you change the IP address. Tuya will completely prohibit cross-regional data calls to ensure data security for you and the users.

@renaudallard
Copy link

The datacenter I had to choose is in Central Europe, as Belgium was only autheorized in central europe, which is already something strange.
if I go to "https://openapi.tuyaeu.com/v1.0/devices/deviceid", I get the error, even from an IP in Germany or Poland

@renaudallard
Copy link

I have opened a ticket at tuya to check what they say.

@Mehul
Copy link

Mehul commented Jan 7, 2022

In my Tuya IoT project, I turned the "Cloud Authorization IP Allowlist" setting to OFF (under Cloud -> Overview) and it worked for me. Hope it helps.

image

@romainlouvet
Copy link

romainlouvet commented Jan 7, 2022

same problem for me
Capture d’écran 2022-01-07 à 11 36 11

@lcarrasco
Copy link

Same :(

@sasch901
Copy link

Same here

@puntcomjordi
Copy link

mismo problema. Login error (1114): your ip(95.169.xxx.xxx) don't have access to this API

@crisanadrian
Copy link

Scan the QR code with Smart Life App and it will work.
i was try with whitelist for ip but it was still not work. then i read somewhere, somebody used SmartLife instead off tuya and it works.

@ghost-bullet
Copy link

check homepage development "Cloud Authorization IP Allowlist" is enabled , my answer is late but someone can benefit from it.

@sener83
Copy link

sener83 commented Jun 1, 2022

check homepage development "Cloud Authorization IP Allowlist" is enabled , my answer is late but someone can benefit from it.

thank you for the hint. This has worked

@michaelruck138
Copy link

this is exactly what happened to me. Had the tuya solution working really nicely and then it expired. They have kindly extended it by 6 months however when I look at the tuya integration in HA, there are no devices to manage thus all the automation has now failed.
I've raised a ticket with them so I'll wait and see what they say.

@PrzemekSkw
Copy link

Still no working solution? That checking - unchecking Cloud Authorization IP Allowlist don't fix that error.

@Salamandar
Copy link

Same here, I added my IP address but i keep getting the same error message.
Tuya is a nightmare.

@coleburg
Copy link

coleburg commented Feb 8, 2023

same issue here, is this being investigated as its been open for some time.

@JesusMarlor
Copy link

same

3 similar comments
@hod25
Copy link

hod25 commented Mar 7, 2023

same

@arturmaj
Copy link

same

@jurgen4194
Copy link

same

@Thijsjuh92
Copy link

Same

@rccipriani
Copy link

Having the same problem in Postman so it doesn't seem to be HASS-specific.

@marbovo
Copy link

marbovo commented Sep 28, 2023

Having the same problem in Postman so it doesn't seem to be HASS-specific.

I had the same error on postman, then I used Tuya's collection from here.

Note: On Pre-request Script the command const mode = pm.request.body.mode; must be changed to const mode = pm.environment.get("mode"); or simply "urlencoded"

@AppleLatino
Copy link

In my Tuya IoT project, I turned the "Cloud Authorization IP Allowlist" setting to OFF (under Cloud -> Overview) and it worked for me. Hope it helps.

image

Thank you very much. it work for me this solution. you save me a lot hours troubleshooting lol

@EdisonACDC
Copy link

Scansiona il codice QR con l'app Smart Life e funzionerà. Ho provato con la whitelist per IP ma ancora non funzionava. poi ho letto da qualche parte che qualcuno ha usato SmartLife invece di Tuya e funziona.

SI FINZIONA ANCHE CON SMARTLIFE

@gcbarrie
Copy link

gcbarrie commented Nov 7, 2023

There is a "configure" link next to "Cloud Authorization IP Allowlist" where you can add your IP address.

@yanellap81
Copy link

In my Tuya IoT project, I turned the "Cloud Authorization IP Allowlist" setting to OFF (under Cloud -> Overview) and it worked for me. Hope it helps.

image

Thank You, works fine.

@mimich38
Copy link

great
Same for me

@rhodsllwyd
Copy link

In my Tuya IoT project, I turned the "Cloud Authorization IP Allowlist" setting to OFF (under Cloud -> Overview) and it worked for me. Hope it helps.
image

Thank you very much. it work for me this solution. you save me a lot hours troubleshooting lol

Thanks for this quick fix

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