Giter Club home page Giter Club logo

Comments (7)

coolnetworks avatar coolnetworks commented on June 12, 2024 1

it is still happening here 17 March 2022 fully patched

from tuya-iot-python-sdk.

sharoltd avatar sharoltd commented on June 12, 2024

Many people with such problem last few days, but no way to fix it ((

from tuya-iot-python-sdk.

vdbosch avatar vdbosch commented on June 12, 2024

Same issues here. All devices seems to lose connection, after restarting Tuya integrations it works again for some time (a few hours). It's absolutely not stable at this moment. Problem with 11.5 and with 2021.1.12. It looks that there are problems with the Tuya API/ Tuya Cloud and has nothing to do with the version of Home Assistant nor OS-version. I have same problems with my test-box (used old version and new version and different versions of OS).

from tuya-iot-python-sdk.

bpfoster avatar bpfoster commented on June 12, 2024

I'm also having the same issue all of a sudden. Added in some logging to the openmqtt method _get_mqtt_config() to see what the error from the API is:

{'code': 1010, 'msg': 'token is expired', 'success': False, 't': 1639929045868}

So it would appear the auth token is expiring and not being correctly refreshed by the client.

from tuya-iot-python-sdk.

sharoltd avatar sharoltd commented on June 12, 2024

I'm also having the same issue all of a sudden. Added in some logging to the openmqtt method _get_mqtt_config() to see what the error from the API is:

{'code': 1010, 'msg': 'token is expired', 'success': False, 't': 1639929045868}

So it would appear the auth token is expiring and not being correctly refreshed by the client.

I asked IOT.tuya support about this, they ask me "Where did you see the API you called,Could you please provide the address you saw" ;)))

from tuya-iot-python-sdk.

bpfoster avatar bpfoster commented on June 12, 2024

This was fixed in tuya-iot-python-sdk v0.6.6 which was included in Home Assistant 2021.12.6.

from tuya-iot-python-sdk.

helldog136 avatar helldog136 commented on June 12, 2024

Looks like the url to refresh mqtt config is wrong : https://developer.tuya.com/en/docs/cloud/c2c2630d7c?id=Kb68mozbi3foh
Or am I mistaken here?
The code seems to make requests to (openmq.py - l25-26)

TO_C_CUSTOM_MQTT_CONFIG_API = "/v1.0/iot-03/open-hub/access-config"
TO_C_SMART_HOME_MQTT_CONFIG_API = "/v1.0/open-hub/access/config"

These URLS are used at lines 62-81:

    def _get_mqtt_config(self) -> Optional[TuyaMQConfig]:
        response = self.api.post(
            TO_C_CUSTOM_MQTT_CONFIG_API
            if (self.api.auth_type == AuthType.CUSTOM)
            else TO_C_SMART_HOME_MQTT_CONFIG_API,
            {
                "uid": self.api.token_info.uid,
                "link_id": LINK_ID,
                "link_type": "mqtt",
                "topics": "device",
                "msg_encrypted_version": "2.0"
                if (self.api.auth_type == AuthType.CUSTOM)
                else "1.0",
            },
        )

        if response.get("success", False) is False:
            return None

        return TuyaMQConfig(response)

This code doesn't match the actual documentation

from tuya-iot-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.