iklein99 / homebridge-smartthings

This is a plugin to Homebridge to connect your Smartthings network into Apple Home Kit.
Apache License 2.0
150 stars 52 forks source link

Many "This plugin slows down Homebridge." errors thrown #163

Closed MrCmonster closed 1 year ago

MrCmonster commented 1 year ago

Describe The Bug: Many This plugin slows down Homebridge. errors thrown during background device refreshes.

To Reproduce: Pair several Somfy (Bali) blinds to SmartThings. Let the HomeBridge plugin run. Note: This has been occurring for at least a few weeks. The last couple of updates have reduced the number of these errors, but the are still persistent.

Expected behavior: No errors in the logs from the homebridge-smartthings plugin should be seen.

Logs:

[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Current Position' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Position State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Current Position' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Position State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Current Position' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Position State' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://homebridge.io/w/JtMGR for more info.
[03/04/2023, 07:57:43] [homebridge-smartthings-ik] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://homebridge.io/w/JtMGR for more info.

Plugin Config:

{
            "name": "Smartthings Plug (IK)",
            "BaseURL": "https://api.smartthings.com/v1/",
            "AccessToken": "XXXX",
            "GarageDoorMaxPoll": 40,
            "PollLocksSeconds": 10,
            "PollDoorsSeconds": 10,
            "PollSensorsSeconds": 5,
            "PollSwitchesAndLightsSeconds": 10,
            "IgnoreDevices": [
                "Dishwasher",
                "Samsung QN85BD 85",
                "Siren",
                "Stove"
            ],
            "_bridge": {
                "username": "0E:XX:XX:XX:XX:DD",
                "port": XXXXX
            },
            "platform": "HomeBridgeSmartThings"
        }

Screenshots: N/A

Environment:

iklein99 commented 1 year ago

It indicates that it is taking too long to get the response back from SmartThings. Could be a network issue, or you just may have too many devices. If you want me to look at the logs, I need the debug logs. Follow the link for instructions. Send the logs directly to me at iklein99@comcast.net.

Instructions for Producing a Detailed Log.pdf

MrCmonster commented 1 year ago

Thank you! I just sent the logs.

iklein99 commented 1 year ago

This issue seems to be that it is taking too long for you to get a response from SmartThings. I've seen two responses for two devices take 4 seconds to return responses from SmartThings. On top of that, every single device you have, the plugin requests updates, and you're also polling each devices every 5 seconds, making it worse. You have to look at why you are getting slow response from ST. I can't help you with that. The other thing you can try is using the webhook capability which eliminates the polling. You would get updates automatically when they occur. Not sure if this will fix your issue or not, but the service is free for the first 7 days.

iklein99 commented 1 year ago

One other thought here. There are 5 polling configuration settings. You can start by changing them all to zero which will result in no polling, and see you can at least get rid of the errors. Then you can add them back in, but make the numbers larger. They are the number of seconds between polling those types of devices. So, maybe make them all 30 or 40 to reduce the number of polling events. Let me know how that goes.

iklein99 commented 1 year ago

Closing due to lack of activity.