Struggling to interact with Masterbuilt Smoker via Bluetooth

I have a bluetooth Masterbuilt Smoker that I’m trying to interact with. I can get an ESP32 to connect to it, but I’m really struggling to get any usable data out of the smoker. I haven’t even bothered attempting to control it yet, but I suspect once I figure out how to get the data, controlling it won’t be too much more of an issue.

The smoker uses Bluetooth Low Energy, and someone else on the internet has already done the heavy lifting of identifying what the various Service and Characteristic UUID’s are and what data they hold. So now I just have to adapt the ESP32 to that info.
Blog with the relevant BLE info: https://dev-clone.nuxtjs.app/mgolu/596996

I think it is just a matter of the right lambda’s, but I’m not a programmer and lambda’s are a real struggle for me. So far, this is what I have but the only data I ever get back is a big fat 0. Particularly, since the blog mentions that the relevant data is sent via notifications, I think I need to use the on_notify feature but even my most basic attempts at code in that fails to compile.

So far, the following code at least gets me a mostly stable connection, though I’ve not gotten any actual data out yet:

esp32_ble_tracker:

ble_client:
  - mac_address: BC:33:AC:52:98:AD
    id: smokerbt

sensor:
  - platform: ble_client
    ble_client_id: smokerbt
    name: Smoker Status
    id: smoker_status
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff3
    notify: true
    lambda: |-
      return (float)x[2];
  - platform: ble_client
    ble_client_id: smokerbt
    name: Smoker-Notify
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true

And here are the logs that are generated:

[20:17:38][C][esp32_ble_tracker:606]: BLE Tracker:
[20:17:38][C][esp32_ble_tracker:607]:   Scan Duration: 300 s
[20:17:38][C][esp32_ble_tracker:608]:   Scan Interval: 320.0 ms
[20:17:38][C][esp32_ble_tracker:609]:   Scan Window: 30.0 ms
[20:17:38][C][esp32_ble_tracker:610]:   Scan Type: ACTIVE
[20:17:38][C][ble_client:033]: BLE Client:
[20:17:38][C][ble_client:034]:   Address: bc:33:ac:52:98:ad
[20:17:38][C][ble_sensor:019]: BLE Sensor 'Smoker Status'
[20:17:38][C][ble_sensor:019]:   State Class: ''
[20:17:38][C][ble_sensor:019]:   Unit of Measurement: ''
[20:17:38][C][ble_sensor:019]:   Accuracy Decimals: 0
[20:17:38][C][ble_sensor:020]:   MAC address        : bc:33:ac:52:98:ad
[20:17:38][C][ble_sensor:021]:   Service UUID       : 426F7567685465-632D-5765-694C-69FFF0
[20:17:38][C][ble_sensor:022]:   Characteristic UUID: 426F7567685465-632D-5765-694C-69FFF3
[20:17:38][C][ble_sensor:023]:   Descriptor UUID    : 00000000000000-0000-0000-0000-000000
[20:17:38][C][ble_sensor:024]:   Notifications      : YES
[20:17:38][C][ble_sensor:025]:   Update Interval: 60.0s
[20:17:38][C][ble_sensor:019]: BLE Sensor 'Smoker-Notify'
[20:17:38][C][ble_sensor:019]:   State Class: ''
[20:17:38][C][ble_sensor:019]:   Unit of Measurement: ''
[20:17:38][C][ble_sensor:019]:   Accuracy Decimals: 0
[20:17:38][C][ble_sensor:020]:   MAC address        : bc:33:ac:52:98:ad
[20:17:38][C][ble_sensor:021]:   Service UUID       : 426F7567685465-632D-5765-694C-69FFF0
[20:17:39][C][ble_sensor:022]:   Characteristic UUID: 426F7567685465-632D-5765-694C-69FFF4
[20:17:39][C][ble_sensor:023]:   Descriptor UUID    : 00000000000000-0000-0000-0000-000000
[20:17:39][C][ble_sensor:024]:   Notifications      : YES
[20:17:39][C][ble_sensor:025]:   Update Interval: 60.0s
[20:18:21][D][sensor:117]: 'Smoker Status': Sending state 0.00000  with 0 decimals of accuracy
[20:18:31][W][ble_sensor:082]: Error reading char at handle 43, status=2
[20:18:31][W][ble_sensor:082]: Error reading char at handle 43, status=2
[20:35:03][I][ble_client:083]: Attempting BLE connection to bc:33:ac:52:98:ad
[20:35:04][I][ble_sensor:033]: [Smoker Status] Connected successfully!
[20:35:04][I][ble_sensor:033]: [Smoker-Notify] Connected successfully!
[20:35:05][I][ble_client:159]: Service UUID: 0x1801
[20:35:05][I][ble_client:160]:   start_handle: 0x1  end_handle: 0x4
[20:35:05][I][ble_client:339]:  characteristic 0x2A05, handle 0x3, properties 0x20
[20:35:05][I][ble_client:159]: Service UUID: 0x1800
[20:35:05][I][ble_client:160]:   start_handle: 0x5  end_handle: 0xf
[20:35:05][I][ble_client:339]:  characteristic 0x2A00, handle 0x7, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A01, handle 0x9, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A02, handle 0xb, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A03, handle 0xd, properties 0x8
[20:35:05][I][ble_client:339]:  characteristic 0x2A04, handle 0xf, properties 0x2
[20:35:05][I][ble_client:159]: Service UUID: 0x180A
[20:35:05][I][ble_client:160]:   start_handle: 0x10  end_handle: 0x22
[20:35:05][I][ble_client:339]:  characteristic 0x2A23, handle 0x12, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A24, handle 0x14, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A25, handle 0x16, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A26, handle 0x18, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A27, handle 0x1a, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A28, handle 0x1c, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A29, handle 0x1e, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A2A, handle 0x20, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 0x2A50, handle 0x22, properties 0x2
[20:35:05][I][ble_client:159]: Service UUID: 426F7567685465-632D-5765-694C-69FFF0
[20:35:05][I][ble_client:160]:   start_handle: 0x23  end_handle: 0x2c
[20:35:05][I][ble_client:339]:  characteristic 426F7567685465-632D-5765-694C-69FFF1, handle 0x25, properties 0xe
[20:35:05][I][ble_client:339]:  characteristic 426F7567685465-632D-5765-694C-69FFF2, handle 0x27, properties 0x2
[20:35:05][I][ble_client:339]:  characteristic 426F7567685465-632D-5765-694C-69FFF3, handle 0x29, properties 0xa
[20:35:05][I][ble_client:339]:  characteristic 426F7567685465-632D-5765-694C-69FFF4, handle 0x2b, properties 0x10
[20:35:05][I][ble_client:159]: Service UUID: 0x180F
[20:35:05][I][ble_client:160]:   start_handle: 0x2d  end_handle: 0xffff
[20:35:05][I][ble_client:339]:  characteristic 0x2A19, handle 0x2f, properties 0x12

Any help would be appreciated!

I think I’m running into 2 potential limitations, and may have to either wait until ESPHome implements a couple things, or go a different route and program this using the Arduino IDE or something.

The first issue is that it appears the Raw Data Parsing is only capable of interacting with single byte data, and I need it to interact with 2-byte data.

The second issue is that while Raw Data Parsing passes the BLE data to the lambda as std::vector<uint8_t>, the on_notify feature passes the BLE data as type float. This, in combination with the first issue, will prevent me from parsing data from the smoker (since the relevant data is sent via notifications).

All of this is pretty close to being over my head, so I could easily be wrong about this. I’m also not going to open a feature request for these issues, since I don’t feel I understand them well enough to properly articulate what is needed.