Open doddyth opened 1 month ago
Hi, thanks for replying.
Sadly, it is still happening on 3.6.1.beta-2.
Here is the log:
7/13/2024, 1:50:11 PM] [SwitchBot] Launched child bridge with PID 153510
[7/13/2024, 1:50:11 PM] The plugin "homebridge-switchbot" requires a Homebridge version of ^1.8.4-beta.21 which does not satisfy the current Homebridge version of 1.8.3. You may need to update this plugin (or Homebridge) to a newer version. You may face unexpected issues or stability problems running this plugin.
[7/13/2024, 1:50:16 PM] Registering platform '@switchbot/homebridge-switchbot.SwitchBot'
[7/13/2024, 1:50:16 PM] [SwitchBot] Loaded @switchbot/homebridge-switchbot v3.6.1-beta.2 child bridge successfully
[7/13/2024, 1:50:16 PM] Loaded 1 cached accessories from cachedAccessories.0E963EB46158.
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Using Config Logging: debug
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Plugin Version: 3.6.1-beta.2
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Finished initializing platform: SwitchBot
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Verifying Config
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Platform Config: {"logging":"debug"}
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Config OK
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Platform BLE is not enabled
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Loading accessory from cache: Main bedroom air purifier
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Executed didFinishLaunching callback
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Retry Count: 0
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Using Default Refresh Rate (2 minutes).
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Using Default Push Rate.
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Using Default Max Retries.
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Using Default Delay Between Retries.
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Max Retries: 3
[7/13/2024, 1:50:16 PM] [SwitchBot] [DEBUG] Delay Between Retries: 3000
[7/13/2024, 1:50:16 PM] Homebridge v1.8.3 (HAP v0.12.2) (SwitchBot) is running on port 54502.
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] statusCode: 200
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] devicesAPI: {"statusCode":100,"body":{"deviceList":[{"deviceId":"C53635302723","deviceName":"Main bedroom air purifier","deviceType":"Bot","enableCloudService":false,"hubDeviceId":"000000000000"}],"infraredRemoteList":[]},"message":"success"}
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] devicesAPI Body: {"deviceList":[{"deviceId":"C53635302723","deviceName":"Main bedroom air purifier","deviceType":"Bot","enableCloudService":false,"hubDeviceId":"000000000000"}],"infraredRemoteList":[]}
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] devicesAPI StatusCode: 100
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] statusCode: 200 & devicesAPI StatusCode: 100
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] DeviceLists: [{"deviceId":"C53635302723","deviceName":"Main bedroom air purifier","deviceType":"Bot","enableCloudService":false,"hubDeviceId":"000000000000"}]
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] DeviceLists Length: 1
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] SwitchBot Device Config Set: [{"deviceId":"C5:36:35:30:27:23","configDeviceName":"Main bedroom air purifier","configDeviceType":"Bot","connectionType":"BLE","bot":{"mode":"switch","deviceType":"switch"},"logging":"debug"}]
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] SwitchBot Devices: [{"deviceId":"C53635302723","configDeviceName":"Main bedroom air purifier","configDeviceType":"Bot","connectionType":"BLE","bot":{"mode":"switch","deviceType":"switch"},"logging":"debug","deviceName":"Main bedroom air purifier","deviceType":"Bot","enableCloudService":false,"hubDeviceId":"000000000000"}]
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Discovered Bot: C53635302723
[7/13/2024, 1:50:18 PM] [SwitchBot] Total SwitchBot Devices Found: 1
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] IR Device Config Not Set: undefined
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Total IR Devices Found: 0
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Device: Main bedroom air purifier registerDevice: true
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Device: Main bedroom air purifier connectionType: BLE, will display in HomeKit
[7/13/2024, 1:50:18 PM] [SwitchBot] Restoring existing accessory from cache: Main bedroom air purifier deviceId: C53635302723
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Device Config Logging: debug
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Platform Config refreshRate: 120, Default updateRate: 5, Platform Config pushRate: 0.1
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Default Max Retries: 5, Default Delay Between Retries: 3000
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Config: {"logging":"debug","connectionType":"BLE","mode":"switch","deviceType":"switch"}
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Model: SwitchBot S1, BLE Model: H, BLE Model Name: WoHand, BLE Model Friendly Name: Bot
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Default scanDuration: 5
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Default MQTT URL: , Default mqttOptions: {}, Default mqttPubOptions: {}
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Displaying as Switch
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Device Type: switch, from Accessory Cache.
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Fan Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Lock Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Door Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Faucet Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Outlet Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Window Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Garage Door Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Window Covering Service
[7/13/2024, 1:50:18 PM] [SwitchBot] Bot: Main bedroom air purifier Removing any leftover Stateful Programmable Switch Service
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Retrieve initial values and update Homekit
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BLERefreshStatus
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Registering Webhook Event Handler
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier is not listening webhook.
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot uuid: C53635302723-Bot, (fe7993b8-de39-40cb-a39c-66a5309e661e)
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Firmware Version: 3.6.1
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier version: 3.6.1
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier is using Device BLE Scanning.
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Bot Mode: switch, from Accessory Cache.
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Double Press: 1, from Accessory Cache.
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Using Push Rate Press: 15, from Accessory Cache.
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier No Allow Push Set, Using default Allow Push: false
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Multi Press Count: 0
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier 'node-switchbot' found: [object Object]
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BLE Address: c5:36:35:30:27:23
[7/13/2024, 1:50:18 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Scanning for WoHand devices...
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BLEparseStatus
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, switch)
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Press Mode, On: false
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BatteryLevel: undefined
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier StatusLowBattery: 0
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier updateHomeKitCharacteristics
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BatteryLevel: undefined
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier updateCharacteristic StatusLowBattery: 0
[7/13/2024, 1:50:23 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier updateCharacteristic On: false
[7/13/2024, 1:50:39 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Set On: true
[7/13/2024, 1:50:39 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BLEpushChanges
[7/13/2024, 1:50:39 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BLEpushChanges On: true OnCached: false
[7/13/2024, 1:50:39 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier 'node-switchbot' found: [object Object]
[7/13/2024, 1:50:39 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier BLE Address: c5:36:35:30:27:23
[7/13/2024, 1:50:39 PM] [SwitchBot] [DEBUG] Bot: Main bedroom air purifier Bot Mode: switch
[7/13/2024, 1:50:44 PM] [SwitchBot] Bot: Main bedroom air purifier On: true
[7/13/2024, 1:50:44 PM] [SwitchBot] Bot: Main bedroom air purifier Retrying
[7/13/2024, 1:50:45 PM] [SwitchBot] Bot: Main bedroom air purifier Retrying
[7/13/2024, 1:50:46 PM] [SwitchBot] Bot: Main bedroom air purifier Retrying
[7/13/2024, 1:50:44 PM] [SwitchBot] Bot: Main bedroom air purifier TypeError: Cannot read properties of undefined (reading 'turnOn')
[7/13/2024, 1:50:45 PM] [SwitchBot] Bot: Main bedroom air purifier TypeError: Cannot read properties of undefined (reading 'turnOn')
[7/13/2024, 1:50:46 PM] [SwitchBot] Bot: Main bedroom air purifier TypeError: Cannot read properties of undefined (reading 'turnOn')
[7/13/2024, 1:50:47 PM] [SwitchBot] Bot: Main bedroom air purifier TypeError: Cannot read properties of undefined (reading 'turnOn')
[7/13/2024, 1:50:47 PM] [SwitchBot] Bot: Main bedroom air purifier Retrying
[7/13/2024, 1:50:48 PM] [SwitchBot] Bot: Main bedroom air purifier TypeError: Cannot read properties of undefined (reading 'turnOn')
[7/13/2024, 1:50:48 PM] [SwitchBot] Bot: Main bedroom air purifier Retrying
[7/13/2024, 1:50:49 PM] [SwitchBot] Bot: Main bedroom air purifier failed BLEpushChanges with BLE Connection, Error Message: "Cannot read properties of undefined (reading 'turnOn')"
Here is the config, incase it's needed:
"devices": [
{
"deviceId": "C5:36:35:30:27:23",
"configDeviceName": "Main bedroom air purifier",
"configDeviceType": "Bot",
"connectionType": "BLE",
"bot": {
"mode": "switch",
"deviceType": "switch"
},
"logging": "debug"
}
],
I have a very similar issue which prevented me from testing #951.
Same issue for me, followed all prerequisites for BLE connection, Bot device MAC visible in BT scan, but not working with same errors as above.
Latest version of plugin 3.7.0, Bot FW version 6.6, HB running on RPI4 4GB with Raspbian GNU/Linux Buster (10), HB version [v1.6.1], Node JS [v18.18.0]. Plugin version 3.7.0 should cover this issue, but is not, it still persists. If I change Mode of device from Press to Switch, error message only changes with stating Press or Turn On. Tried to run plugin as Child bridge or normal plugin inside Homebridge instance, nothing has changed. Device is discovered without any problems, so I think it is not BT RPi issue.
@doddyth - have you been able to make it working? Or any advice from @donavanbecker ? Thanks!
UPDATE: Updated Node.JS to latest version v20.16.0 and Homebridge to latest version v1.8.4, reinstalled the plugin, but still same issue. Attaching screenshot with Debug on for that Bot device. This is my first Switchbot device.
Device details:
Plugin config:
{ "name": "SwitchBot", "credentials": { "token": "2e9a79a.....................", "secret": "925ac........................", "notice": "Keep your Token & Secret a secret!" }, "options": { "devices": [ { "deviceId": "C63430351E48", "configDeviceName": "OhrevTUV", "configDeviceType": "Bot", "connectionType": "BLE", "scanDuration": 2, "bot": { "mode": "press", "deviceType": "switch", "allowPush": false, "doublePress": 1 }, "maxRetry": 5, "firmware": "6.6" } ] }, "platform": "SwitchBot", "_bridge": { "username": "0E:29:E7:5B:6E:ED", "port": 33792 } }
Please try to fix this issue, I dont want to buy a bridge for only one device :-) I would rather donate that money to author of this perfect plugin.
Adding more Debug logs from start of plugin + pressing Switch button of Bot in Homekit:
[25/07/2024, 09:12:29] [SwitchBot] Total SwitchBot Devices Found: 1
[25/07/2024, 09:12:29] [SwitchBot] Restoring existing accessory from cache: OhrevTUV deviceId: C63430351E48
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Device Config Logging: debug
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Platform Config refreshRate: 120, Default updateRate: 5, Platform Config pushRate: 0.1
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Default Max Retries: 5, Default Delay Between Retries: 3000
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Model: SwitchBot S1, BLE Model: H, BLE Model Name: WoHand, BLE Model Friendly Name: Bot
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV scanDuration is less than updateRate, overriding scanDuration with updateRate
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Device Config scanDuration: 5
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Default MQTT URL: , Default mqttOptions: {}, Default mqttPubOptions: {}
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Displaying as Switch
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Fan Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Lock Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Door Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Faucet Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Outlet Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Window Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Garage Door Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Window Covering Service
[25/07/2024, 09:12:29] [SwitchBot] Bot: OhrevTUV Removing any leftover Stateful Programmable Switch Service
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Device Type: switch, from Accessory Cache.
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Bot Mode: press, from Accessory Cache.
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Double Press: 1, from Accessory Cache.
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Push Rate Press: 15, from Accessory Cache.
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV No Allow Push Set, Using default Allow Push: false
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Multi Press Count: 0
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Retrieve initial values and update Homekit
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV BLERefreshStatus
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Registering Webhook Event Handler
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV is not listening webhook.
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Config: {"logging":"debug","scanDuration":2,"maxRetry":5,"connectionType":"BLE","mode":"press","deviceType":"switch","allowPush":false,"doublePress":1}
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Firmware Version: 6.6
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV is using Device BLE Scanning.
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV version: 6.6
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[25/07/2024, 09:12:29] [SwitchBot] [DEBUG] Bot: OhrevTUV Scanning for WoHand devices...
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEparseStatus
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, press)
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV StatusLowBattery: 0
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV updateHomeKitCharacteristics
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic StatusLowBattery: 0
[25/07/2024, 09:12:34] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic On: false
[25/07/2024, 09:12:59] [SwitchBot] [DEBUG] Bot: OhrevTUV Set On: true
[25/07/2024, 09:12:59] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEpushChanges
[25/07/2024, 09:12:59] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEpushChanges On: true OnCached: false
[25/07/2024, 09:12:59] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[25/07/2024, 09:12:59] [SwitchBot] [DEBUG] Bot: OhrevTUV Bot Mode: press
[25/07/2024, 09:13:04] [SwitchBot] Bot: OhrevTUV On: true
[25/07/2024, 09:13:04] [SwitchBot] Bot: OhrevTUV failed BLEpushChanges with BLE Connection, Error Message: "Cannot read properties of undefined (reading 'press')"
[25/07/2024, 09:13:14] [SwitchBot] [DEBUG] Bot: OhrevTUV BLERefreshStatus
[25/07/2024, 09:13:14] [SwitchBot] [DEBUG] Bot: OhrevTUV is using Device BLE Scanning.
[25/07/2024, 09:13:14] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[25/07/2024, 09:13:14] [SwitchBot] [DEBUG] Bot: OhrevTUV Scanning for WoHand devices...
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEparseStatus
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, undefined, press)
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV StatusLowBattery: 0
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV updateHomeKitCharacteristics
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic StatusLowBattery: 0
[25/07/2024, 09:13:19] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic On: false
Seems to me that from this lines:
[25/07/2024, 09:16:34] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, undefined, press)
[25/07/2024, 09:16:34] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
It is getting "undefined" values when reading from device, so the mode is than "undefined" as well battery status and when pressing the button, it gives error because mode of device is "undefined". Hope this helps.
Based on this info it may be related to 6.6. FW of Bot, mayby they changed something in BT communication: Reddit Downgrading Switchbot FW
@donavanbecker - any update on this issue? Thanks! If I can help somehow, let me know.
Hi @Kositch , still no luck for me as well. My case is exactly the same as yours. I kinda give up with this plugin and just use the schedule feature from the app instead :/
Hi @Kositch , still no luck for me as well. My case is exactly the same as yours. I kinda give up with this plugin and just use the schedule feature from the app instead :/
Thanks for reply, hope author of this project will try to address this issue or at least give us some statement, what can be wrong. I think it has something to do with latest FW of Bot based on other discussions in other Bot integration projects. Sadly Bot FW cant be downgraded.
Can you try the latest beta:
Tried, same issue (device is visible by RPi BT with good signal to noise ration - Device C6:34:30:35:1E:48 RSSI: -70):
[28/07/2024, 19:49:40] [SwitchBot] Total SwitchBot Devices Found: 1
[28/07/2024, 19:49:40] [SwitchBot] Restoring existing accessory from cache: OhrevTUV deviceId: C63430351E48
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Device Config Logging: debug
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Platform Config refreshRate: 120, Default updateRate: 5, Platform Config pushRate: 0.1
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Default Max Retries: 5, Default Delay Between Retries: 3000
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Model: SwitchBot S1, BLE Model: H, BLE Model Name: WoHand, BLE Model Friendly Name: undefined
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Device Config scanDuration: 5
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Default MQTT URL: , Default mqttOptions: {}, Default mqttPubOptions: {}
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Displaying as Switch
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Retrieve initial values and update Homekit
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV BLERefreshStatus
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Registering Webhook Event Handler
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV is not listening webhook.
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Registering Platform BLE Event Handler
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV registerPlatformBLE
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV scanDuration is less than updateRate, overriding scanDuration with updateRate
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Fan Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Lock Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Door Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Faucet Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Outlet Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Window Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Garage Door Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Window Covering Service
[28/07/2024, 19:49:40] [SwitchBot] Bot: OhrevTUV Removing any leftover Stateful Programmable Switch Service
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Config: {"logging":"debug","scanDuration":1,"maxRetry":5,"connectionType":"BLE","mode":"only_up","deviceType":"switch","allowPush":false,"doublePress":1}
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Device Type: switch, from Accessory Cache.
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Firmware Version: 6.6
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV is not listening to Platform BLE
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV version: 6.6
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Bot Mode: press, from Accessory Cache.
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Double Press: 1, from Accessory Cache.
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Push Rate Press: 15, from Accessory Cache.
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV No Allow Push Set, Using default Allow Push: false
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Multi Press Count: 0
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[28/07/2024, 19:49:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Scanning for WoHand devices...
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEparseStatus
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, press)
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV StatusLowBattery: 0
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateHomeKitCharacteristics
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic StatusLowBattery: 0
[28/07/2024, 19:49:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic On: false
[28/07/2024, 19:50:25] [SwitchBot] [DEBUG] Bot: OhrevTUV Set On: true
[28/07/2024, 19:50:25] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEpushChanges
[28/07/2024, 19:50:25] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEpushChanges On: true OnCached: false
[28/07/2024, 19:50:25] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[28/07/2024, 19:50:25] [SwitchBot] [DEBUG] Bot: OhrevTUV Bot Mode: press
[28/07/2024, 19:50:30] [SwitchBot] Bot: OhrevTUV On: true
[28/07/2024, 19:50:30] [SwitchBot] Bot: OhrevTUV failed BLEpushChanges with BLE Connection, Error Message: "Cannot read properties of undefined (reading 'press')"
[28/07/2024, 19:50:40] [SwitchBot] [DEBUG] Bot: OhrevTUV BLERefreshStatus
[28/07/2024, 19:50:40] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[28/07/2024, 19:50:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Scanning for WoHand devices...
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEparseStatus
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, undefined, press)
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV StatusLowBattery: 0
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateHomeKitCharacteristics
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic StatusLowBattery: 0
[28/07/2024, 19:50:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic On: false
Tried to remove device, add it again, see logs:
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Firmware Version: 3.7.1
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV is not listening to Platform BLE
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV version: 3.7.1
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Bot Mode: press, from Accessory Cache.
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Double Press: 1, from Accessory Cache.
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Using Push Rate Press: 15, from Accessory Cache.
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV No Allow Push Set, Using default Allow Push: false
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Multi Press Count: 0
[28/07/2024, 20:01:40] [SwitchBot] [DEBUG] Bot: OhrevTUV Scanning for WoHand devices...
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEparseStatus
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, press)
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV StatusLowBattery: 0
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateHomeKitCharacteristics
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic StatusLowBattery: 0
[28/07/2024, 20:01:45] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic On: false
[28/07/2024, 20:02:51] [SwitchBot] [DEBUG] Bot: OhrevTUV Set On: true
[28/07/2024, 20:02:51] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEpushChanges
[28/07/2024, 20:02:51] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEpushChanges On: true OnCached: false
[28/07/2024, 20:02:51] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[28/07/2024, 20:02:51] [SwitchBot] [DEBUG] Bot: OhrevTUV Bot Mode: press
[28/07/2024, 20:02:55] [Netatmo] Loading new data from API for: weatherstation
[28/07/2024, 20:02:56] [SwitchBot] Bot: OhrevTUV On: true
[28/07/2024, 20:02:56] [SwitchBot] Bot: OhrevTUV failed BLEpushChanges with BLE Connection, Error Message: "Cannot read properties of undefined (reading 'press')"
[28/07/2024, 20:03:06] [SwitchBot] [DEBUG] Bot: OhrevTUV BLERefreshStatus
[28/07/2024, 20:03:06] [SwitchBot] [DEBUG] Bot: OhrevTUV BLE Address: c6:34:30:35:1e:48
[28/07/2024, 20:03:06] [SwitchBot] [DEBUG] Bot: OhrevTUV Scanning for WoHand devices...
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV BLEparseStatus
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, undefined, press)
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV Press Mode, On: false
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV StatusLowBattery: 0
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV updateHomeKitCharacteristics
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV BatteryLevel: undefined
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic StatusLowBattery: 0
[28/07/2024, 20:03:11] [SwitchBot] [DEBUG] Bot: OhrevTUV updateCharacteristic On: false
So, as I see it (having the bug as well) the actual problem lays in https://github.com/OpenWonderLabs/node-switchbot
I tested around with the homebridge-switchbot , and with the node-switchbot, which seems to be used in homebridge-switchbot. node-switchbot couldnt find the device as well, while @abandonware/noble (which is used for the BT) is able to find the device
So, as I see it (having the bug as well) the actual problem lays in https://github.com/OpenWonderLabs/node-switchbot
I tested around with the homebridge-switchbot , and with the node-switchbot, which seems to be used in homebridge-switchbot. node-switchbot couldnt find the device as well, while @abandonware/noble (which is used for the BT) is able to find the device
Thanks for investigating, I am glad, it is not a single issue of my installation. Hope it helps @donavanbecker to localize the isse, and I am ready to test next Beta.
Having the same issue with my newly purchased Bot.
@donavanbecker Hi, any update on this issue? Thank you!
No sorry, it is summer time and not at the computer that much right now. I would accept a PR if anyone does find the issue and resolves it.
No sorry, it is summer time and not at the computer that much right now. I would accept a PR if anyone does find the issue and resolves it.
Thanks for the update, I completely understand, lets hope someone more experience then regular user will dive into it or we will wait until you will have time... sometime :-) Enjoy your sumer.
Describe the Bug
I've integrated the version 3.6.0 of the plugin to my homebridge environment and my switchbot bot has been detected correctly in the plugin. But every time I try to trigger the press, whether from homekit or homebridge accessories page, it will always return error
Cannot read properties of undefined (reading 'turnOn')
.I've already tried upgrading the plugin to 3.6.1 beta version and it still happening. I've also tried to downgrade it to version 3.4.0, the bug is missing, but nothing happen on my bot.
To Reproduce
Expected Behavior
The bot should act correctly when pressed
Relevant Log Output
Config for homebridge-switchbot
Screenshots
No response
Device and Model
Switchbot bot S1
Node.js Version
v18.19.0
NPM Version
v9.2.0
Homebridge Version
v1.8.3
Homebridge Switchbot Plugin Version
v3.6.0
Homebridge Config UI X Plugin Version
v4.56.4
Operating System
Debian