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
240 stars 51 forks source link

Support Request: Bot #1004

Closed Aladin2310 closed 1 week ago

Aladin2310 commented 1 month ago

Describe Your Problem

Bot does not act as a switch. It presses the button once, which is correct, but switches itself off again in Homebridge and Homekit.

Relevant log output

[12/07/2024, 13:28:40] Homebridge v1.8.3 (HAP v0.12.2) (Homebridge 32CD) is running on port 51528.
[12/07/2024, 13:28:47] [SwitchBot] Total SwitchBot Devices Found: 2
[12/07/2024, 13:28:47] [SwitchBot] Total IR Devices Found: 2
[12/07/2024, 13:28:47] [SwitchBot] Loading external accessory: TV deviceId: XXXXXXXXXX
[12/07/2024, 13:28:47] [SwitchBot] Loading external accessory: Lautsprecher deviceId: XXXXXXXXXX
[12/07/2024, 13:28:47] [SwitchBot] Restoring existing accessory from cache: PC deviceId: XXXXXXXXXX
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Device Config Logging: debug
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Platform Config refreshRate: 120, Default updateRate: 5, Platform Config pushRate: 0.1
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Default Max Retries: 5, Default Delay Between Retries: 3000
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Config: {"logging":"debug","connectionType":"OpenAPI","external":true,"mode":"switch","deviceType":"switch","allowPush":false,"doublePress":0}
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Model: SwitchBot S1, BLE Model: H, BLE Model Name: WoHand, BLE Model Friendly Name: Bot
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Default MQTT URL: , Default mqttOptions: {}, Default mqttPubOptions: {}
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Device Type: switch, from Accessory Cache.
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Displaying as Switch
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Fan Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Lock Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Door Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Faucet Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Outlet Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Window Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Garage Door Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Window Covering Service
[12/07/2024, 13:28:47] [SwitchBot] Bot: PC Removing any leftover Stateful Programmable Switch Service
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Retrieve initial values and update Homekit
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC openAPIRefreshStatus
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Registering Webhook Event Handler
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC is not listening webhook.
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 3.6.1
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC version: 3.6.1
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Bot Mode: switch, from Accessory Cache.
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Double Press: 1, from Accessory Cache.
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Using Push Rate Press: 15, from Accessory Cache.
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC No Allow Push Set, Using default Allow Push: false
[12/07/2024, 13:28:47] [SwitchBot] [DEBUG] Bot: PC Multi Press Count: 0
[12/07/2024, 13:28:49] TV 807A is running on port 33365.
[12/07/2024, 13:28:49] Please add [TV 807A] manually in Home app. Setup Code: XXXXXXXXXX
[12/07/2024, 13:28:49] Lautsprecher 2D9C is running on port 37529.
[12/07/2024, 13:28:49] Please add [Lautsprecher 2D9C] manually in Home app. Setup Code: XXXXXXXXXX
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC openAPIparseStatus
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC (power, battery, deviceMode) = API:(off, 95, switch), current:(false, 95, switch)
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC On: false
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC BatteryLevel: 95
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC StatusLowBattery: 0
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 4.8
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC version: 4.8
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: false
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[12/07/2024, 13:28:52] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[12/07/2024, 13:29:57] [SwitchBot] [DEBUG] Bot: PC Set ProgrammableSwitchOutputState: true
[12/07/2024, 13:29:57] [SwitchBot] [DEBUG] Bot: PC Set ProgrammableSwitchOutputState: true
[12/07/2024, 13:29:57] [SwitchBot] [DEBUG] Bot: PC openAPIpushChanges
[12/07/2024, 13:29:57] [SwitchBot] [DEBUG] Bot: PC Switch Mode, Turning true
[12/07/2024, 13:29:58] [SwitchBot] [DEBUG] Bot: PC Sending request to SwitchBot API, body: {"command":"turnOn","parameter":"default","commandType":"command"},
[12/07/2024, 13:30:00] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"items":[{"deviceID":"XXXXXXXXXX","code":100,"status":{"battery":95,"power":"on"},"message":"ok"}]},"message":"success"}
[12/07/2024, 13:30:00] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"items":[{"deviceID":"XXXXXXXXXX","code":100,"status":{"battery":95,"power":"on"},"message":"ok"}]},"message":"success"}
[12/07/2024, 13:30:00] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: true
[12/07/2024, 13:30:00] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[12/07/2024, 13:30:00] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[12/07/2024, 13:30:15] [SwitchBot] [DEBUG] Bot: PC openAPIRefreshStatus
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC openAPIparseStatus
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC (power, battery, deviceMode) = API:(off, 95, switch), current:(true, 95, switch)
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC On: false
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC BatteryLevel: 95
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC StatusLowBattery: 0
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 4.8
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC version: 4.8
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: false
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[12/07/2024, 13:30:16] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[12/07/2024, 13:30:47] [SwitchBot] [DEBUG] Bot: PC openAPIRefreshStatus
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC openAPIparseStatus
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC (power, battery, deviceMode) = API:(off, 95, switch), current:(false, 95, switch)
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC On: false
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC BatteryLevel: 95
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC StatusLowBattery: 0
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 4.8
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC version: 4.8
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: false
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[12/07/2024, 13:30:49] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[12/07/2024, 13:32:47] [SwitchBot] [DEBUG] Bot: PC openAPIRefreshStatus
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"D91881B98A04","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC openAPIparseStatus
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC (power, battery, deviceMode) = API:(off, 95, switch), current:(false, 95, switch)
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC On: false
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC BatteryLevel: 95
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC StatusLowBattery: 0
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 4.8
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC version: 4.8
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: false
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[12/07/2024, 13:32:49] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0

### Config for homebridge-switchbot

```shell
"platforms": [
        {
            "name": "Config",
            "port": XXXX,
            "platform": "config"
        },
        {
            "name": "SwitchBot",
            "credentials": {
                "token": "XXXX",
                "secret": "XXXX",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "XXXX",
                        "configDeviceName": "PC",
                        "configDeviceType": "Bot",
                        "connectionType": "OpenAPI",
                        "bot": {
                            "mode": "switch",
                            "deviceType": "switch",
                            "allowPush": false,
                            "doublePress": 2
                        },
                        "external": false,
                        "logging": "debug"
                    }
                ]
            },
            "platform": "SwitchBot"
        }

Screenshots

No response

Device & Model

Bot S1

Node.js Version

v20.15.1

NPM Version

v10.7.0

Homebridge Version

v1.8.3

Homebridge SwitchBot Plugin Version

v3.6.1-beta

Homebridge Config UI X Plugin Version

v4.56.4

Operating System

Raspbian

donavanbecker commented 1 month ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

Aladin2310 commented 1 month ago

I just found v3.6.1-beta.15 to install but it still doesn´t work. Do you need any logs?

donavanbecker commented 1 month ago

Logs are always helpful. Especially debug.

Aladin2310 commented 1 month ago
Setup Payload:
X-HM://002528UVCDNIK
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ XXXXXXXXXX │     
    └────────────┘     

[15/07/2024, 12:16:59] Homebridge v1.8.4-beta.25 (HAP v0.12.2) (Homebridge 32CD) is running on port 51528.
[15/07/2024, 12:16:59] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[15/07/2024, 12:17:06] [SwitchBot] Total SwitchBot Devices Found: 2
[15/07/2024, 12:17:06] [SwitchBot] Total IR Devices Found: 2
[15/07/2024, 12:17:06] [SwitchBot] Loading external accessory: TV deviceId: XXXXXXXXXX
[15/07/2024, 12:17:06] [SwitchBot] Loading external accessory: Lautsprecher deviceId: XXXXXXXXXX
[15/07/2024, 12:17:06] [SwitchBot] Restoring existing accessory from cache: PC deviceId: XXXXXXXXXX
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Device Config Logging: debug
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Platform Config refreshRate: 120, Default updateRate: 5, Platform Config pushRate: 0.1
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Default Max Retries: 5, Default Delay Between Retries: 3000
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Config: {"logging":"debug","connectionType":"OpenAPI","mode":"press","deviceType":"switch","allowPush":true,"doublePress":2}
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Model: SwitchBot S1, BLE Model: H, BLE Model Name: WoHand, BLE Model Friendly Name: Bot
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Default MQTT URL: , Default mqttOptions: {}, Default mqttPubOptions: {}
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Device Type: switch, from Accessory Cache.
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Displaying as Switch
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Fan Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Lock Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Door Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Faucet Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Outlet Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Window Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Garage Door Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Window Covering Service
[15/07/2024, 12:17:06] [SwitchBot] Bot: PC Removing any leftover Stateful Programmable Switch Service
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Retrieve initial values and update Homekit
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC openAPIRefreshStatus
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Registering Webhook Event Handler
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC is not listening webhook.
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 3.6.1
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC version: 3.6.1
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Bot Mode: switch, from Accessory Cache.
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Double Press: 1, from Accessory Cache.
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Push Rate Press: 15, from Accessory Cache.
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Using Allow Push: false
[15/07/2024, 12:17:06] [SwitchBot] [DEBUG] Bot: PC Multi Press Count: 0
[15/07/2024, 12:17:08] TV 807A is running on port 37133.
[15/07/2024, 12:17:08] Please add [TV 807A] manually in Home app. Setup Code: XXXXXXXXXX
[15/07/2024, 12:17:08] Lautsprecher 2D9C is running on port 39479.
[15/07/2024, 12:17:08] Please add [Lautsprecher 2D9C] manually in Home app. Setup Code: XXXXXXXXXX
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"XXXXXXXXXX","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"XXXXXXXXXX","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC openAPIparseStatus
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC (power, battery, deviceMode) = API:(off, 95, switch), current:(false, 95, switch)
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC On: false
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC BatteryLevel: 95
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC StatusLowBattery: 0
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 4.8
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC version: 4.8
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC updateHomeKitCharacteristics
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[15/07/2024, 12:17:13] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: false
[15/07/2024, 12:17:27] [SwitchBot] [DEBUG] Bot: PC Set On: true
[15/07/2024, 12:17:27] [SwitchBot] [DEBUG] Bot: PC openAPIpushChanges
[15/07/2024, 12:17:27] [SwitchBot] [DEBUG] Bot: PC Switch Mode, Command: turnOn
[15/07/2024, 12:17:28] [SwitchBot] [DEBUG] Bot: PC Sending request to SwitchBot API, body: {"command":"turnOn","parameter":"default","commandType":"command"},
[15/07/2024, 12:17:29] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"items":[{"deviceID":"XXXXXXXXXX","code":100,"status":{"battery":95,"power":"on"},"message":"ok"}]},"message":"success"}
[15/07/2024, 12:17:29] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"items":[{"deviceID":"XXXXXXXXXX","code":100,"status":{"battery":95,"power":"on"},"message":"ok"}]},"message":"success"}
[15/07/2024, 12:17:29] [SwitchBot] [DEBUG] Bot: PC updateHomeKitCharacteristics
[15/07/2024, 12:17:29] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[15/07/2024, 12:17:29] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[15/07/2024, 12:17:29] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: true
[15/07/2024, 12:17:44] [SwitchBot] [DEBUG] Bot: PC openAPIRefreshStatus
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"XXXXXXXXXX","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"XXXXXXXXXX","deviceType":"Bot","hubDeviceId":"XXXXXXXXXX","version":"V4.8","power":"off","battery":95,"deviceMode":"pressMode"},"message":"success"}
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC openAPIparseStatus
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC (power, battery, deviceMode) = API:(off, 95, switch), current:(false, 95, switch)
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC On: false
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC BatteryLevel: 95
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC StatusLowBattery: 0
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC Firmware Version: 4.8
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC version: 4.8
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC updateHomeKitCharacteristics
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic BatteryLevel: 95
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic StatusLowBattery: 0
[15/07/2024, 12:17:46] [SwitchBot] [DEBUG] Bot: PC updateCharacteristic On: false
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "SwitchBot",
            "credentials": {
                "token": "XXXXXXXXXX",
                "secret": "XXXXXXXXXX",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "XXXXXXXXXX",
                        "configDeviceName": "PC",
                        "configDeviceType": "Bot",
                        "connectionType": "OpenAPI",
                        "bot": {
                            "mode": "press",
                            "deviceType": "switch",
                            "allowPush": true,
                            "doublePress": 2
                        },
                        "external": false,
                        "logging": "debug"
                    }
                ]
            },
            "platform": "SwitchBot"
        }
    ]
Aladin2310 commented 1 month ago

I have managed to install version 3.4.0 and the bot works there. When switching from off to on in Homebridge, the bot is pressed once and when switching from on to off, it is also pressed once. But somehow this doesn't work in the newer versions

donavanbecker commented 4 weeks ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

github-actions[bot] commented 1 week 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.