custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.85k stars 239 forks source link

[New Sensor]: BBQ Probe #1349

Open alon24 opened 2 months ago

alon24 commented 2 months ago

Sensor Description

BBQ PROBE

Additional information

cheap BLE bbq probe esphome code to decode it

BLE advertisements

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: bbq_probe_92696
    name: "BBQ Probe 92696"
    notify: true
    accuracy_decimals: 0
    service_uuid: 'FB00'
    characteristic_uuid: 'FB02'
    icon: 'mdi:thermometer'
    unit_of_measurement: "°C"
    lambda: |-
      if (x.size() >= 4) {
        uint8_t byte3 = x[2];
        uint8_t byte4 = x[3];

        // Reverse the bytes
        uint16_t reversed_bytes = (byte4 << 8) | byte3;

        // Convert to decimal, subtract 400, divide by 10
        float result = (static_cast<float>(reversed_bytes) - 400.0) / 10.0;

        return result;
      } else {
        return 0;
      }

  - platform: ble_client
    type: characteristic
    ble_client_id: bbq_probe_16706
    name: "BBQ Probe 16706"
    notify: true
    accuracy_decimals: 0
    service_uuid: 'FB00'
    characteristic_uuid: 'FB02'
    icon: 'mdi:thermometer'
    unit_of_measurement: "°C"
    lambda: |-
      if (x.size() >= 4) {
        uint8_t byte3 = x[2];
        uint8_t byte4 = x[3];

        // Reverse the bytes
        uint16_t reversed_bytes = (byte4 << 8) | byte3;

        // Convert to decimal, subtract 400, divide by 10
        float result = (static_cast<float>(reversed_bytes) - 400.0) / 10.0;

        return result;
      } else {
        return 0;
      }

How can I use with Passive BLE Monitor integration when using esphome only (not the rpi 5 bt )??

BLE advertisements

2024-04-23 15:06:20.667 INFO (Thread-9) [custom_components.ble_monitor.ble_parser] Unknown advertisement received for mac: 2A:03:4E:CF:0F:38service data: []manufacturer specific data: []local name: BBQ ProbeE 92696UUID16: None,UUID128: None 2024-04-23 15:06:20.668 INFO (Thread-9) [custom_components.ble_monitor.ble_parser] Unknown advertisement received for mac: 2A:03:4E:CF:0F:38service data: []manufacturer specific data: [b'\t\xff\x038\x0f\xcfN\x03']local name: UUID16: 2584,UUID128: None 2024-04-23 15:07:54.942 INFO (MainThread) [custom_components.ble_monitor.ble_parser] Unknown advertisement received for mac: 2A:03:4E:CF:0F:38service data: []manufacturer specific data: [b'\t\xff\x038\x0f\xcfN\x03']local name: BBQ ProbeE 92696UUID16: 2584,UUID128: None

myhomeiot commented 2 months ago

@alon24 The example from ESPHome which uses ble_client not really helpful here because Passive BLE Monitor can't connect to device like ble_client and can only receive and parse BLE advertisements. What will be helpful for @Ernst79 it's a whole packed data from BBQ Probe which you can get from your ESPHome log, look for messages like below, just be sure that you grab messages from BBQ Probe in your case as I see from log it's 2A:03:4E:CF:0F:38 Also write temperature which you seen at the probe, this will helps to understand where it's located in advertisement message.

[06:06:47][D][ble_gateway:063]: [2A:03:4E:CF:0F:38] Packet 043E2D02010000BA....
Ernst79 commented 2 months ago

Also logging multiple log lines helps figuring out where we can find the actual temperature data, as I can than see what changes and what not

DigiH commented 2 months ago

Seems to be the same BBQ probe I reverse engineered almost two years ago ;)

https://github.com/theengs/decoder/discussions/149#discussioncomment-3174549

Due to the connection NOTIFY requirement this is not possible with ble-monitor, Theengs Decoder and the Theengs App, which all solely handle BLE advertising data decoding.