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.

Hi any progress made? Just was thinking of this the other day sitting in front of my smoker.

Unfortunately no, I’ve not spent much time on this since I last posted. I still think either I’m not smart enough to figure out how to solve this, or ESPHome doesn’t yet support the Bluetooth features I need (or both).

@iridris any updates? I am looking into linking my Masterbuilt Smoker to Home Assistant with the new Bluetooth integration.

I think all the pieces and parts needed to make this work have been added to ESPHome now, but I haven’t set aside any time to dig back into this.

Any update. Just got my MB smoker running again and my first thought was HA. This is literally the only google result I get for getting the MB into HA.
Wondering if the new blue tooth incorporations in HA would help with the issues

Do you have a copy of the blog with the BLE info? It’s no longer available at that site. I am starting to play around with sniffing BLE protocol of MB smoker and this would be a big help.
Thanks,
Ed Akeyson

I found the GitHub from which the aforementioned app site was spawned

Did you get anywhere with this? as I can see the Smoker on my BLE Notifications from ESPHome, Sure would be nice to even just get the Temps out of it.

I have a gravity 560 and have made a little progress getting the smoker temp out of the ble data. Here’s my yaml so far:

ble_client:
  # string lights
  - mac_address: "90:00:00:39:39:31"
    id: my_ble_client
    # masterbuilt smoker
  - mac_address: "AC:67:B2:71:E4:36"
    id: smokerbt


sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Temperature
    id: smoker_min_left
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    unit_of_measurement: '°C'
    notify: true
    lambda: |-
        uint16_t value = (x[3] << 8) | x[4];
        if (value > 10 && value < 300){
          return value;
        } else {
          return {};
        }
    filters:
      - filter_out: 0.0
    device_class: "temperature"

I’m still in process of reverse engineering the rest of the data from the smoker. It looks like its sending 3 frames on the FFF4 characteristic uuid. Its slow going but hopefully I’ll figure out how to get the probe temperatures + time remaining shortly.

1 Like

UPDATE:
OCD ftw. Figured out how to read probe temperatures, and time remaining. :grinning:

ble_client:
  # - mac_address: "90:00:00:39:39:31"
  #   id: my_ble_client
  - mac_address: "AC:67:B2:71:E4:36"
    id: smokerbt


sensor:
  # - platform: ble_client
  #   type: characteristic
  #   ble_client_id: smokerbt
  #   name: fff4 packet
  #   id: fff4_packet
  #   service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
  #   characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
  #   notify: true
  #   lambda: |-
  #     // Assuming little-endian byte order
  #     std::vector<uint8_t> data = x;
  #     // Convert vector to a hexadecimal string
  #     String hex_string = "";
  #     for (size_t i = 0; i < x.size(); ++i) {
  #       char hex_buffer[3];
  #       snprintf(hex_buffer, sizeof(hex_buffer), "%02X", data[i]);
  #       hex_string += hex_buffer;
  #       if (i % 2 == 1 && i != data.size() - 1) {
  #         hex_string += " ";  // Insert a space every two bytes
  #       }
  #     }
  #     uint8_t arr_size = x.size();
  #     // Print the hexadecimal string to the log
  #     //if (arr_size > 20){
  #       ESP_LOGW("LOG_TAG", "FFF4 Hexadecimal string: %s", hex_string.c_str());
  #     //}

  #     return arr_size;

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Temperature
    id: smoker_temperature
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    unit_of_measurement: '°C'
    notify: true
    lambda: |-
          if (x[0] == 180){
            uint16_t value = (0x00 << 8) | x[4];
            return value;
          } else {
            return 0;
          }
    filters:
      - filter_out: 0.0
    device_class: "temperature"

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Temperature Target
    id: smoker_temperature_target
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    unit_of_measurement: '°C'
    notify: true
    lambda: |-
      // Assuming little-endian byte order
          if (x[0] == 180){
            uint16_t value = (x[9] << 8) | x[8];
            if (value < 400){
              return value;
            }
          }
          return 0;
    filters:
      - filter_out: 0.0
    device_class: "temperature"

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Minutes Remaining
    id: smoker_minutes_remaining
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true
    lambda: |-
      // Assuming little-endian byte order
           if (x[0] == 180){
            uint16_t value = (x[12] << 8) | x[11];
            return value;
          }
          return 0;
    filters:
      - filter_out: 0.0

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Minutes Set
    id: smoker_minutes_set
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true
    lambda: |-
      // Assuming little-endian byte order
          if (x[0] == 180){
            uint16_t value = (x[14] << 8) | x[13];
            return value;
          }
          return 0;
    filters:
      - filter_out: 0.0

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Probe 1 Temperature
    id: smoker_probe_one
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true
    unit_of_measurement: '°C'
    lambda: |-
          if (x[0] == 179){
            uint16_t value = (0x00 << 8) | x[2];
            return value;
          }
          return 0;
    filters:
      - filter_out: 0.0
    device_class: "temperature"

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Probe 2 Temperature
    id: smoker_probe_two
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true
    unit_of_measurement: '°C'
    lambda: |-
          if (x[0] == 179){
            uint16_t value = (0x00 << 8) | x[4];
            return value;
          }
          return 0;
    filters:
      - filter_out: 0.0
    device_class: "temperature"

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Probe 3 Temperature
    id: smoker_probe_three
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true
    unit_of_measurement: '°C'
    lambda: |-
          if (x[0] == 179){
            uint16_t value = (0x00 << 8) | x[6];
            return value;
          }
          return 0;
    filters:
      - filter_out: 0.0
    device_class: "temperature"

  - platform: ble_client
    type: characteristic
    ble_client_id: smokerbt
    name: Smoker Probe 4 Temperature
    id: smoker_probe_four
    service_uuid: 426f7567-6854-6563-2d57-65694c69fff0
    characteristic_uuid: 426f7567-6854-6563-2d57-65694c69fff4
    notify: true
    unit_of_measurement: '°C'
    lambda: |-
          if (x[0] == 179){
            uint16_t value = (0x00 << 8) | x[8];
            return value;
          }
          return 0;
    filters:
      - filter_out: 0.0
    device_class: "temperature"
4 Likes

This is some good work.

For a less seasoned home assistant user, Essentially am i finding the mac of my smoker then adding the rest direct into the yaml config?

I got a Bluetooth proxy on the go already.

EDIT: Added directly into my bluetooth proxy yaml however still not getting a value. Have tried doing them individually and also the older code but not gettting any values. Seems to connect(i think) but just getting this in my logs.

[11:11:18][D][esp32_ble_client:110]: [0] [10:52:1C:A7:05:3E] ESP_GATTC_NOTIFY_EVT
[11:11:18][D][ble_sensor:089]: [Smoker Temperature] ESP_GATTC_NOTIFY_EVT: handle=0x33, value=0xb5

I’m very keen on getting this working as the Masterbuilt app is awful! I’d love to get this into HA instead of stumping up cash for a fireboard or something similar.
Is anyone able to post the steps on how to get this working please?
Thanks

Edit: I already have ESPHome in place for bluetooth proxy

The newer systems are wifi or Bluetooth. The masterbuilt legacy app plain sucks. The new app is excellent and the Wi-Fi connect is excellent. Wish there was an integration. However, I still may go the fireboard route