-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Bot not able to send BLE commands #1073
Comments
Providing no config? Also you have this installed on portainer. My guess is that that could be causing the issues. |
Sorry, it didnt show up, here it is:
The error also occurs if I use the Plugin outside of docker. |
Does everything work fine with OpenAPI? |
Update your deviceId to |
Isnt OpenAPI exclusive to use with the Switchbot Bridge? I just got the bot. Changed deviceId but no difference. |
Yes you need a Hub to use bot with OpenAPI |
Have you installed all prerequisites of |
Yes I have, im trying also some scripts with noble with discovering bluetooth devices, and that seems to be working. |
directly from homebridge console:
|
But if I try this using node-switchbot:
i get
|
Please delete from this issue and open a new issue as this is for Curtains |
@donavanbecker using noble, i managed to send the trigger command to the bot, eventually this might help you with finding the error? i have tbh struggle to see through this project 😅
|
Thanks @DKhen! When I have time I will take a look. But if you want to open a PR to make it better, by all means. |
oh that was no critism for your project, its just my own stupidness lol :D i will give it a try, but im sure in mean time you already fixed it haha |
I wasn't taking it as critism. I self taught myself how to code.... so it probably could be better ha. |
Ah okay nice, in fact i develop with php, but I find it hardly to get into typescript especially with such huge projects |
@DKhen are you on the homebridge discord server? |
Not yet, you got a link somewhere? |
You can find it right here: |
Might be experiencing the same/a similar issue here:
Issue appearance in logs:
Config```json { "name": "SwitchBot", "credentials": { "token": "", "secret": "", "notice": "Keep your Token & Secret a secret!" }, "options": { "devices": [ { "configDeviceName": "Kitchen", "deviceId": "D93431303F45", "hide_device": false, "configDeviceType": "Bot", "connectionType": "BLE", "type": "switch", "mode": "switch", "allowPush": true, "doublePress": 1, "maxRetry": 3, "firmware": "6.6", "external": false } ], "BLE": true, "discoverBLE": true, "logging": "debug" }, "_bridge": { "username": "0E:37:A8:82:E2:AB", "port": 37394 }, "platform": "SwitchBot" } ``` Large logs snipped``` [12/15/2024, 9:39:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen Press Mode, On: false [12/15/2024, 9:39:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateHomeKitCharacteristics [12/15/2024, 9:39:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic BatteryLevel: 100 [12/15/2024, 9:39:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic StatusLowBattery: 0 [12/15/2024, 9:39:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic On: false [12/15/2024, 9:39:43 PM] [SwitchBot] [DEBUG] Bot: Kitchen value: false [12/15/2024, 9:39:43 PM] [SwitchBot] [DEBUG] Bot: Kitchen value: false [12/15/2024, 9:39:43 PM] [SwitchBot] [DEBUG] Bot: Kitchen value: false [12/15/2024, 9:39:44 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEpushChanges [12/15/2024, 9:39:44 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEpushChanges On: false OnCached: false [12/15/2024, 9:39:44 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:39:44 PM] [SwitchBot] [DEBUG] Bot: Kitchen Bot Mode: switch [12/15/2024, 9:39:44 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] Bot: Kitchen value: true [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEpushChanges [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEpushChanges On: true OnCached: false [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] Bot: Kitchen Bot Mode: switch [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:39:48 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:39:49 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:39:49 PM] [SwitchBot] No devices found during discovery. [12/15/2024, 9:39:49 PM] [SwitchBot] Bot: Kitchen failed BLEpushChanges with BLE Connection, Error Message: "No devices found during discovery." [12/15/2024, 9:39:53 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:39:53 PM] [SwitchBot] No devices found during discovery. [12/15/2024, 9:39:53 PM] [SwitchBot] Bot: Kitchen failed BLEpushChanges with BLE Connection, Error Message: "No devices found during discovery." [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLERefreshStatus [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] Bot: Kitchen 'node-switchbot' found: [object Object] [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] Bot: Kitchen Scanning for WoHand devices... [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] Started Scanning for SwitchBot BLE devices. [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:39:59 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:40:00 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:40:02 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLERefreshStatus [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] Bot: Kitchen 'node-switchbot' found: [object Object] [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] Bot: Kitchen Scanning for WoHand devices... [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] Started Scanning for SwitchBot BLE devices. [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:40:03 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEparseStatus [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, switch) [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen Press Mode, On: false [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateHomeKitCharacteristics [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic BatteryLevel: 100 [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic StatusLowBattery: 0 [12/15/2024, 9:40:04 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic On: false [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEparseStatus [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, switch) [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen Press Mode, On: false [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateHomeKitCharacteristics [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic BatteryLevel: 100 [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic StatusLowBattery: 0 [12/15/2024, 9:40:08 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic On: false [12/15/2024, 9:44:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLERefreshStatus [12/15/2024, 9:44:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen 'node-switchbot' found: [object Object] [12/15/2024, 9:44:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:44:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen Scanning for WoHand devices... [12/15/2024, 9:44:32 PM] [SwitchBot] [DEBUG] Started Scanning for SwitchBot BLE devices. [12/15/2024, 9:44:32 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:44:33 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:44:33 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:44:34 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:44:34 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:44:35 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:44:36 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEparseStatus [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, switch) [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen Press Mode, On: false [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateHomeKitCharacteristics [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic BatteryLevel: 100 [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic StatusLowBattery: 0 [12/15/2024, 9:44:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic On: false [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLERefreshStatus [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen 'node-switchbot' found: [object Object] [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen Scanning for WoHand devices... [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] Started Scanning for SwitchBot BLE devices. [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:49:32 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:49:33 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:49:33 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:49:33 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:49:34 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:49:35 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:49:35 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:49:36 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:49:36 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEparseStatus [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, switch) [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen Press Mode, On: false [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateHomeKitCharacteristics [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic BatteryLevel: 100 [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic StatusLowBattery: 0 [12/15/2024, 9:49:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic On: false [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLERefreshStatus [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen 'node-switchbot' found: [object Object] [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen bleMac: d9:34:31:30:3f:45 [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] Bot: Kitchen Scanning for WoHand devices... [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] Started Scanning for SwitchBot BLE devices. [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:54:32 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:54:33 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:54:33 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:54:33 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:54:34 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:54:34 PM] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available! [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] [parseServiceData] Buffer length 4 !== 3! [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Stopped Scanning for SwitchBot BLE devices. [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen BLEparseStatus [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen (power, battery, deviceMode) = BLE:(undefined, undefined, undefined), current:(false, 100, switch) [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen Press Mode, On: false [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateHomeKitCharacteristics [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic BatteryLevel: 100 [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic StatusLowBattery: 0 [12/15/2024, 9:54:37 PM] [SwitchBot] [DEBUG] Bot: Kitchen updateCharacteristic On: false ``` Trying manually to find the device with
But, via the node-switchbot lib itself, it seems to timeout:
If this seems like a separate issue LMK, happy to make a separate issue :) |
Describe the Bug
ive just installed Version 4.0.0, set up the bot from scratch but still receiving the Same error as in the old Issue.
Bot: Swotchbot failed BLEpushChanges with
BLE Connection, Error Message: "Cannot read properties of undefined (reading 'press') "
To Reproduce
Expected Behavior
properties can be read and makes a press
Relevant Log Output
Config for homebridge-switchbot
Screenshots
No response
Device and Model
Switchbot Bot with Firmware v6.6
Node.js Version
v20.10.0
NPM Version
10.2.3
Homebridge Version
v1.8.4
Homebridge Switchbot Plugin Version
v4.0.0
Homebridge Config UI X Plugin Version
v4.58.0
Operating System
Raspian / Portainer / homebridge Image
The text was updated successfully, but these errors were encountered: