plasticrake / homebridge-tplink-smarthome

TP-Link Smarthome Plugin for Homebridge
MIT License
468 stars 69 forks source link

HomeKit Displaying "No Response" #138

Open experiencedUser opened 3 years ago

experiencedUser commented 3 years ago

So while I was able to get everything up and running okay, I’m experiencing some odd issues in HomeKit that I’ve never seen before. Most of the issues come from my TP-Link devices showing “No Response”. Now what’s odd is that when I click a device in HomeKit, it’s like it wakes it up or something because then it returns by stating whether the device is on or off as expected. The no response issue goes away, but this is only an as per device fix meaning I have to click each device to “wake it up” if that makes sense. It shows that it’s connected until I quit/leave the HomeKit app, then once I return again, it goes back to “No Response”. All my devices are online (AND 100% CONTROLLABLE 24/7) as far as the TP-Link (Kasa) app is concerned. It also appears that this issue is causing my other Homebridge devices to appear unresponsive as well for some odd reason. Even other plugins seem to be directly affected by this issue, but I can't confirm that, unfortunately.

Every time I relaunch HomeKit it should be attempting to make a connection with the HOOBS server and in turn, the connected devices should ping back their status. But for whatever reason each device keeps going back to “No Response” and I have to manually click each device to have it display its status again.

So I don’t really get what’s going on. HOOBS is a 24/7 server that should just always be active so why am I getting conflicting no response errors saying that my devices aren’t connected when in a sense they “are connected”?

Also, someone suggested that I should manually specify what TP-Link devices I'm trying to connect by assigning each with a static IP. I have well over 40 devices, so this would take a LOT of time. Also, while a static IP would make it so that those same devices wouldn't always be reassigned a new IP every time they lose connection, it does not solve any problem that I'm experiencing. When I installed the TP-Link plugin, it was able to find all the devices on my network without an issue, so static or not, I don't feel that is the problem.

Someone also mentioned that this is an issue specifically with the HS300 power strips. First off, why are the HS300’s an issue? It would be one thing if it was just those devices, but it isn’t. It is every single TP-Link device on my network. We’re talking (Outlets:: HS105, HS107, HS300) (Switches:: HS200, HS210, HS220) Every device is giving me issues!

Please help me understand what the issue actually is because I have absolutely no clue what’s causing it. I just want my system to run without me having to constantly tend to it. Any help at all is greatly appreciated. Thanks!

////////////////////////////////////////////////////////////

So between all failed attempts to try to get this to work, I've experienced 3 different issues. As if one wasn't enough!!!

  1. Error: TCP Timeout
  2. Error: TCP Socket Closed. segment:0 hadError:false
  3. Error: connect ETIMEDOUT

Now the issue appears to be isolated to just the "Error: connect ETIMEDOUT"

/////////////// ///////////////

Below is a HOOBS log showcasing the issue...

///////////////

9/18/2020, 10:40:14 PM [TplinkSmarthome.API] TCP 192.168.1.53:9999 Error: connect ETIMEDOUT 192.168.1.53:9999 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect', address: '192.168.1.53', port: 9999 } 9/18/2020, 10:40:14 PM [TplinkSmarthome] [Dining Room] 9/18/2020, 10:40:14 PM [TplinkSmarthome] Error: connect ETIMEDOUT 192.168.1.53:9999 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect', address: '192.168.1.53', port: 9999 }

///////////////

node version | v12.16.3 HOOBS Version | 3.2.6 OS | Raspbian GNU/Linux

///////////////

json.config (just the relevant section) - it is formatted correctly on HOOBS (please ignore the brackets and formatting)

{ "platform": "TplinkSmarthome", "name": "TplinkSmarthome", "timeout": 120, "pollingInterval": 20, "plugin_map": { "plugin_name": "homebridge-tplink-smarthome" } },

///////////////

PLEASE HELP!!! THANK YOU

dinhvh commented 3 years ago

I'm also running into this issue.

experiencedUser commented 3 years ago

I just hope the plugin developers have seen this thread and are currently looking into this issue. Although it's only been 4 days since this thread was created, I am beginning to be more and more doubtful that someone will offer some help judging by the rather delayed responses or total lack of support on unanswered questions dating back almost 4 months!

Developers!!! I get that you don't get paid for this "free to use" plugin, but it's incredibly hard to not get pissed off when problems like this aren't being addressed. I have reached out to multiple users trying to figure out why their systems work PERFECTLY fine!! And yet mine is a total mess. I even simplified my config file down to just this...

{ "platform": "TplinkSmarthome" }

Other users swore by their experiences that they did not need to add all that extra gibberish to make it work. They literally just use the default setting with no special parameters. So why do their systems work and mine doesn't?? It's just so frustrating!

I'm pissed because THIS IS SUPPOSED TO BE EXTREMELY SIMPLE! But it's turning into more of an elaborate project that I just don't have the patience to deal with anymore! I've probably spent at least 48 hours cumulatively trying to get to the bottom of this with no sign of success, so I'm just saying it would be nice if someone can help out here!

AND... as I have mentioned, I can now 100% confirm this plugin is causing my entire homebridge system (paired with HomeKit) to show "no response". I deleted the Tplink plugin, all other devices worked FINE with no errors. Re-install the tplink plugin and bam! Whole HomeKit, showing "no response". WHY IS THAT?!!!

CAN WE PLEASE GET AN ANSWER SOON???!!!!!

plasticrake commented 3 years ago

@experiencedUser I'm the developer of this project. Its basically just me, although there have been a few people who have submitted pull requests to the project that I'm grateful for. I'm sorry you're having issues. I don't always have time to dedicate to this project especially with everything else going on, COVID, wildfires, etc. I'm trying to steal an hour every week or so to work on things. I also have sponsor buttons on both my TPLink projects with zero sponsors at the moment. Because you're right, I don't get paid for this (currently), and I created this as a personal hobby project. You can see there are many users with issues and I don't always have the time to respond or help everyone.

I do know that some newer TPLink devices with new firmware versions are starting to lock up and reset when given certain commands that used to work fine. I am working a new version that avoids these commands and also trying to make the error handling more robust so it doesn't lock up homebridge. Some people run an instance of homebridge for each plugin so that it will isolate any issues. Most of that work is happening in the tplink-smarthome-api repo

kellermanns commented 3 years ago

Ok, then let's fix that - and since talk is cheap, I'll get the ball rolling ...

[9/25/2020, 08:11:48] [TplinkSmarthome] Error: TCP Timeout at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:62:22) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

a-dows commented 3 years ago

@plasticrake thank you for all your hard work. It sounds like this next release will get rid of basically all the HS300-related open issues. I’m looking forward to it, and will sign up to sponsor you as soon as I’m able to financially.

experiencedUser commented 3 years ago

Awesome, I really appreciate that this issue is being looked into. I look forward to having my devices fully responsive once this update comes out. Please reach out with any other questions or if you need me to verify or confirm anything else. Thanks!

plasticrake commented 3 years ago

I have a pre-release version of this plugin that is a complete rewrite from javascript to typescript. I can't say for sure if the no response issue is better in this release, but I'd love for everyone to try it out. You can install it using the next tag like: npm -g install homebridge-tplink-smarthome@next now that the lengthy rewrite is complete I can focus on specific issues like this.

songo-github commented 3 years ago

I have a pre-release version of this plugin that is a complete rewrite from javascript to typescript. I can't say for sure if the no response issue is better in this release, but I'd love for everyone to try it out. You can install it using the next tag like: npm -g install homebridge-tplink-smarthome@next now that the lengthy rewrite is complete I can focus on specific issues like this.

Thank you for the rewrite, I cant find instructions anywhere in homebridge to troubleshoot this error

Error loading platform requested in your config.json at position 2 [10/11/2020, 8:34:06 PM] Error: The requested platform 'TplinkSmarthome' was not registered by any plugin. at PluginManager.getPluginForPlatform (/usr/lib/node_modules/homebridge/src/pluginManager.ts:224:15) at /usr/lib/node_modules/homebridge/src/server.ts:385:37 at Array.forEach () at Server.loadPlatforms (/usr/lib/node_modules/homebridge/src/server.ts:372:27) at Server.start (/usr/lib/node_modules/homebridge/src/server.ts:151:29) at cli (/usr/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1015:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10) at Module.load (internal/modules/cjs/loader.js:879:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47

I installed with "npm -g install homebridge-tplink-smarthome@next"

plasticrake commented 3 years ago

@songo-github the package was bundled missing index.js and a few other files for some reason. I'll figure that out and publish a new next release

plasticrake commented 3 years ago

@songo-github Okay, new version published that fixes that issue and includes a few feature

plasticrake commented 3 years ago

I've released v5.2.0, I'd love any feedback good or bad.

songo-github commented 3 years ago

I've released v5.2.0, I'd love any feedback good or bad.

@songo-github the package was bundled missing index.js and a few other files for some reason. I'll figure that out and publish a new next release

Thank you! Installed without issue and so far haven't seen any timeouts. On this install the only device I have is the dreaded HS300.

Did this release remove the consumption history exposure to homekit?

kellermanns commented 3 years ago

Patrick

Thanks for the hard work - I installed 5.20 last night and so far no time-out issues - I do get the following message in the log (repeating itself with other devices):

[10/13/2020, 06:47:50] [TplinkSmarthome] [Heater] fireCharacteristicUpdateCallback [3.8976640000000002]: Unable to call updateCallback VoltAmperes

I tried "addCustomCharacteristics": false and true, but no difference here. I assume this should be a new issue, though ...

Thanks again for the hard work and stay safe DK

experiencedUser commented 3 years ago

Hi Patrick,

So after the update, I'm still experiencing the same issues. Although I know the intent of this update was supposed to address these issues, I'm still curious about the process that went into the update? Or I guess more specifically, what exactly was this update supposed to fix?

Here's the error logs which appear to be the same as before. ///////////////////////////

10/13/2020, 12:00:29 PM [TplinkSmarthome] [Wireless Charger] emeter.getRealtime() 10/13/2020, 12:00:29 PM [TplinkSmarthome] Error: TCP Timeout at Timeout._onTimeout (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:62:22) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) 10/13/2020, 12:00:29 PM [TplinkSmarthome.API] TCP 192.168.1.55:9999 Error: TCP Timeout at Timeout._onTimeout (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:62:22) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

///////////////////////////

Do you have any idea as to what is still causing this issue? It just frustrates me even more knowing that other users have said this update fixed the timeout issue, but yet my system is still the same as before. Please reach out with a solution if you are able to provide one. Thanks!

plasticrake commented 3 years ago

@experiencedUser Can you confirm the version of this plugin and the version of homebridge you are using? It looks like you're using HOOBS and I think they have it pointing to an older version of the plugin.

experiencedUser commented 3 years ago

My apologies, I thought the updated version was already installed. Since I am using hoobs instead of homebridge, it doesn't give me the option to fully input a .json file. This is the "new" interface I am presented with and I am unsure what to keep and what to change in relation to my knowledge of editing an actual .json file. Although I would assume you have more experience with homebridge, hoobs on the other hand appears to have the same characteristics where you have to enter the credentials in a graphical text box instead. I'm hoping that you can walk me through this interface based on the similarities of the code in an actual .json file.

Screen Shot 2020-10-13 at 12 10 27 PM Screen Shot 2020-10-13 at 12 10 30 PM
experiencedUser commented 3 years ago

@plasticrake

Here is the new log since the update...

10/13/2020, 6:41:58 PM Loaded plugin "homebridge-tplink-smarthome". 10/13/2020, 6:41:58 PM The requested platform "TplinkSmarthome" was not registered by any plugin. 10/13/2020, 6:41:58 PM Your config.json is requesting the platform "TplinkSmarthome" which has not been published by any installed plugins.

dinhvh commented 3 years ago

It seems to fix it for me.

experiencedUser commented 3 years ago

In my previous comment the logs were and still are showing that the platform was not registered by any plugin. Why is that? I would really appreciate some assistance with this. Thank you.

songo-github commented 3 years ago

@experiencedUser In homebridge I deleted the plugin through ui-x , and allowed the config to be removed when uninstalling the plugin. After reinstallation through ui-x the message was gone.

https://i.imgur.com/vlNY5WU.png

 "platforms": [
        {
            "name": "Config",
            "port": 8575,
            "platform": "config"
        },
        {
            "name": "TplinkSmarthome",
            "addCustomCharacteristics": true,
            "inUseThreshold": 1,
            "deviceTypes": [
                "plug",
                "bulb"
            ],
            "platform": "TplinkSmarthome"
        }
    ]
experiencedUser commented 3 years ago

@songo-github @plasticrake I appreciate the suggestion, but you're referencing a system that uses a user installed version of homebridge. I'm using HOOBS which comes with a preinstalled version of homebridge to "simplify" things if you will. I will say you have less advanced controls, but the one of the main reasons I switched to HOOBS instead because I didn't want to deal with the hassle of constantly having to troubleshoot things.

Here are the two images of the graphical interface. I would really appreciate if you can take a look at them.

Screen Shot 2020-10-13 at 12 10 27 PM Screen Shot 2020-10-13 at 12 10 30 PM

These are the options I am given under the HOOBS interface. Again, this is the message I'm getting from the logs. I do not have the ability to "change" or "modify" the json file pertaining to this specific plugin on its own.

///////////////////// 10/17/2020, 1:44:35 PM Loaded plugin "homebridge-tplink-smarthome". 10/17/2020, 1:44:35 PM The requested platform "TplinkSmarthome" was not registered by any plugin. 10/17/2020, 1:44:35 PM Your config.json is requesting the platform "TplinkSmarthome" which has not been published by any installed plugins. /////////////////////

As shown by the logs, the tplink plugin isn't even being referenced. This only ever became an issue since the update was released. So if the up to date plugin is installed, why isn't it able to access the plugin correctly? In actuality the update made the entire platform go under whereas it was able to "access" the plugin just fine before. The previous issue with the old version (before the update) was the TCP timeout issue, but now my system can't even access the TPLink plugin.

Screen Shot 2020-10-17 at 2 06 30 PM

This is really frustrating because it's like I'm the only one in this boat while everyone else is stating it works PERFECTLY fine for them. I just don't get it. And all I ask is why :(

plasticrake commented 3 years ago

@experiencedUser You're using an unsupported version of homebridge. Either use a current version of homebridge, or use an older version of the plugin (v5.1.0). See #147

nathanjskelton commented 3 years ago

For me the “system wide no response” error started within the past week. I am running home bridge in HOOBS and recently updated to 3.2.9, so it’s hard to know if the recent update to this plugin or the HOOBS update caused this. I am running about 10 plug-ins; removing this one resolved the issue for now... luckily the only thing I was using this for is an outdoor plug that controls a fan... so we have till summer to work it out :) If I get some time maybe I’ll take a look at the code.

experiencedUser commented 3 years ago

@nathanjskelton @plasticrake @kellermanns After contacting HOOBS support, a representative confirmed that the update released on October 20th (Version 3.2.9) was supposed to fix whatever issue causing my system to not function. I still don't even know what the issue is because all the developers keep claiming that the issue is caused because of an unsupported version of something. Like what does that mean? All I know is that even after this recent HOOBS update, the same issue is still ongoing.

I really don't understand why I'm the only person that is having so many complications with this plugin!

Either it works or it doesn't work! I'm having a very hard time believing that it's purely a matter of chance as to why my system has been broken for the longest time.

It makes absolutely no sense that it works for just about everyone else and not at all for a select few, like myself!

Once again, I have not created or defined any special characteristics that would have affected the functionality of this plugin to make my configuration invalid. I'm not even touching any of the settings and instead just leaving it as is. And yet, what a surprise, it still doesn't work!

Somebody please tell me what's going on and how we can fix this, then I'll consider expressing my gratitude by supporting this plugin!

I just want to be able to use my TP-Link devices with HomeKit again! That is not a lot to ask for especially when it already works perfectly fine for everyone else.

///////////// Error Code from logs /////////////

11/6/2020, 8:47:25 PM [TplinkSmarthome.API] [Monitors] device.send() Error: TCP Timeout after 15000ms 192.168.1.68:9999 {"emeter":{"get_realtime":{}},"context":{"child_ids":["8006CC062F3DB48EFCFAEDEF7EB1C94D1B26071D02"]}} at Timeout._onTimeout (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) 11/6/2020, 8:47:25 PM [TplinkSmarthome] [Monitors] emeter.getRealtime() 11/6/2020, 8:47:25 PM [TplinkSmarthome] Error: TCP Timeout after 15000ms 192.168.1.68:9999 {"emeter":{"get_realtime":{}},"context":{"child_ids":["8006CC062F3DB48EFCFAEDEF7EB1C94D1B26071D02"]}} at Timeout._onTimeout (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) 11/6/2020, 8:47:25 PM [TplinkSmarthome.API] TCP 192.168.1.68:9999 Error: TCP Timeout after 15000ms 192.168.1.68:9999 {"emeter":{"get_realtime":{}},"context":{"child_ids":["8006CC062F3DB48EFCFAEDEF7EB1C94D1B26071D01"]}} at Timeout._onTimeout (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

mranallo commented 3 years ago

@experiencedUser @plasticrake I had this same issue. I did some debugging and was able to trace the issue to an outside plug that wasn't responding. Once I reset that plug I no longer get this issue, and everything responds in HomeKit very quickly.

experiencedUser commented 3 years ago

@nathanjskelton @plasticrake @kellermanns

In response to @mranallo, I have tried doing exactly that. I literally went through the entire house deleting and re-adding devices back into the Kasa app. I have not noticed any difference because I'm still having the same exact problems.

So, one thing I tried afterwards was increasing the timeout variable to 30 whereas it was originally left blank before.

Timeout (seconds) (seconds) Communication Timeout

to 30

Ever since I changed this variable, it allows HomeKit to show all devices being connected for a short period of time. After the 30 second time window, I'm assuming the devices all timed out. So is that what this is all about?

What is supposed to happen after devices timeout? Are they supposed to reconnect automatically?

Also, now I'm getting mixed error codes. This is beyond frustrating!

Error: TCP Timeout after 30000ms Error: TCP Socket Closed. segment:0 hadError:false

Please provide assistance. Thank you!

iBaird44 commented 1 year ago

I am having this 'no response' issue with ONE Kasa switch out of 6 that I use. Everything works perfectly though - The switch works fine in the Kasa App, from the Homebrige Server and through my iPhone. The status updates through all interfaces when the light is on or off but the switch still comes up with 'no response' on the Home App. It's only an annoyance because of the 'no response' status but I'd sure love to solve the bug. I've reset the switch a few times already.