BLE Write to Switchbot Bot causes ESP32 reboot

I am a new Open MQTT Gateway user trying to control a Switchbot Bot (S1). I have tried from a MQTT client and I have tried from the OMG Console and the result is always a reboot and no action on the Switchbot Bot. Same result with the two payloads
{“SBS1”:“on”,“mac”:“D5:56:AB:66:30:A5”} and {“ble_write_address”:“D5:56:AB:66:30:A5”,“ble_write_service”:“cba20d00-224d-11e6-9fb8-0002a5d5c51b”,“ble_write_char”:“cba20002-224d-11e6-9fb8-0002a5d5c51b”,“ble_write_value”:“570101”,“value_type”:“HEX”,“ttl”:4,“immediate”:true}

v1.6.0 is installed on two different ESP32. One heltec and one dev board.

I have enabled logging verbose and nothing related to the commands appears on the OMG console.

From a Windows platform using .NET libraries I can send the 57 01 01 command with success. Using the Home Assistant integration I also have success so I know the hardware/network part of it is not the issue.

Also interesting is that OMG does not decode the Switchbot Bot, but it does decode the Switchbot Contact Sensor when sending the MQTT payloads.

BOT… home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 {“id”:“D5:56:AB:66:30:A5”,“rssi”:-53}

CONTACT… home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 {“id”:“FA:23:C8:AD:C5:20”,“rssi”:-64,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:20}

Hi @mcsSolutions

This is strange and looks like your Bot might be a newer model with/or a newer firmware which is not recognised by the Decoder.

Could you set Advertisement and advanced data to true and then give some MQTT messages from your Bot with the then included raw data?

Here is short log of the MQTT traffic with command send and OMG response. YOu can see there is no additional information from the Bot device.

2:41:34 PM Topic home/OMG_heltec_ble/commands/MQTTtoBT/config Payload {“pubadvdata”:true}
2:41:34 PM Topic home/OMG_heltec_ble/BTtoMQTT Payload {“bleconnect”:true,“interval”:100,“adaptivescan”:true,“intervalacts”:100,“intervalcnct”:3600000,“scanduration”:1000,“onlysensors”:false,“randommacs”:false,“hasspresence”:false,“presenceTopic”:“presence/”,“presenceUseBeaconUuid”:false,“minrssi”:-100,“extDecoderEnable”:false,“extDecoderTopic”:“undecoded”,“filterConnectable”:false,“pubadvdata”:true,“pubBeaconUuidForTopic”:false,“ignoreWBlist”:false,“presenceawaytimer”:120000,“movingtimer”:60000,“btqblck”:142,“btqsum”:17306,“btqsnd”:13424,“btqavg”:1.289184,“bletaskstack”:2136,“blecoretaskstack”:2780,“blestarts”:1}
2:41:34 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“rssi”:-56}
2:41:34 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a011effffc0”,“rssi”:-64,“servicedata”:“64001544011effffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:35 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a011effffc0”,“rssi”:-66,“servicedata”:“64001544011effffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:35 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-56,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:36 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a0120ffffc0”,“rssi”:-62,“servicedata”:“640015440120ffffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:36 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-55,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:37 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-56,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/B09122F762BF Payload {“id”:“B0:91:22:F7:62:BF”,“mac_type”:0,“adv_type”:2,“name”:“BlueCharm”,“rssi”:-60,“servicedata”:“00e900112233445566778899aabbccddeeff0000”,“servicedatauuid”:“0xfeaa”}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/797068F91393 Payload {“id”:“79:70:68:F9:13:93”,“mac_type”:1,“adv_type”:2,“rssi”:-84}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-60,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a0122ffffc0”,“rssi”:-66,“servicedata”:“640015440122ffffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:39 PM Topic home/OMG_heltec_ble/BTtoMQTT/B09122F762BF Payload {“id”:“B0:91:22:F7:62:BF”,“mac_type”:0,“adv_type”:2,“name”:“BlueCharm”,“rssi”:-60,“servicedata”:“00e900112233445566778899aabbccddeeff0000”,“servicedatauuid”:“0xfeaa”}
2:41:39 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-56,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:40 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a0123ffffc0”,“rssi”:-66,“servicedata”:“640015440123ffffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:40 PM Topic home/OMG_heltec_ble/BTtoMQTT/B09122F762BF Payload {“id”:“B0:91:22:F7:62:BF”,“mac_type”:0,“adv_type”:2,“name”:“BlueCharm”,“rssi”:-59,“servicedata”:“00e900112233445566778899aabbccddeeff0000”,“servicedatauuid”:“0xfeaa”}
2:41:40 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-61,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:41 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a0125ffffc0”,“rssi”:-65,“servicedata”:“640015440125ffffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:41 PM Topic home/OMG_heltec_ble/BTtoMQTT/DC0D30470209 Payload {“id”:“DC:0D:30:47:02:09”,“mac_type”:0,“adv_type”:0,“name”:“FSC_BP104”,“manufacturerdata”:“4c000215fda50693a4e24fb1afcfc6eb07647825275165c1fd”,“rssi”:-47,“servicedata”:“1b01ff02dc0d304702095b”,“servicedatauuid”:“0xfff0”,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“fda50693a4e24fb1afcfc6eb07647825”,“major”:10065,“minor”:26049,“txpower”:-3}
2:41:41 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a0125ffffc0”,“rssi”:-62,“servicedata”:“640015440125ffffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}
2:41:42 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {“id”:“D5:56:AB:66:30:A5”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909d556ab6630a5010c”,“rssi”:-61,“servicedata”:“48004700”,“servicedatauuid”:“0xfd3d”}
2:41:43 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {“id”:“FA:23:C8:AD:C5:20”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“6909fa23c8adc520b12a0126ffffc0”,“rssi”:-64,“servicedata”:“640015440126ffffc0”,“servicedatauuid”:“0xfd3d”,“brand”:“SwitchBot”,“model”:“Contact Sensor”,“model_id”:“W120150X”,“type”:“CTMO”,“acts”:true,“cont”:true,“contact”:“timeout not closed”,“movement”:false,“lightlevel”:“dark”,“scopetested”:false,“in_ct”:3,“out_ct”:0,“push_ct”:0,“batt”:21}

The Windows .NET scan and query resulted in the following for the Bot

d5:56:ab:66:30:a5 WoHand
Characteristics Count for service 1 00001800-0000-1000-8000-00805f9b34fb 3
ReadCharacteristic 1 for Service 1 characteristic 00002a00-0000-1000-8000-00805f9b34fb: 57-6F-48-61-6E-64 WoHand
WriteableCharacteristic 1 for Service 1 characteristic 00002a00-0000-1000-8000-00805f9b34fb
ReadCharacteristic 2 for Service 1 characteristic 00002a01-0000-1000-8000-00805f9b34fb: 00-00
ReadCharacteristic 3 for Service 1 characteristic 00002a04-0000-1000-8000-00805f9b34fb: 06-00-18-00-00-00-90-01 ? ? ??
Characteristics Count for service 2 00001801-0000-1000-8000-00805f9b34fb 0
Characteristics Count for service 3 0000fee7-0000-1000-8000-00805f9b34fb 3
WriteableCharacteristic 2 for Service 3 characteristic 0000fec7-0000-1000-8000-00805f9b34fb
ReadCharacteristic 3 for Service 3 characteristic 0000fec9-0000-1000-8000-00805f9b34fb: D5-56-AB-66-30-A5 ?V?f0?
Characteristics Count for service 4 cba20d00-224d-11e6-9fb8-0002a5d5c51b 2
NotifyCharacteristic 1 for Service 4 characteristic cba20003-224d-11e6-9fb8-0002a5d5c51b: FF ?
WriteableCharacteristic 2 for Service 4 characteristic cba20002-224d-11e6-9fb8-0002a5d5c51b

There is additional data, as you set Advertisement and advanced data to true.

I can see why the data isn’t currently decoded as for the Switchbot Contact Sensor - it seems to be an octet longer than previously encountered Bot data. I’'m currently on the road, so not that easy to address this without my proper IDE setup, but will look into it.

Your Bot is currently set to one state and it’s on, with a battery level of 71%, correct?

More importantly, it also shows that your Bot is "mac_type": 1 which is vital to include in the WRITE command …

So could you try the full WRITE command again including "mac_type": 1

The shortcut “SBS1”:“on” command failure is likely related to the decoding recognition failure.

I understand being away from the development environment. I did try the mac_type = 1 with same result of a restart of the ESP32 and no Bot activity.

3:43:45 PM Topic home/OMG_heltec_ble/commands/MQTTtoBT/config Payload {“mac_type”:1,“ble_write_address”:“D5:56:AB:66:30:A5”,“ble_write_service”:“cba20d00-224d-11e6-9fb8-0002a5d5c51b”,“ble_write_char”:“cba20002-224d-11e6-9fb8-0002a5d5c51b”,“ble_write_value”:“570101”,“value_type”:“HEX”,“ttl”:4,“immediate”:true}
3:43:58 PM Topic home/OMG_heltec_ble/LWT Payload offline

The firmware in the Bot is 6.4. On the Android Switchbot App, the battery level is 2/3. 71% is reasonable. The Bot was purchased about a year ago and to my knowledge there has been no firmware updates. The Contact sensor was purchased at the same time.

The decoding of the longer broadcast advertising data is already on the way, so that it will be decoded like your Contact Sensor.

If you could also can confirm the one state mode and its on state at the time of the broadcast.

With the write command causing a cash I’m currently unsure, but could you also post the write command with proper preformatted text formatting, just to see if there might not be some curly quote issue or such.

I do not know what you are explicitly asking about the on state. I did provide the .NET scan of the device which was its quiescent state. I also provided the explicit command sent via MQTT in my next-to-last response. When commanded ON it will move the arm and then restore the arm to rest position so the “move/on” state is temporary.

Everything you posted above is in normal text here, including the commands you tired. This turns all quotation marks into curly beginning and closing double quotes.Nice for running text, but makes it impossible to see if the JSON is all formatted correctly.

{“SBS1”:“on”,“mac”:“D5:56:AB:66:30:A5”}
vs.
{“SBS1”:“on”,“mac”:“D5:56:AB:66:30:A5”}
vs.
{"SBS1":"on","mac":"D5:56:AB:66:30:A5"}

Just copy and paste the text, select it all and use the Preformatted Text format button at the top of the entry field.

Someone else might need to have a look at the WRITE crash though - some serial monitoring might be required.


2:41:34 PM Topic home/OMG_heltec_ble/commands/MQTTtoBT/config Payload {"pubadvdata":true}
2:41:34 PM Topic home/OMG_heltec_ble/BTtoMQTT Payload {"bleconnect":true,"interval":100,"adaptivescan":true,"intervalacts":100,"intervalcnct":3600000,"scanduration":1000,"onlysensors":false,"randommacs":false,"hasspresence":false,"presenceTopic":"presence/","presenceUseBeaconUuid":false,"minrssi":-100,"extDecoderEnable":false,"extDecoderTopic":"undecoded","filterConnectable":false,"pubadvdata":true,"pubBeaconUuidForTopic":false,"ignoreWBlist":false,"presenceawaytimer":120000,"movingtimer":60000,"btqblck":142,"btqsum":17306,"btqsnd":13424,"btqavg":1.289184,"bletaskstack":2136,"blecoretaskstack":2780,"blestarts":1}
2:41:34 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","rssi":-56}
2:41:34 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a011effffc0","rssi":-64,"servicedata":"64001544011effffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:35 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a011effffc0","rssi":-66,"servicedata":"64001544011effffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:35 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-56,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:36 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a0120ffffc0","rssi":-62,"servicedata":"640015440120ffffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:36 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-55,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:37 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-56,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/B09122F762BF Payload {"id":"B0:91:22:F7:62:BF","mac_type":0,"adv_type":2,"name":"BlueCharm","rssi":-60,"servicedata":"00e900112233445566778899aabbccddeeff0000","servicedatauuid":"0xfeaa"}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/797068F91393 Payload {"id":"79:70:68:F9:13:93","mac_type":1,"adv_type":2,"rssi":-84}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-60,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:38 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a0122ffffc0","rssi":-66,"servicedata":"640015440122ffffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:39 PM Topic home/OMG_heltec_ble/BTtoMQTT/B09122F762BF Payload {"id":"B0:91:22:F7:62:BF","mac_type":0,"adv_type":2,"name":"BlueCharm","rssi":-60,"servicedata":"00e900112233445566778899aabbccddeeff0000","servicedatauuid":"0xfeaa"}
2:41:39 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-56,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:40 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a0123ffffc0","rssi":-66,"servicedata":"640015440123ffffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:40 PM Topic home/OMG_heltec_ble/BTtoMQTT/B09122F762BF Payload {"id":"B0:91:22:F7:62:BF","mac_type":0,"adv_type":2,"name":"BlueCharm","rssi":-59,"servicedata":"00e900112233445566778899aabbccddeeff0000","servicedatauuid":"0xfeaa"}
2:41:40 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-61,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:41 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a0125ffffc0","rssi":-65,"servicedata":"640015440125ffffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:41 PM Topic home/OMG_heltec_ble/BTtoMQTT/DC0D30470209 Payload {"id":"DC:0D:30:47:02:09","mac_type":0,"adv_type":0,"name":"FSC_BP104","manufacturerdata":"4c000215fda50693a4e24fb1afcfc6eb07647825275165c1fd","rssi":-47,"servicedata":"1b01ff02dc0d304702095b","servicedatauuid":"0xfff0","brand":"GENERIC","model":"iBeacon","model_id":"IBEACON","type":"BCON","mfid":"4c00","uuid":"fda50693a4e24fb1afcfc6eb07647825","major":10065,"minor":26049,"txpower":-3}
2:41:41 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a0125ffffc0","rssi":-62,"servicedata":"640015440125ffffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}
2:41:42 PM Topic home/OMG_heltec_ble/BTtoMQTT/D556AB6630A5 Payload {"id":"D5:56:AB:66:30:A5","mac_type":1,"adv_type":0,"manufacturerdata":"6909d556ab6630a5010c","rssi":-61,"servicedata":"48004700","servicedatauuid":"0xfd3d"}
2:41:43 PM Topic home/OMG_heltec_ble/BTtoMQTT/FA23C8ADC520 Payload {"id":"FA:23:C8:AD:C5:20","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa23c8adc520b12a0126ffffc0","rssi":-64,"servicedata":"640015440126ffffc0","servicedatauuid":"0xfd3d","brand":"SwitchBot","model":"Contact Sensor","model_id":"W120150X","type":"CTMO","acts":true,"cont":true,"contact":"timeout not closed","movement":false,"lightlevel":"dark","scopetested":false,"in_ct":3,"out_ct":0,"push_ct":0,"batt":21}

d5:56:ab:66:30:a5 WoHand
Characteristics Count for service 1 00001800-0000-1000-8000-00805f9b34fb 3
ReadCharacteristic 1 for Service 1 characteristic 00002a00-0000-1000-8000-00805f9b34fb: 57-6F-48-61-6E-64 WoHand
WriteableCharacteristic 1 for Service 1 characteristic 00002a00-0000-1000-8000-00805f9b34fb
ReadCharacteristic 2 for Service 1 characteristic 00002a01-0000-1000-8000-00805f9b34fb: 00-00
ReadCharacteristic 3 for Service 1 characteristic 00002a04-0000-1000-8000-00805f9b34fb: 06-00-18-00-00-00-90-01 ? ?   ??
Characteristics Count for service 2 00001801-0000-1000-8000-00805f9b34fb 0
Characteristics Count for service 3 0000fee7-0000-1000-8000-00805f9b34fb 3
WriteableCharacteristic 2 for Service 3 characteristic 0000fec7-0000-1000-8000-00805f9b34fb
ReadCharacteristic 3 for Service 3 characteristic 0000fec9-0000-1000-8000-00805f9b34fb: D5-56-AB-66-30-A5 ?V?f0?
Characteristics Count for service 4                    cba20d00-224d-11e6-9fb8-0002a5d5c51b 2
NotifyCharacteristic 1 for Service 4    characteristic cba20003-224d-11e6-9fb8-0002a5d5c51b: FF ?
WriteableCharacteristic 2 for Service 4 characteristic cba20002-224d-11e6-9fb8-0002a5d5c51b

The serial output during the period a write command was being sent with verbose logging is

06 1b 42 ca f5 aa 86 12 a0 e0 ca 4b c0 01 ff 96  ..BÊõª†. àÊKÀ.ÿ–
3b 00 0a fc 30 00 08 08 05 02 b5 98 23 01 22 34  ;..ü0.....µ˜#."4
fe 6e 00 09 1a 7c 9d a6 e0 11 d0 0b a4 68 64 15  þn...|¦à.Ð.¤hd.
09 fa 0c 06 ff 3c 9d 52 69 14 08 01 92 96 4a 0f  .ú..ÿ<Ri...’–J.
08 8d 9b ea ec af 52 81 0e d2 9b 01 2b 44 58 d2  .›êì¯R.Ò›.+DXÒ
a5 ae 45 b1 cc eb 4d 82 b5 55 e2 18 88 45 80 88  ¥®E±ÌëM‚µUâ.ˆE€ˆ
43 38 75 4b 02 c4 8c 19 66 42 1b fe f6 92 45 40  C8uK.ÄŒ.fB.þö’E@
08 ce 02 50 c0 16 a3 00 09 ff 36 7f 98 40 18 ee  .Î.PÀ.£..ÿ6˜@.î
ce 00 19 fe 16 93 00 0d 80 97 7d c4 14 20 f3 be  Î..þ.“..€—}Ä. ó¾
0e 53 f3 58 02 51 20 4d 48 62 27 00 00 f7 06 1b  .SóX.Q MHb'..÷..
09 a9 ab ff ea ff 10 22 05 81 06 fd 18 00 08 02  .©«ÿêÿ."..ý....
09 b6 4c 11 50 25 0f fe 9a 08 09 0d 8e cd ff 1a  .¶L.P%.þš...ŽÍÿ.
10 0b 11 16 69 a5 ae 44 b1 6c bd 28 24 19 2b fc  ....i¥®D±l½($.+ü
90 53 ce 88 0a 40 45 6d b0 94 05 1b 96 30 83 52  SΈ.@Em°”..–0ƒR
6b ca 16 97 40 00 ff ca 0f 00 14 00 7a 90 85 09  kÊ.—@.ÿÊ....z….
67 c0 60 06 30 fe 7c 0e 93 e6 ff 60 bd 5f 19 82  gÀ`.0þ|.“æÿ`½_.‚
e8 0a e0 00 0e d8 20 03 54 60 41 96 55 e3 84 be  è.à..Ø .T`A–Uㄾ
63 bf 49 35 9a 3b 93 e9 87 ea f2 43 6f 15 c8 0d  c¿I5š;“é‡êòCo.È.
9a f6 a6 ad c1 ac aa e8 e4 2e 20 d4 e9 5a 5a 4e  šö¦­Á¬ªèä. ÔéZZN
22 cd 06 1b 19 29 b1 f0 30 38 41 40 28 11 8e c9  "Í...)±ð08A@(.ŽÉ
80 0d 40 b1 73 e9 25 2a 9a 3b 93 b4 f2 fa 4c 87  €.@±sé%*š;“´òúL‡
bd 5e 8b b7 32 e6 ad a3 53 89 54 a1 c9 06 68 74  ½^‹·2æ­£S‰T¡É.ht
7b 04 16 80 ff a1 36 77 41 7f 51 00 23 61 00 15  {..€ÿ¡6wAQ.#a..
00 04 00 02 00 00 41 04 04 00 01 40 04 00 04 01  ......A....@....
10 02 01 00 09 00 00 08 01 00 01 80 15 08 00 41  ...........€...A
0c 19 48 31 c8 44 09 00 81 03 99 a8 51 e2        ..H1ÈD...™¨Qâ  
cf 07 21 c5 0c 3a 85 8a 58 08 ce 2a 20 83 40 41  Ï.!Å.:…ŠX.Î* ƒ@A
e8                                               è               
00 c4 03 f8 f0 73 a0 ee 41 d8                    .Ä.øðs îAØ      
1a f2 cb 68 01 5c a2 44 89 f3 46 23 e0 68 e0 13  .òËh.\¢D‰óF#àhà.
4c f0 8c 4a 31 b9 87 d1 9d 95 3a ae 4c 35 56 c9  LðŒJ1¹‡Ñ•:®L5VÉ
62 eb 78 61 fd 85                                bëxaý…          
dc 96 9b 10 1e 8c c4                             Ü–›..ŒÄ         
a0 ff                                             ÿ              
8e 90 5d b0 e3 2b 5e 03 2c e0 e3 a2 0f 16 9e 48  Ž]°ã+^.,àã¢..žH
9b 81 03 48 a1 05 20 01 20 80 53 00 7c           ›.H¡. . €S.|   
d4 24 f8 5e c0 1e c0 54 e4 00 41 c0 11 ff 02 fc  Ô$ø^À.ÀTä.AÀ.ÿ.ü
ce ff 94 4a 1d 58 ed 85 39 55 14 1c 13 54 90 00  Îÿ”J.Xí…9U...T.
50 66 00 bc 26 63 60 0e 80 00 08 fe ff 54 ee a4  Pf.¼&c`.€..þÿTî¤
b1 f9 3b 4b f0 f1 71 7c c3 5e 56 93 3e 69 f6 d6  ±ù;Kðñq|Ã^V“>iöÖ
ca 9e 6b 86 44 ad a6 ea fa 28 8a aa a5 53 99 cd  Êžk†D­¦êú(Šª¥S™Í
9b ff 8a ce 69 a8 09 84 fe                       ›ÿŠÎi¨.„þ       
14 f8 14 fc 00 01 fe                             .ø.ü..þ         
5a dc 60 32 8c fd b0 05 77 58 51 cf ff 73 d8 fe  ZÜ`2Œý°.wXQÏÿsØþ
cb d0 d4 18 40 81 a9 f1 14 c0 80 d0 4a 00 00 e9  ËÐÔ.@©ñ.À€ÐJ..é
54 82 04 a0 2c 09 8d 63 10 a1 24 ff 8a 36 04 81  T‚. ,.c.¡$ÿŠ6.
90                                                              
c4 cc                                            ÄÌ              

I just found out from a team mate with a SwitchBot Bot, that there is an issue with the WRITE command causing a crash.

It is being looked into.

I see V 1.7 is now available and I do not believe the WRITE command problem solution was part of it. I am new to Open MQTT gateway and can see it is an active project. What should my expectations be for problem resolution. I see in the release notes that there is a tracking number for changes. Is there a tracking number associated with this Switchbot problem? Is it something that I should have submitted formally so a tracking number is assigned?

There is no issue related to this open in github but we are aware of the problem.
We are going to improve the ble connections on the next release, we will keep you updated when we find what’s wrong with this control.

Is there any update?
I tried to control my switchbot as well - and omg crashed.

Btw: Are there any docs about how to control devices. Is sending {“SBS1”:“on”,“mac”:“D5:56:AB:66:30:A5”} even the correct approach?

Hello,

Missing one operational switchbot to solve this for the moment.

Fixed below: