OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://www.switch-bot.com/
ISC License
229 stars 47 forks source link

Bug: statusCode: 500 error when trying to control SwitchBot #953

Closed epheterson closed 2 months ago

epheterson commented 3 months ago

Describe the Bug

I'm bridging in two SwitchBots via one hub, they show up fine in SwitchBot config in homebridge and sometimes work fine, but recently have started failing a lot.

The logs show an internal server error 500

To Reproduce

Setup SwitchBot hub and bot, add to homebridge, use from time to time.

Expected Behavior

SwitchBot hub / bots should always connect and work when controlled. Instead they return 500 error and don't always work.

Relevant Log Output

[3/12/2024, 7:42:56 AM] [SwitchBot] Bot: TV Mount Down Set On: true
[3/12/2024, 9:35:17 AM] [SwitchBot] Bot: TV Mount Down Internal Server Error,   An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500
[3/12/2024, 9:35:17 AM] [SwitchBot] Bot: TV Mount Down Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug
[3/12/2024, 9:59:17 AM] [SwitchBot] Bot: TV Mount Up Internal Server Error,     An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500
[3/12/2024, 9:59:17 AM] [SwitchBot] Bot: TV Mount Up Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug
[3/12/2024, 10:39:17 AM] [SwitchBot] Bot: TV Mount Down Internal Server Error,  An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500
[3/12/2024, 10:39:17 AM] [SwitchBot] Bot: TV Mount Down Unknown statusCode: undefined, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug

Config for homebridge-switchbot

{
    "name": "SwitchBot",
    "credentials": {
        "token": XX",
        "secret": "XX",
        "notice": "Keep your Token & Secret a secret!"
    },
    "options": {
        "devices": [
            {
                "deviceId": "XX",
                "configDeviceName": "TV Mount Up",
                "configDeviceType": "Bot",
                "connectionType": "OpenAPI",
                "bot": {
                    "mode": "press",
                    "deviceType": "switch",
                    "doublePress": 1
                }
            },
            {
                "deviceId": "XX",
                "configDeviceName": "TV Mount Down",
                "configDeviceType": "Bot",
                "connectionType": "OpenAPI",
                "bot": {
                    "mode": "press",
                    "deviceType": "switch",
                    "doublePress": 1
                }
            }
        ],
        "logging": "standard"
    },
    "platform": "SwitchBot"
}

Screenshots

No response

Device and Model

Hub Mini + Bot

Node.js Version

20.11.1

NPM Version

Needed?

Homebridge Version

1.7.0

Homebridge Switchbot Plugin Version

3.4.0

Homebridge Config UI X Plugin Version

No response

Operating System

macOS

Boscosticks commented 3 months ago

The same issue exists when using SwitchBot hubs (mini and hub 2) to control HVAC units via IR.

This error occurs when attempting to run automations via HK—the automation/scene runs within HK, but the HVAC units never turn on. From here, I have to toggle the scene off and on for the HVACs to kick on.

The same issue occurs when running automations to turn the HVAC units off.

github-actions[bot] commented 2 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 2 months ago

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