plasticrake / homebridge-tplink-smarthome

TP-Link Smarthome Plugin for Homebridge
MIT License
480 stars 70 forks source link

One disconnected device makes all devices "no response" #126

Open fidwj01 opened 4 years ago

fidwj01 commented 4 years ago

Expected Behavior

Only the disconnected device should be "no response" in the Home app

Current Behavior

If any of the devices is unplugged, it will make not only that particular device "no response" but also everything else.

Steps to Reproduce (for bugs)

Have more than 1 device added using the TP-Link plugin and working in the Home app, unplug any 1 device.

Versions

Configuration


{
    "name": "TP-Link",
    "platform": "TplinkSmarthome"
}

Homebridge Log / Command Output

[TP-Link.API] TCP Timeout
[TP-Link.API] [Heater] device.send() Error: TCP Timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/client.js:228:20)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
[TP-Link] [Heater] 
[TP-Link] Error: TCP Timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/client.js:228:20)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
SupImDos commented 4 years ago

I've been having this same issue (however UDP timeout instead of TCP?). One of my TPLink lights is in a low WiFi environment, and sometimes doesn't connect properly. This makes all other accessories unresponsive.

[5/3/2020, 20:19:18] [TplinkSmarthome.API] UDP Timeout
[5/3/2020, 20:19:18] [TplinkSmarthome.API] [Lamp] device.send() Error: UDP Timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/client.js:144:22)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
[5/3/2020, 20:19:18] [TplinkSmarthome] [Lamp]
[5/3/2020, 20:19:18] [TplinkSmarthome] Error: UDP Timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/client.js:144:22)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
[5/3/2020, 20:19:18] [TplinkSmarthome.API] UDP Timeout
[5/3/2020, 20:19:18] [TplinkSmarthome.API] [Lamp] device.send() Error: UDP Timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/client.js:144:22)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
[5/3/2020, 20:19:18] [TplinkSmarthome] [Lamp]
[5/3/2020, 20:19:18] [TplinkSmarthome] Error: UDP Timeout
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/client.js:144:22)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
fidwj01 commented 4 years ago

It happens very frequently, it will just randomly drop a switch/plug then the whole thing will become "no response". I can still turn it on/off using the KASA app, but the plugin won't work.

I also noticed another issue that when the KASA app says "local only", the plugin will get this error too. Which is interesting because I thought this plugin controlled the switches/plugs by utilizing local network.

I've been testing Home Assistant simultaneously, and it seems to be working far more stable than this Homebridge plugin. It works every time even when this plugin is having all those errors I mentioned above.

qthatswho commented 4 years ago

I see timeouts like this quite a lot. I think I know which switch is the culprit, and it does happen to be in a questionable WiFi zone (in between two APs). I've improved things slightly by disabling the Mesh/hopping functionality on the router, but it just has low WiFi signal, and I think it might be triggering lots of these timeouts for all of my devices.

plasticrake commented 4 years ago

Does the newest version (v5.2.0) of the plugin help with this issue?

qthatswho commented 4 years ago

I am no longer seeing these timeouts with 5.2.0.

fidwj01 commented 4 years ago

It seems like there’s a new issue with the new version. Even though the devices are working on phone (the Home app), HomePod would sometimes say they’re not responding and sometimes “can’t connect to the devices remotely” or something like that. Everything is connected locally under the same WiFi network though. I’ve never seen this before, think I’ll have to rollback to older version for now because I use HomePod to control them 90% of the time.