Inkbird BT thermometer iBBQ with ESP32

welcome. For notifications you need to make Notification automation (i’m using telegram bot for notifications).
as of dropouts try @AlfaElan solution, works pretty stable:

script:
  - id: timer
    mode: restart
    then:
      - delay: 120s
1 Like

Thank you. I still have null values, but it’s way much better. Thank you for your help.

I’ve modified the template code and moved it into template.yaml and input_number.yaml vs. all in configuration.yaml as it allows for reloading without a full reboot, so the syntax is a bit different, but this is how I’m handling unavailable. I still need to sort out when no sensor is connected to also trigger Unavailable. To use the below files, you will need to add the following to your configuration.yaml if it is not already in there.

template: !include template.yaml
input_number: !include input_number.yaml

I’m using custom:fold-entity-row to keep the card a bit cleaner (especially on mobile devices). This is also updated to handle the upcoming template not rendering without default values for int breaking change.


yaml code below:

template and input_number YAML files

template.yaml

sensor:
  - name: grill_alert_temp
    state: >
        {% if is_state('sensor.ibbq_temperature_probe_6', 'unavailable' )  %}
            NaN
        {% else %}
          {% if (states('sensor.ibbq_temperature_probe_6') | int(0)) 
          < (states('input_number.grill_alert_low') | int(0)) 
            or (states('sensor.ibbq_temperature_probe_6') | int(0))  
          > (states('input_number.grill_alert_high') | int(0)) %}
              Alert
          {% else %}
              Normal
          {% endif %}
        {% endif %}

  - name: target_alert_temp_probe_1
    state: >
        {% if is_state('sensor.ibbq_temperature_probe_1', 'unavailable' )  %}
            NaN
        {% else %}
          {% if (states('sensor.ibbq_temperature_probe_1') | int(0) ) >= 
            (states('input_number.grill_probe_1_target') | int(0) ) %}
              Alert
          {% else %}
              Normal
          {% endif %}
        {% endif %}

input_number.yaml

grill_alert_low:
    name: Grill Low Temp
    initial: 190
    min: 100
    max: 350
    step: 5

grill_alert_high:
    name: Grill High Temp
    initial: 325
    min: 100
    max: 350
    step: 5

grill_probe_1_target:
    name: Probe 1 Target Temp
    initial: 160
    min: 60
    max: 250
    step: 1

I’ve been setting this up along with some xiaomi temp/humidity sensors and I think the inkbird section might be “blocking” the xiaomi as they both use BLE.
Has anyone done something similar? It’s like if the inkbird is off then the Xiaomi stuff is fine, but if it is on then it takes over and only the inkbird stats will get sent.

I wondered if it’s because they both use the BLE tracker:

I combined this example with the one from VanFlipsen, I think I needed the mac address filter otherwise it would ignore the Xiaomi devices, does anyone know what the BLE tracker does if you have the mac filter but then something else advertises data?
thanks!

I suggest you install the Passive BLE Monitor custom integration. It supports both the iBBQ and your Xiaomi device (and a whole bunch of others):

It works fine for me with iBBQ, Xiaomi and Mi Flora devices simultaneously.

1 Like

thanks, does that need the home assistant server to have a BT dongle though? Or can I use the ESP32 as a relay still?

Passive BLE Monitor supports BLE Gateway from here: https://github.com/myhomeiot/esphome-components
That way you can use an ESP32 to relay BLE packets, and do not need a bluetooth device on your HASS server.

2 Likes

Thanks Anders, this is working great!

Was very happy to find this thread! Was using a solution found here which uses this, but this required me to use an MQTT server and using code which I did not fully grasp/had no real control over. So very happy to find proper esphome code!

With that said, I have been experimenting with the code a bit, got some node-red automations working to trigger notifications and such, but was a bit surprised about the somewhat erratic update intervals. Now I already read in this discussion that doing a proper login/connection would be the solution, so I was wondering if anybody already got this working.

I can get it to connect following the procedures described by esphome, but thats about where my handy work gets me. Some insights such as the UUIDs to query can be gained from the code mentioned earlier (this one), but how to translate that in working code is beyond me.

Anyone have more insights on this?

Just used this and it was so simple to setup, been looking for an easy way for ages. Thanks

Good evening, trying to replicate this setup with a Weber Connect Hub. I found the MAC address.
All I see now is the following :
[22:19:11][I][ble_adv:139]: address: 70:91:8F:21:34:15
[22:19:11][I][ble_adv:140]: name: Weber Connect Hub 9555
[22:19:11][I][ble_adv:141]: Advertised service UUIDs:
[22:19:11][I][ble_adv:144]: - 0xFD97
[22:19:11][I][ble_adv:147]: Advertised service data:

Ok after some reading I think I am on the right doc : ESP32 Bluetooth Low Energy Tracker Hub — ESPHome

Now just trying to make sense of all of this :stuck_out_tongue:

Not sure what Im doing wrong. I have this code updated with my mac_address and ble_client to pair automatically. But the temp probe0 and probe1 always says 0.00000. Cant get it to read the correct temps.

Can someone give me some assistance? Thank you.

esphome:
  name: electricsmoker
  on_boot:
    priority: -10
    then:
      - lambda: |-
          {
            id(ble_sensor_1).publish_state(false);
            id(ble_sensor_2).publish_state(false);        
          }

esp32:
  board: esp-wrover-kit
  framework:
    type: arduino
  

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "d81494f71266ca88bf31a80ae2dbe90b"

wifi:
  ssid: XXXXXX
  password: XXXXXXXXX

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-C5025C"
    password: "ruMTKeZOnf4X"

captive_portal:

script:
  - id: timer
    then:
      - delay: 60s
      - lambda: |-
          {
            id(ble_sensor_1).publish_state(false);
            id(ble_sensor_2).publish_state(false);        
          }
  
esp32_ble_tracker:
  on_ble_advertise:
    - mac_address: 73:7F:00:00:07:7F
      then:
        - script.stop: timer
        - lambda: |-
            if (x.get_name() != "xBBQ") return;
            
            ESP_LOGI("ble_adv", "New BLE device");
            ESP_LOGI("ble_adv", "  address: %s", x.address_str().c_str());
            ESP_LOGI("ble_adv", "  name: %s", x.get_name().c_str());
            ESP_LOGI("ble_adv", "  Advertised service UUIDs:");
            
            for (auto uuid : x.get_service_uuids()) {
              ESP_LOGI("ble_adv", "    - %s", uuid.to_string().c_str());
            }
            
            ESP_LOGI("ble_adv", "  Advertised service data:");
            
            for (auto data : x.get_service_datas()) {
              ESP_LOGI("ble_adv", "    - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
            }
            
            ESP_LOGI("ble_adv", "  Advertised manufacturer data:");
            
            for (auto data : x.get_manufacturer_datas()) {
              ESP_LOGI("ble_adv", "    - %s: (%s)", data.uuid.to_string().c_str(), hexencode(data.data).c_str());
              
              if (data.uuid.contains(0, 0)) {
    
                int probe0 = (data.data[9] << 8) + data.data[8];
                int probe1 = (data.data[11] << 8) + data.data[10];
                    
                ESP_LOGI("ble_data", "    - %f %f", probe0 / 10.0, probe1 / 10.0);
    
                if (probe0 < 60000) {
                  id(ble_sensor_1).publish_state(probe0 / 10.0);
                } else {
                  id(ble_sensor_1).publish_state(0);                
                }
    
                if (probe1 < 60000) {
                  id(ble_sensor_2).publish_state(probe1 / 10.0);
                } else {
                  id(ble_sensor_2).publish_state(0);                
                }
              }
            }
        - script.execute: timer

ble_client:
  - mac_address: 73:7F:00:00:07:7F
    id: xBBQ
    
sensor: 
  - platform: template
    name: "xBBQ Temperature Probe 1"
    id: ble_sensor_1
    unit_of_measurement: "°C"
    accuracy_decimals: 0
  - platform: template
    name: "xBBQ Temperature Probe 2"
    id: ble_sensor_2
    unit_of_measurement: "°C"
    accuracy_decimals: 0

22 posts were merged into an existing topic: Presence detection, BLE, mi flora, RF gateway with ESP32, OpenMQTTGateway is now compatible

Does this work with any Bluetooth meat probe or only a specific one and if so which one?

You should be able to develop a similar integration for any bluetooth device, but this thread deals with the sensors mentioned by @paddy0174 in the first post.

2 Likes

I have a generic brand thermometer and it uses the same protocol as the original Inkbird one. I use it with the BLE passive monitor but it should work well with anything that supports Inkbird.

This is sold by a swedish company and branded with their “generic” brand:

I believe you will find that several sites selling the same type thermometer with assorted brand names.

Using an Inkbird and OpenMQTTGateway. It throws erroneous values at times which just ruins my chart :frowning: The chart in the inbird BBQ go app looks normal.

Any ideas?
Thanks,
Grey

Nope, no idea, as I’m not using OpenMQTTGateway (as stated above). :wink:

Please feel free to ask in the corresponding thread, here:

We are discussing this issue below :

1 Like

What are your expected measurement/temperature data when you see this ?