Bug: Bot Not Working Over BLE
Describe the Bug
The SwitchBot bot is not functioning correctly when sending commands over Bluetooth Low Energy (BLE). The bot does not change its execute push state, and there is no error message displayed.
To Reproduce
To reproduce this issue, follow these steps:
- Install the SwitchBot plugin and add a bot to your devices.
- Configure the bot to use BLE as the connection type.
- Send a command to the bot using the home app.
Expected Behavior
The expected behavior is that the bot should change its execute push state when receiving a command from the home app.
Relevant Log Output
The relevant log output is as follows:
[04/05/2025, 14:45:31] [SwitchBot] [DEBUG] Bot: Drucker address: d3:34:30:37:4b:09, model: H
[04/05/2025, 14:45:31] [SwitchBot] [DEBUG] Bot: Drucker serviceData: {"model":"H","modelName":"WoHand","modelFriendlyName":"Bot","mode":false,"state":false,"battery":100}
[04/05/2025, 14:45:31] [SwitchBot] [DEBUG] Bot: Drucker ad: {
"id": "d33430374b09",
"address": "d3:34:30:37:4b:09",
"rssi": -65,
"serviceData": {
"model": "H",
"modelName": "WoHand",
"modelFriendlyName": "Bot",
"mode": false,
"state": false,
"battery": 100
}
}
[04/05/2025, 14:45:31] [SwitchBot] [DEBUG] Bot: Drucker {
"id": "d33430374b09",
"address": "d3:34:30:37:4b:09",
"rssi": -65,
"serviceData": {
"model": "H",
"modelName": "WoHand",
"modelFriendlyName": "Bot",
"mode": false,
"state": false,
"battery": 100
}
}
...
Config for homebridge-switchbot
The configuration for the homebridge-switchbot plugin is as follows:
{
"name": "SwitchBot",
"credentials": {
"token": "XXXXXXXXXXX",
"secret": "XXXXXXXXXXX",
"notice": "Keep your Token & Secret a secret!"
},
"options": {
"devices": [
{
"configDeviceName": "Drucker",
"deviceId": "D33430374B09",
"configDeviceType": "Bot",
"connectionType": "BLE",
"disablePlatformBLE": false,
"scanDuration": 10,
"type": "switch",
"mode": "press",
"allowPush": false,
"doublePress": 1,
"pushRatePress": 1,
"disableCaching": false,
"external": false,
"logging": "debug"
}
],
"BLE": true,
"discoverBLE": true,
"logging": "standard"
},
"_bridge": {
"name": "SwitchBot 2A23",
"username": "0E:67:66:A1:1C:C4",
"port": 32711,
"env": {
"NODE_OPTIONS": "--force-node-api-uncaught-exceptions=true"
}
},
"platform": "SwitchBot"
}
Device and Model
The device and model of the bot are as follows:
- Device: Bot S1
- Model: H
Node.js Version
The version of Node.js is v22.15.0.
NPM Version
The version of NPM is v10.9.2.
Homebridge Version
The version of Homebridge is v1.9.0.
Homebridge Switchbot Plugin Version
The version of the Homebridge Switchbot plugin is v4.3.1.
Homebridge Config UI X Plugin Version
The version of the Homebridge Config UI X plugin is not specified.
Operating System
The operating system is Raspbian.
Possible Causes
The possible causes of this issue are:
- A bug in the SwitchBot plugin
- A problem with the BLE connection
- A configuration issue with the homebridge-switchbot plugin
Steps to Reproduce
To reproduce this issue, follow these steps:
- Install the SwitchBot plugin and add a bot to your devices.
- Configure the bot to use BLE as the connection type.
- Send a command to the bot using the home app.
Expected Behavior
The expected behavior is that the bot should change its execute push state when receiving a command from the home app.
Actual Behavior
The actual behavior is that the bot does not change its execute push state, and there is no error message displayed.
Debugging Steps
To debug this issue, follow these steps:
- Check the log output for any error messages.
- Verify that the BLE connection is established correctly.
- Check the configuration of the homebridge-switchbot plugin for any issues.
Possible Solutions
The possible solutions to this issue are:
- Update the SwitchBot plugin to the latest version
- Check and fix the BLE connection
- Check and fix the configuration of the homebridge-switchbot plugin
Conclusion
The SwitchBot bot is not functioning correctly when sending commands over BLE. The bot does not change its execute push state, and there is no error message displayed. The possible causes of this issue are a bug in the SwitchBot plugin, a problem with the BLE connection, or a configuration issue with the homebridge-switchbot plugin. To debug this issue, check the log output for any error messages, verify that the BLE connection is established correctly, and check the configuration of the homebridge-switchbot plugin for any issues. The possible solutions to this issue are to update the SwitchBot plugin to the latest version, check and fix the BLE connection, and check and fix the configuration of the homebridge-switchbot plugin.
Q&A: Bug: Bot not working over BLE
Q: What is the issue with the SwitchBot bot?
A: The SwitchBot bot is not functioning correctly when sending commands over Bluetooth Low Energy (BLE). The bot does not change its execute push state, and there is no error message displayed.
Q: What are the possible causes of this issue?
A: The possible causes of this issue are:
- A bug in the SwitchBot plugin
- A problem with the BLE connection
- A configuration issue with the homebridge-switchbot plugin
Q: How can I reproduce this issue?
A: To reproduce this issue, follow these steps:
- Install the SwitchBot plugin and add a bot to your devices.
- Configure the bot to use BLE as the connection type.
- Send a command to the bot using the home app.
Q: What is the expected behavior of the bot?
A: The expected behavior of the bot is that it should change its execute push state when receiving a command from the home app.
Q: What is the actual behavior of the bot?
A: The actual behavior of the bot is that it does not change its execute push state, and there is no error message displayed.
Q: How can I debug this issue?
A: To debug this issue, follow these steps:
- Check the log output for any error messages.
- Verify that the BLE connection is established correctly.
- Check the configuration of the homebridge-switchbot plugin for any issues.
Q: What are the possible solutions to this issue?
A: The possible solutions to this issue are:
- Update the SwitchBot plugin to the latest version
- Check and fix the BLE connection
- Check and fix the configuration of the homebridge-switchbot plugin
Q: Can I use the home app to troubleshoot this issue?
A: Yes, you can use the home app to troubleshoot this issue. Check the app's logs and settings to see if there are any error messages or configuration issues that may be causing the problem.
Q: Can I contact SwitchBot support for help with this issue?
A: Yes, you can contact SwitchBot support for help with this issue. They may be able to provide additional troubleshooting steps or resolve the issue for you.
Q: Is this issue specific to the SwitchBot bot or can it affect other devices?
A: This issue is specific to the SwitchBot bot and may not affect other devices. However, it's always a good idea to check the configuration and settings of other devices to ensure they are working correctly.
Q: Can I prevent this issue from happening in the future?
A: Yes, you can prevent this issue from happening in the future by:
- Regularly updating the SwitchBot plugin to the latest version
- Checking and fixing the BLE connection regularly
- Checking and fixing the configuration of the homebridge-switchbot plugin regularly
Q: Is there a workaround for this issue?
A: Yes, there is a workaround for this issue. You can try using a different connection type, such as Wi-Fi or Ethernet, to see if the issue is resolved. However, this may not be a permanent solution and may require further troubleshooting.