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

This plugin slows down Homebridge #182

Closed
bdruth opened this issue Feb 26, 2021 · 16 comments · Fixed by #183
Closed

This plugin slows down Homebridge #182

bdruth opened this issue Feb 26, 2021 · 16 comments · Fixed by #183
Assignees

Comments

@bdruth
Copy link

bdruth commented Feb 26, 2021

Expected Behavior

Plugin should work well in Homebridge 1.3+

Current Behavior

Plugin is non-responsive when controlling some TP-Link devices (HS300 outlets in my case)
This also manifests in the Home app, certain plugs shows as "No Response" (the ones that have devices plugged in)

Steps to Reproduce (for bugs)

Homebridge 1.3+ started producing these warnings, but responsiveness was already an issue before.

Versions

  • Node: 10..21.0
  • Homebridge: 1.3.1
  • OS: Raspbian 10 on RPi 4 (32-bit)

Configuration

        {
            "name": "TplinkSmarthome",
            "platform": "TplinkSmarthome"
        }

Homebridge Log / Command Output

[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Outlet In Use' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Amperes' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Total Consumption' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Apparent Power' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Volts' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/26/2021, 7:56:41 AM] [homebridge-tplink-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Consumption' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
@ghost
Copy link

ghost commented Feb 26, 2021

Same her, for that reason, I moved it to a childbridge to not slow down other devices..

@steinmb
Copy link

steinmb commented Feb 26, 2021

+1 Same in my installation. More info - https://github.com/homebridge/homebridge/wiki/Characteristic-Warnings
Could perhaps also be related to issue #178 ?

@joepool
Copy link

joepool commented Feb 27, 2021

Same here, related to the messages in #180 too I believe.

@bdruth
Copy link
Author

bdruth commented Feb 28, 2021

It's very much impacting functionality for me at this point. Not sure why, but my HS300 is seriously impacted. Maybe it's all the optional characteristics?

@bdruth
Copy link
Author

bdruth commented Feb 28, 2021

Disabled optional characteristics this morning:

"addCustomCharacteristics": false

and early info is that it does make a difference - everything's loading much faster now, will wait a bit to make sure this isn't just a factor of the Homebridge reboot.

@bdruth
Copy link
Author

bdruth commented Mar 1, 2021

It's definitely the custom characteristics. 10h later and everything is still snappy. Haven't had a single 'No response' all day.

@plasticrake
Copy link
Owner

I released a beta version 6.3.0-beta.0 that should fix the This plugin slows down Homebridge message. Please try it and let me know if its working better and that it didn't break anything.

Install instructions

@plasticrake plasticrake self-assigned this Mar 1, 2021
@ratsoid
Copy link

ratsoid commented Mar 1, 2021

I'm no longer receiving the warnings with 6.3.0-beta.0, however these show up after the tp-link device (hs110) is added to homebridge

[01/03/2021, 18:58:40] [homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Amperes': Characteristic not in required or optional characteristic section for service Service. Adding anyway.. See https://git.io/JtMGR for more info.
[01/03/2021, 18:58:40] [homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Total Consumption': Characteristic not in required or optional characteristic section for service Service. Adding anyway.. See https://git.io/JtMGR for more info.
[01/03/2021, 18:58:40] [homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Apparent Power': Characteristic not in required or optional characteristic section for service Service. Adding anyway.. See https://git.io/JtMGR for more info.
[01/03/2021, 18:58:40] [homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Volts': Characteristic not in required or optional characteristic section for service Service. Adding anyway.. See https://git.io/JtMGR for more info.
[01/03/2021, 18:58:40] [homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Consumption': Characteristic not in required or optional characteristic section for service Service. Adding anyway.. See https://git.io/JtMGR for more info.

@plasticrake
Copy link
Owner

@ratsoid That is explained on the README for this plugin and can be ignored. It would be great if you can post another update in another day or so to let me know if it is still stable. I can then move this fix out of beta. Thanks!

@bdruth
Copy link
Author

bdruth commented Mar 2, 2021

I'll have to try 6.3.0-beta.0 - after a good start, things got really slow again, even w/ optional characteristics off.

@bdruth
Copy link
Author

bdruth commented Mar 2, 2021

Plugin seems to be working, but seeing this in the log:

[3/2/2021, 12:42:27 PM] [TplinkSmarthome.API] TCP 192.168.7.246:9999 Error: connect ECONNREFUSED 192.168.7.246:9999
[3/2/2021, 12:42:27 PM] [TplinkSmarthome.API] [Living Room Window String Light] device.send() Error: connect ECONNREFUSED 192.168.7.246:9999
(node:14965) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.7.246:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
(node:14965) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14965) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:14965) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.7.246:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
(node:14965) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Might be I have a device that's not plugged in or something, but I don't think I've seen this previously and all the devices in my living room seem to be working ... I'll see if I can track it down.

@ratsoid
Copy link

ratsoid commented Mar 2, 2021

I haven't seen any lag on my end with 6.3.0b0

@bdruth
Copy link
Author

bdruth commented Mar 4, 2021

So - I don't see any lag when I open the Home app .. status is reported very fast. However ... trying to toggle the state suffers ... spinner for however long and then timeout causes the ! icon. And the command never reaches the plugs. This is on an HS300 - not sure if having 6 plugs on one (physical) device is somehow exacerbating a problem somewhere. So ... 6.3.0-beta.0 is not 100% working for me. Even w/o Home, my Node-RED automations aren't able to trigger state changes for the plugs.

@plasticrake
Copy link
Owner

@bdruth the HS300 issue is something else. I'm going to try to work on that next. The issue is that each outlet on the device requires a separate API call. And with the polling happening it will get caught up on one of the outlets and then the device is unresponsive for the other calls. Those devices need special handling so they don't get overloaded by this plugin.

@plasticrake plasticrake linked a pull request Mar 6, 2021 that will close this issue
@plasticrake plasticrake changed the title This plugin slows down Homebridge! This plugin slows down Homebridge Mar 6, 2021
@bdruth
Copy link
Author

bdruth commented Mar 14, 2021

@plasticrake is there another issue or PR that I can track for this fix? I even tried going back to a much older release (5.1.0) and still had this issue, even though I swear this was working fine last year - I have two of these HS300s for my wife's seed-starting setup, managing grow lights, warming pads, fans, etc. Set it up last year and it was all 💯 - now my wife's about to strangle me every day 😢

Also - happy to contribute, if you know what needs to be done, but just haven't had the time - I'm happy to push a PR, I'm just not familiar with this plugin's code/structure.

@steinmb
Copy link

steinmb commented Mar 15, 2021

Have a look at @bdruth - #181 Join in but make sure you include the firmware version running on your HS300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants