OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://openwonderlabs.github.io/homebridge-switchbot/
ISC License
244 stars 54 forks source link

Support Request: #931

Closed realpicard closed 8 months ago

realpicard commented 9 months ago

Describe Your Problem

Switchbot server stops responding because of too many daily requests.

Relevant log output

[09/02/2024, 19:10:02] [SwitchBot] Blind Tilt: MB1 Unknown statusCode: 500, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug
[09/02/2024, 19:10:02] [SwitchBot] Blind Tilt: MB1 Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug
[09/02/2024, 19:10:02] [SwitchBot] Blind Tilt: FR2 Unknown statusCode: 500, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug
[09/02/2024, 19:10:02] [SwitchBot] Blind Tilt: FR2 Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug
[SwitchBot] Requests reached the daily limit, statusCode: 190

Config for homebridge-switchbot

.
.
.
           "options": {
                "devices": [
                    {
                        "deviceId": "fae31454c325",
                        "configDeviceName": "KN1",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "C1AD487BB291",
                        "configDeviceName": "FR1",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "EDEF7496290F",
                        "configDeviceName": "FR2",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "CB2519D8D4C7",
                        "configDeviceName": "FR3",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "F18C577FE4B5",
                        "configDeviceName": "FR4",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "D26D27A8299B",
                        "configDeviceName": "FR5",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "C2BE046D57C9",
                        "configDeviceName": "MB1",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "D4F91D93322C",
                        "configDeviceName": "MB2",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    },
                    {
                        "deviceId": "F1044586BCE3",
                        "configDeviceName": "MB3",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up",
                            "set_minStep": 25,
                            "updateRate": 30
                        }
                    }
                ]
            },
            "platform": "SwitchBot"
        }
    ],
    "disabledPlugins": [
        "homebridge-ring",
        "homebridge-august-locks",
        "homebridge-meross",
        "homebridge-myq"
    ]
}

Screenshots

No response

Device & Model

Switchbot Tilt

Node.js Version

v18.17.1

NPM Version

IDK

Homebridge Version

1.7

Homebridge SwitchBot Plugin Version

v3.2.0

Homebridge Config UI X Plugin Version

No response

Operating System

Raspbian

realpicard commented 9 months ago

Hi! I hope someone can help. My homebridge server was running flawlessly for a long time, controlling a few Switchbot Tilts. Recently, it started breaching the limit of requests to the switchbot API. Best I can tell, it is because every 10 minutes it tries to get status of the blinds, but gets the following error: [09/02/2024, 19:00:02] [SwitchBot] Blind Tilt: KN1 Unknown statusCode: 500, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug [09/02/2024, 19:00:02] [SwitchBot] Blind Tilt: KN1 Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug I can't figure this one out. I would really appreciate it if Donavan or someone else could help, or point me in the right direction. Thank you!

donavanbecker commented 9 months ago

Looking at your config, it looks like you are using the updateRate and RefreshRate wrong. Looks like it is opposite of the design, so you are using the default refreshRate. Set a per device, refreshRate and remove the updateRate.

realpicard commented 9 months ago

I removed the updateRate (set it back to default), but my problem predates me messing with it. Here is what I am getting today: [10/02/2024, 21:10:25] [SwitchBot] Blind Tilt: FR1 Internal Server Error, An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500 [10/02/2024, 21:10:25] [SwitchBot] Blind Tilt: FR1 Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug [10/02/2024, 21:10:25] [SwitchBot] Blind Tilt: FR3 Internal Server Error, An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500 [10/02/2024, 21:10:25] [SwitchBot] Blind Tilt: FR3 Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug

realpicard commented 9 months ago

Here is my revised config:

"options": {
                "devices": [
                    {
                        "deviceId": "fae31454c325",
                        "configDeviceName": "KN1",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "C1AD487BB291",
                        "configDeviceName": "FR1",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "EDEF7496290F",
                        "configDeviceName": "FR2",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "CB2519D8D4C7",
                        "configDeviceName": "FR3",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "F18C577FE4B5",
                        "configDeviceName": "FR4",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "D26D27A8299B",
                        "configDeviceName": "FR5",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "C2BE046D57C9",
                        "configDeviceName": "MB1",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "D4F91D93322C",
                        "configDeviceName": "MB2",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    },
                    {
                        "deviceId": "F1044586BCE3",
                        "configDeviceName": "MB3",
                        "configDeviceType": "Blind Tilt",
                        "connectionType": "OpenAPI",
                        "blindTilt": {
                            "mode": "only_up"
                        }
                    }
                ],
                "pushRate": 5
            },
            "platform": "SwitchBot"
realpicard commented 9 months ago

I did update this plugin to 3.3.0 today

donavanbecker commented 9 months ago

@realpicard add refreshRate to each device. With them being window covers you really don't need to refresh as much.

image

Maybe set to 900? Would be ever 15 mins.

donavanbecker commented 9 months ago

Also remove the platform pushRate

realpicard commented 9 months ago

I don't see pushRate in the GUI, should I just remove it from the config text?

realpicard commented 9 months ago

Sorry, found it and removed.

realpicard commented 9 months ago

I just tried opening one of the blinds from the Accessories tab in HomeBridge, and it did open. But here is the log: [10/02/2024, 21:40:03] [SwitchBot] Blind Tilt: KN1 Internal Server Error, An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500 [10/02/2024, 21:40:03] [SwitchBot] Blind Tilt: KN1 Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug

donavanbecker commented 9 months ago

Retry re-generating your token/secret and put the new one in your config

github-actions[bot] commented 8 months ago

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.

github-actions[bot] commented 8 months ago

This issue has been closed as no further activity has occurred.