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

[GET] Device Offline #161

Closed
sterumbelow opened this issue Jan 5, 2021 · 25 comments
Closed

[GET] Device Offline #161

sterumbelow opened this issue Jan 5, 2021 · 25 comments
Labels
stale This issue has not received any updates for some time.

Comments

@sterumbelow
Copy link

Describe the bug

Recently I've been getting a lot of 'No response' messages for devices in the Home app. All my devices are controlled by switches (so just on or off).

My log shows:

[GET] Device Offline

However, the device is definitely online - I can see it is when I check the Tuya app, and can turn it on and off without an issue. Yet the Homebridge log and Home app still show it as offline/No response.

This isn't happening on one device, but randomly across my sockets. My internet connection and WiFi reach are solid.

Restarting Homebridge fixes the issue but I'm having to do daily restarts because things keep going offline.

I've seen this happen with all sockets before and a restart fixed it, but never with one or two sockets individually - and never when they're online in the Tuya app.

image

image

image

Steps To Reproduce

Nothing has changed in terms of setup. WiFi is the same, Homebridge settings are the same, socket locations haven't changed.

Plugin Version

0.7.1

Homebridge Config

{
           "name": "TuyaWebPlatform",
           "options": {
               "username": "REDACTED",
               "password": "REDACTED",
               "countryCode": "REDACTED",
               "platform": "tuya"
           },
           "defaults": [
               {
                   "device_type": "form"
               }
           ],
           "scenes": false,
           "platform": "TuyaWebPlatform"
       }

Device Config

Unfortunately cannot do this step. The Teckin plugs work with Tuya which works with this plugin. All devices have worked but this is an issue I've had recently.

Additional Context

Only thing not set in my config is the polling interval. I believe this was removed as a default setting not too long ago. Would this make a difference?

@milo526
Copy link
Owner

milo526 commented Jan 6, 2021

I have not yet seen this happen before, the device offline error indicates that the Tuya Cloud cannot reach this device, this plugin simply forwards that message.
Some things to note - this error gets triggered when there is no wifi connection to the device or when the device is powered off, could the latter be the case for you?
If your devices is registered as offline, it will take at least 5 minutes for it to update so if you remove power from one of your devices, open the home app (and see the device as offline) it can take up to 6 minutes for the home app to show the correct status again (and you might have to reopen the home app to see any change at all)

@sterumbelow
Copy link
Author

The device definitely isn't powered off, or out of WiFi range.

The Tuya app shows it is online and I can control the device - meanwhile Homebridge and Homekit say it's offline.

Is it possible to have a communication issue between the Tuya app and Tuya web?

@milo526
Copy link
Owner

milo526 commented Jan 6, 2021

Yeah a communication issue between the Tuya Cloud and the Plugin is possible (the plugin does nothing with the Tuya App, it talks directly to Tuya's servers).
To check this you will need to provide me with the Device Config.

Please post the result of the steps under "How to check whether the api this library uses can control your device".

@sterumbelow
Copy link
Author

Yeah a communication issue between the Tuya Cloud and the Plugin is possible (the plugin does nothing with the Tuya App, it talks directly to Tuya's servers).

To check this you will need to provide me with the Device Config.

Please post the result of the steps under "How to check whether the api this library uses can control your device".

Here you go!

Getting credentials
Got credentials
{ 'access_token': 'EUheu159457033899160ap5jVS6fIIWdf',
'expires_in': 864000,
'refresh_token': 'EUheu159457033899160ap5tb1H9HYYCZ',
'token_type': 'bearer'}
Getting devices
Got devices
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': { 'devices': [ { 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfc752327a12ab46bedrkj',
'name': 'Dehumidifier'},
{ 'data': {'online': True, 'state': True},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf4e38e3552b2335a1ke9m',
'name': 'Garage Dehumidifier'},
{ 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfae9bcdbe57e83038rez4',
'name': 'Spare Bedroom Lamp'},
{ 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfd4efd01513d33f27ge75',
'name': 'Tyre'},
{ 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf2c3cb6e70282eed7u8yb',
'name': 'Ste Ice Cube'},
{ 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfaf5b3182c07cf3dauuex',
'name': 'Eli Ice Cube'},
{ 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf53dcc657966dc41alj5l',
'name': 'Fan'},
{ 'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf60e5be21f2202dd0nd6r',
'name': 'Marshmallow'}],
'scenes': []}}

@milo526
Copy link
Owner

milo526 commented Jan 6, 2021

And is at the moment one of your devices mis-behaving (in this case stating that it is offline?) cause then we have a problem 😛
If all devices are online now; could you please re-do this process and upload the results when one of your devices is shown as offline.

Thanks for your help 😄

@sterumbelow
Copy link
Author

And is at the moment one of your devices mis-behaving (in this case stating that it is offline?) cause then we have a problem 😛

If all devices are online now; could you please re-do this process and upload the results when one of your devices is shown as offline.

Thanks for your help 😄

All good at the moment but I'll repeat it when it happens again!

@jamesalmeida
Copy link

jamesalmeida commented Jan 6, 2021

I'm having this same issue. I can control inside Smart life app but Homekit says No Response…

1/6/2021, 3:05:58 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:05:58 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:05:58 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:05:58 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:05:58 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:05:58 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:06:00 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:06:00 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:06:00 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:00 PM [Smart Life] [Round plug] - Requesting device state
1/6/2021, 3:06:00 PM [Smart Life] [Round plug] - Creating new debounced promise
1/6/2021, 3:06:00 PM [Smart Life] [Round plug] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:00 PM [Smart Life] [Noise Machine] - Requesting device state
1/6/2021, 3:06:00 PM [Smart Life] [Noise Machine] - Creating new debounced promise
1/6/2021, 3:06:00 PM [Smart Life] [Noise Machine] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:01 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:01 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:01 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:06:01 PM [Smart Life] [Round plug] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:01 PM [Smart Life] [Round plug] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:01 PM [Smart Life] [Round plug] Characteristic.On - [GET] false
1/6/2021, 3:06:01 PM [Smart Life] [Noise Machine] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:01 PM [Smart Life] [Noise Machine] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:01 PM [Smart Life] [Noise Machine] - [GET] Device Offline
1/6/2021, 3:06:05 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:06:05 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:06:05 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:05 PM [Smart Life] [Noise Machine] - Requesting device state
1/6/2021, 3:06:05 PM [Smart Life] [Noise Machine] - Creating new debounced promise
1/6/2021, 3:06:05 PM [Smart Life] [Noise Machine] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:06 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:06 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:06 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:06:06 PM [Smart Life] [Noise Machine] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:06 PM [Smart Life] [Noise Machine] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:06 PM [Smart Life] [Noise Machine] - [GET] Device Offline
1/6/2021, 3:06:15 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:06:15 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:06:15 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:15 PM [Smart Life] [Noise Machine] - Requesting device state
1/6/2021, 3:06:15 PM [Smart Life] [Noise Machine] - Creating new debounced promise
1/6/2021, 3:06:15 PM [Smart Life] [Noise Machine] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:06:15 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:15 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:15 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:06:15 PM [Smart Life] [Noise Machine] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:06:15 PM [Smart Life] [Noise Machine] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:06:15 PM [Smart Life] [Noise Machine] - [GET] Device Offline
1/6/2021, 3:08:39 PM [Smart Life] [Round plug] - Requesting device state
1/6/2021, 3:08:39 PM [Smart Life] [Round plug] - Creating new debounced promise
1/6/2021, 3:08:39 PM [Smart Life] [Round plug] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:39 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:08:39 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:08:39 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:39 PM [Smart Life] [Noise Machine] - Requesting device state
1/6/2021, 3:08:39 PM [Smart Life] [Noise Machine] - Creating new debounced promise
1/6/2021, 3:08:39 PM [Smart Life] [Noise Machine] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:40 PM [Smart Life] [Round plug] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:40 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:40 PM [Smart Life] [Noise Machine] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:40 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from remote
1/6/2021, 3:08:40 PM [Smart Life] [Humidifier ] - Set device state request cache
1/6/2021, 3:08:40 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:08:40 PM [Smart Life] [Round plug] - Resolving resolveDeviceStateRequest from remote
1/6/2021, 3:08:40 PM [Smart Life] [Round plug] - Set device state request cache
1/6/2021, 3:08:40 PM [Smart Life] [Round plug] Characteristic.On - [GET] false
1/6/2021, 3:08:40 PM [Smart Life] [Noise Machine] - Resolving resolveDeviceStateRequest from remote
1/6/2021, 3:08:40 PM [Smart Life] [Noise Machine] - Set device state request cache
1/6/2021, 3:08:40 PM [Smart Life] [Noise Machine] - [GET] Device Offline
1/6/2021, 3:08:41 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:08:41 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:08:41 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:41 PM [Smart Life] [Noise Machine] - Requesting device state
1/6/2021, 3:08:41 PM [Smart Life] [Noise Machine] - Creating new debounced promise
1/6/2021, 3:08:41 PM [Smart Life] [Noise Machine] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:41 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:41 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:08:41 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:08:41 PM [Smart Life] [Noise Machine] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:41 PM [Smart Life] [Noise Machine] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:08:41 PM [Smart Life] [Noise Machine] - [GET] Device Offline
1/6/2021, 3:08:42 PM [Smart Life] [Round plug] Characteristic.On - [SET] true 1
1/6/2021, 3:08:44 PM [Smart Life] [Round plug] Characteristic.On - [SET] false 0
1/6/2021, 3:08:47 PM [Smart Life] [Humidifier ] - Requesting device state
1/6/2021, 3:08:47 PM [Smart Life] [Humidifier ] - Creating new debounced promise
1/6/2021, 3:08:47 PM [Smart Life] [Humidifier ] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:47 PM [Smart Life] [Noise Machine] - Requesting device state
1/6/2021, 3:08:47 PM [Smart Life] [Noise Machine] - Creating new debounced promise
1/6/2021, 3:08:47 PM [Smart Life] [Noise Machine] - Triggering debouncedDeviceStateRequest
1/6/2021, 3:08:47 PM [Smart Life] [Humidifier ] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:47 PM [Smart Life] [Humidifier ] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:08:47 PM [Smart Life] [Humidifier ] - [GET] Device Offline
1/6/2021, 3:08:47 PM [Smart Life] [Noise Machine] - Unsetting debouncedDeviceStateRequestPromise
1/6/2021, 3:08:47 PM [Smart Life] [Noise Machine] - Resolving resolveDeviceStateRequest from cache
1/6/2021, 3:08:47 PM [Smart Life] [Noise Machine] - [GET] Device Offline

@MarioSave
Copy link

The same here, started today at noon

@stckhlm73
Copy link

Yes, also having this issue.

@phill-hunt
Copy link

Same for me App works fine for all devices but HomeBridge says offline

@tmeier82
Copy link

tmeier82 commented Jan 7, 2021

Same error happening for me here as well. 3 Devices offline in HomeBridge but visible on the Tuya app.
Also getting a ratelimiterror which I haven't seen before.

[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Device Offline

@tmeier82
Copy link

tmeier82 commented Jan 7, 2021

Same error happening for me here as well. 3 Devices offline in HomeBridge but visible on the Tuya app.
Also getting a ratelimiterror which I haven't seen before.

[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Device Offline

Does not seem to be doing it anymore.

@stckhlm73
Copy link

Intriguing! Seems to have fixed itself for me too!

@sterumbelow
Copy link
Author

There have been a couple of Tuya app updated (iOS) recently. I wonder whether one broke the app and the most recent one (pushed after I posted this issue) fixed it again?

I haven't had the problem again...so far.

image

@phill-hunt
Copy link

I’m using the Smart Life app not. Tuya and had the same issue seem to be working now though

@milo526
Copy link
Owner

milo526 commented Jan 7, 2021

Given the context of this issue and the information I got from other sources (amongst others multiple Reddit threads); it seems like there was a problem at Tuya.

Please keep me updated if this happens more often.

@sterumbelow
Copy link
Author

sterumbelow commented Jan 7, 2021

Given the context of this issue and the information I got from other sources (amongst others multiple Reddit threads); it seems like there was a problem at Tuya.

Please keep me updated if this happens more often.

Ok, so I had it happen again this evening.

Tuya app showed all devices online and working. Home app showed my 'Tyre' as 'No Response'. Homebridge showed '[Tyre] - [GET] Device Offline' again.

I've pulled the log as you requested - it shows the tyre as online, so I guess Tuya Web is pulling the information correctly after all. That presumably means there's an issue between Tuya Web/Plugin/Homebridge/Home.

Here's the log:

Getting credentials Got credentials { 'access_token': 'EUheu159457033899160ap5vY16jtRDO3', 'expires_in': 864000, 'refresh_token': 'EUheu159457033899160ap5vdqOuyh8Xt', 'token_type': 'bearer'} Getting devices Got devices { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': { 'devices': [ { 'data': {'online': True, 'state': True}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfc752327a12ab46bedrkj', 'name': 'Dehumidifier'}, { 'data': {'online': True, 'state': True}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf4e38e3552b2335a1ke9m', 'name': 'Garage Dehumidifier'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfae9bcdbe57e83038rez4', 'name': 'Spare Bedroom Lamp'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfd4efd01513d33f27ge75', 'name': 'Tyre'}, { 'data': {'online': True, 'state': True}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf2c3cb6e70282eed7u8yb', 'name': 'Ste Ice Cube'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfaf5b3182c07cf3dauuex', 'name': 'Eli Ice Cube'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf53dcc657966dc41alj5l', 'name': 'Fan'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf60e5be21f2202dd0nd6r', 'name': 'Marshmallow'}], 'scenes': []}}

image
image

@sterumbelow
Copy link
Author

Further to my post above:

I restarted Homebridge and initially all devices showed as 'No Response' in Home, while Homebridge just continued to show the Tyre as offline.

Then, it changed to a different device that was offline (the fan).

I checked the log again and noticed the yellow line of text.

image

I decided to remove this line of code that was left over in my config:

"defaults": [ { "device_type": "form" } ],

After I did that, and restarted again, the issue has completely resolved itself.

Unsure whether that was causing an issue or not.

What do you think?

@milo526
Copy link
Owner

milo526 commented Jan 8, 2021

The last warning you posted is of no influence (that is also the subtle difference between a warning and an error) in this case the plugin will just ignore that specific part of your configuration.

Regarding the issue - I'll keep an eye on it cause I really don't understand what is going on here...

@sterumbelow
Copy link
Author

sterumbelow commented Jan 11, 2021

So this happened to me again just now.

  • Physical switch was on.
  • Tuya app - Shows on and is controllable
  • Homebridge - Shows on but is uncontrollable
  • Homebridge log - [GET] Device Offline
  • Home app - shows 'No response'

Screenshots and log below. And thank you for looking over this for me (and the others!).

image
imageimageimage

Log

Getting credentials Got credentials { 'access_token': 'EUheu159457033899160ap5uJcXAfFNxT', 'expires_in': 864000, 'refresh_token': 'EUheu159457033899160ap5H9pPukNtQR', 'token_type': 'bearer'} Getting devices Got devices { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': { 'devices': [ { 'data': {'online': True, 'state': True}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfc752327a12ab46bedrkj', 'name': 'Dehumidifier'}, { 'data': {'online': True, 'state': True}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf4e38e3552b2335a1ke9m', 'name': 'Garage Dehumidifier'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfae9bcdbe57e83038rez4', 'name': 'Spare Bedroom Lamp'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfd4efd01513d33f27ge75', 'name': 'Tyre'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf2c3cb6e70282eed7u8yb', 'name': 'Ste Ice Cube'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bfaf5b3182c07cf3dauuex', 'name': 'Eli Ice Cube'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf53dcc657966dc41alj5l', 'name': 'Fan'}, { 'data': {'online': True, 'state': True}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf60e5be21f2202dd0nd6r', 'name': 'Marshmallow'}], 'scenes': []}}

@milo526
Copy link
Owner

milo526 commented Jan 11, 2021

Thanks for the report!

I'll try to validate this in the next few days.

@milo526
Copy link
Owner

milo526 commented Jan 14, 2021

I really can't find any glaring issues in the code and it hasn't happened for me.
I'm more and more starting to believe that the issue might be elsewhere.
I'll keep this open but don't expect a quick fix since I really don't know what to do about this 😅

@aryajuanda
Copy link

i have a same problem.. the problem seem happened when device is turning off manually and back turn on manually (loosing electricity). In tuya app, its reconect again but in homebridge it get device Offine and in home hit get No response..
restarting homebridge fix the problem...

@stale
Copy link

stale bot commented Jan 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This issue has not received any updates for some time. label Jan 26, 2021
@stale stale bot closed this as completed Jan 31, 2021
@bkarlson
Copy link

Just a follow up for those who still experiencing this and coming from searches:

BLE devices can be connected to directly from your phone, in such case they seem offline, even though they're online and functional. If at iot.tuya.com you see devices as online (and can control them via Tuya app) but Homebridge/Homekit shows them offline the solution is simple: revoke bluetooth access from Tuya app. You need Bluetooth only for initial setup, but once a device is configured and accessible via web API and this plugin, Bluetooth is not necessary and even harmful as it hijacks device and makes it seem offline.

So either turn off your phone's bluetooth or just revoke Bluetooth permission from Tuya / Smartlife and it should work.

@milo526, maybe we can modify error message to let users understand what's happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue has not received any updates for some time.
Projects
None yet
Development

No branches or pull requests

9 participants