milo526 / homebridge-tuya-web

Hoobs and Homebridge plugin for Tuya devices using Home Assistant Tuya Web Api
MIT License
223 stars 97 forks source link

[TuyaWebPlatform] Cannot acquire token, waiting 185 seconds. #622

Open ramachandran-suresh opened 1 month ago

ramachandran-suresh commented 1 month ago

[TuyaWebPlatform] Cannot acquire token, waiting 185 seconds.

Steps To Reproduce

Plugin Version

Yes latest, Installed: v1.1.5

Homebridge Config

{
    "name": "TuyaWebPlatform",
    "options": {
        "username": "xxx",
        "password": "xxx",
        "countryCode": "91",
        "platform": "smart_life"
    },
    "defaults": [
        {
            "id": "d7fb611ed52250fae4jhsp",
            "device_type": "outlet"
        }
    ],
    "scenes": false,
    "platform": "TuyaWebPlatform",
    "_bridge": {
        "username": "0E:46:39:4C:26:96",
        "port": 49843
    }
}

Device Config

{ "result": [ { "active_time": 1728223181, "bind_space_id": "158189541", "category": "cz", "create_time": 1728223181, "custom_name": "GF Kitchen Geyser", "icon": "smart/icon/ay1545304748499XogPc/6b6830578c3a10367f3ebd8032a6dcea.png", "id": "d7fb611ed52250fae4jhsp", "ip": "106.219.165.141", "is_online": true, "lat": "", "local_key": "';oC|qr7Kc7$vnC/", "lon": "", "model": "DSP1160", "name": "16Amp Smart Plug 6", "product_id": "rhvvzh71kuirphg2", "product_name": "16Amp Smart Plug ", "sub": false, "time_zone": "+05:30", "update_time": 1728223204, "uuid": "3b8baaa8e338cab0" } ], "success": true, "t": 1729664455300, "tid": "f5d0ff29910611efbcdf261abeee3fdb" }

Additional Context

The device is working without any issues on the Smart App.

Plastonick commented 1 month ago

I've been having issues with Tuya in the last few days as well, although I think mine was working on Thursday 24th, and hasn't worked since. The apparently relevant log lines for me are:

[10/26/2024, 8:38:33 AM] [SmartLife] Error retrieving devices states Error: getaddrinfo EAI_AGAIN px1.tuyaeu.com
  hostname: 'px1.tuyaeu.com',
    url: 'https://px1.tuyaeu.com/homeassistant/skill',
      hostname: 'px1.tuyaeu.com',
        'Host: px1.tuyaeu.com\r\n' +
      host: 'px1.tuyaeu.com',
    _currentUrl: 'https://px1.tuyaeu.com/homeassistant/skill',
moose-byte commented 1 month ago

I also saw the same issue recently after a power outage restarted my Homebridge. First a saw

Cannot acquire token, waiting 185 seconds.

I manually restarted my Homberdige and then I saw the other error @Plastonick mentioned

getaddrinfo EAI_AGAIN px1.tuyaeu.com
moose-byte commented 1 month ago

Following up, I found a similar thread saying it was a DNS issue, https://github.com/milo526/homebridge-tuya-web/issues/69. The issue is a DNS issue. I restarted my modem, router, and hombridge, and now everything works. I hope that helps you.

Plastonick commented 1 month ago

Thanks @moose-byte ! I'm not sure what it was, but restarting a few things seems to have jostled it into working again!

boozybatsMain commented 4 weeks ago

Nothing helps, restarted router and homebridge, still get error "Authentication error: Get accesstoken failed. Username or password error!"

I'm sure my credentials are right, I doublechecked everything, checked config.json - it's fine, probably would check tuya API authorization methods

michelvermeulen commented 4 weeks ago

Same here :| Started happening randomly, without changing anything, I suspect Tuya Web API to be responsible (I had the SmartLife app stop working as well while being on my cell network, but working with Wifi).