Thanks @febalci for providing the information, my Yeelight BLE Candela is a small different with yours, my service is ‘FE87’.
I’m using hombridge-mqttthing to send mqtt message to OMG:
{
"accessories": [{
"accessory": "mqttthing",
"type": "lightbulb-OnOff",
"name": "Yeelight烛光氛围灯",
"manufacturer": "Yeelight",
"serialNumber": "XXXXXXXXXXXX",
"model": "yeelight_ms",
"url": "mqtt://localhost:1883",
"username": "homebridge",
"password": "",
"topics": {
"setOn": {
"topic": "home/OpenMQTTGateway_ESP32_BLE/commands/MQTTtoBT/config",
"apply": "return JSON.stringify({ ble_write_address: 'XX:XX:XX:XX:XX:XX', ble_write_service: 'FE87', ble_write_char: 'AA7D3F34-2D4F-41E0-807F-52FBF8CF7443', ble_write_value: message ? '434001' : '434002', value_type: 'HEX', ttl: 1, immediate: true })"
},
"setBrightness": {
"topic": "home/OpenMQTTGateway_ESP32_BLE/commands/MQTTtoBT/config",
"apply": "return JSON.stringify({ ble_write_address: 'XX:XX:XX:XX:XX:XX', ble_write_service: 'FE87', ble_write_char: 'AA7D3F34-2D4F-41E0-807F-52FBF8CF7443', ble_write_value: (parseInt('434200', 16) + message).toString(16), value_type: 'HEX', ttl: 1, immediate: true })"
}
}
}]
}
It’s working with about 2 seconds latency, and the problem is, it’s not 100% success. Sometime will failed and OMG & Homebridge doesn’t know it is failed.
I tried change ttl to 5, not sure if it is useful.
And the latency, is there any solution to solve this? Can I make OMG to keep connection with the Yeelight Candela, but not with other sensors? Maybe keep connection can shorten the latency ?