Closed ZephireNZ closed 3 years ago
Hey there @tuya, mind taking a look at this issue as it has been labeled with an integration (tuya
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
tuya documentation tuya source (message by IssueLinks)
@ZephireNZ Thanks for the feedbacks! To help us investigate the issue, could you help to provide more Home Assistant log to us? You can follow this tutorial to get the log: How to get thw log , thanks!
Hiya,
The logging mentioned above is the only thing logged. Using the below logger config, the below is all that shows in the log (IP masked as x.x.x.x
for privacy):
2021-10-02 22:15:27 DEBUG (SyncWorker_5) [homeassistant.components.tuya.config_flow] TuyaConfigFlow._try_login finish, response:, {'code': 2007, 'msg': 'your ip(x.x.x.x) cross-region access is not allowed', 'success': False, 't': 1633166145543}
FYI your docs refer to the old logging name for custom component, I am using below logger config (I included the Tuya python modules just in case there was extra from them but no luck):
logger:
default: critical
logs:
tuya_iot: debug
tuya-iot-py-sdk: debug
homeassistant.components.tuya: debug
homeassistant.components.tuya.config_flow: debug
Settings I used:
I'm getting the same in the UK using a country code of 44. The page linked to above says that the UK is associated with the Europe availability region. However, I see two regions, Western Europe and Central Europe and my devices are under Central Europe.
Some issue here, from Tuya Developer platform Global error Codes (https://developer.tuya.com/en/docs/iot/error-code?id=K989ruxx88swc), 2007 is "device token expired".
I've checked the code in the Tuya V2 custom integration against what has been released here, and found some code in config_flow.py in the custom component here:
https://github.com/tuya/tuya-home-assistant/blob/master/custom_components/tuya_v2/config_flow.py#L90
which is not present here:
That code uses either the China (https://openapi.tuyacn.com) or US (https://openapi.tuyaus.com) endpoints when logging on depending on whether the country code is China or not.
The code release in the beta here always uses the China endpoint.
I've tested this locally myself and it appears that it allows it to work for me in the UK.
Can confirm that above fix works for me too
Thanks @ZephireNZ @gadgetchnnel for locating the issue, we have created another PR to help fix it, please check if it helps. https://github.com/home-assistant/core/pull/56973
Hey team, after upgrading to 2021.10.4, I still have the problem. If I choose China the integration will not let me through. Choosing Germany will fail in the above documented way.
It looks like your devices are registered in the China region, but you are in Germany.
If you check the Tuya app, what country is shown?
I am not sure how I can exactly check that, but it shows Germany in the app. Can I somehow do something to move it over?
@StevusPrimus you probably want to raise a new issue for this one, if you haven't sorted it
Yes, I migrated the devices into the smart life app. Now it works.
The problem
Unable to recreate Tuya integration with new setup. IoT platform set up as per instructions, but when I configure I get the error below.
My country code is 64, app is Tuya Smart, and validated these login details work in the old HA version. According to this Tuya doc I should be using America region which I am - specifically "Western America" looks to the region my devices are associated to in the IoT console.
What is version of Home Assistant Core has the issue?
core-2020.10.0b1
What was the last working version of Home Assistant Core?
core-2021.9.7
What type of installation are you running?
Home Assistant Container
Integration causing the issue
tuya
Link to integration documentation on our website
https://rc.home-assistant.io/integrations/tuya/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response