devWaves / SwitchBot-MQTT-BLE-ESP32

Allows for multiple SwitchBot bots and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Temperature, Motion, Contact sensors
MIT License
531 stars 66 forks source link

Switchbot Bot connection problem #71

Closed alexanderroese closed 2 years ago

alexanderroese commented 2 years ago

Hi,

I have bought a Switchbot Bot. Via the APP I have read the Bluetooth MAC of the bot and entered it in the Arduino allBots list. Unfortunately I have the problem that in the HomeAssistant no entity is created for the bot.

/* Switchbot Bot Settings */ static std::map<std::string, std::string> allBots = { { "switchbotone", "dc:23:4d:7f:11:07" } };

I have already tested the following versions v6.10, v6.9 and v7.0-preRelease.

Is it necessary to bring the bot into a certain state so that the ESP32 can query data? With the setting printSerialOutputForDebugging = true I only get the following debug message Advertised Device found: Name: TY, Address: dc:23:4d:7f:11:07, manufacturer data: d007000300000100e7ec75105b8057aa19ee8cc9db80fbdf, serviceUUID: 0xa201 Service Data: UUID: 0xa201, Data:

I have used the following libraries

The connection to MQTT and HomeAssistant work, as I can see that it has created entries using the MQTT Explorer. In HomeAssistant it also created an entity when I set an entry for another sensor type. The only data created in MQTT by the Esp32 is the linkqualtity (rssi = -67) of the esp32, the lastwill status (lastwill = online) and the status of the esp32 itself which is set to scanning ({"status": "scanning"}).

I think it might be a problem from my side because my purchased version is not the original from switchbot and I think the protocol is different because he is from Luminea brand.

devWaves commented 2 years ago

ya you must have a different brand. This code only works with the SwitchBot brand

the advertisded data should look like this for a bot

Advertised Device found:
Name: , Address: xx:xx:xx:xx:xx:xx, manufacturer data: 5900xxxxxxxxxxxx, serviceUUID: cba20d00-224d-11e6-9fb8-0002a5d5c51b