Inkbird ITH-11-B ESPHome BLE proxy

The Inkbird ITH-11-B BLE thermometer isn’t yet officially supported.

I’ve written this ESPHome YAML to get it into Home Assistant, thanks @Markg for your script for the INT-11P-B that got me started!

NB, I haven’t actually checked negative temperatures yet, It might need amendments to handle two’s complement.
EDIT: updated, now works, it does use two’s complement

You’ll need to put the sensor mac in, and use the key & password given to you by your own ESPHome install

esphome:
  name: inkbirdproxy
  friendly_name: InkbirdProxy

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "zzz"

ota:
  - platform: esphome
    password: "zz"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Inkbirdproxy Fallback Hotspot"
    password: !secret wifi_password

captive_portal:

ble_client:
  - mac_address: "00:00:00:00:00:00"
    id: inkbird

switch:
  - platform: ble_client
    ble_client_id: inkbird
    name: "Enable Inkbird ITH-11-B"

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: inkbird
    name: Inkbird Temperature
    id: inkbird_temperature
    service_uuid: 0000fff0-0000-1000-8000-00805f9b34fb
    characteristic_uuid: 0000fff7-0000-1000-8000-00805f9b34fb
    unit_of_measurement: '°C'
    lambda: |-
      // Display the hex string for debugging.
      std::vector<uint8_t> data = x;
      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();
      ESP_LOGW("LOG_TAG", "INKBIRD Hexadecimal string: %s", hex_string.c_str());
      long value = (x[6] << 8) + (x[5]); 
      if (value > 32765 ) {
        value = value - 65536;
      }
      return value;
    device_class: temperature
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

#Battery
  - platform: ble_client
    type: characteristic
    ble_client_id: inkbird
    name: Inkbird Battery
    id: inkbird_battery
    service_uuid: 0000fff0-0000-1000-8000-00805f9b34fb
    characteristic_uuid: 0000fff7-0000-1000-8000-00805f9b34fb
    lambda: |-
        uint8_t value = x[9];
        return value;
    device_class: battery
    unit_of_measurement: '%'

#Humidity
  - platform: ble_client
    type: characteristic
    ble_client_id: inkbird
    name: Inkbird Humidity
    id: inkbird_humidity
    service_uuid: 0000fff0-0000-1000-8000-00805f9b34fb
    characteristic_uuid: 0000fff7-0000-1000-8000-00805f9b34fb
    lambda: |-
        uint16_t value =  (x[8] << 8) + (x[7]);
        return value;
    unit_of_measurement: '%'
    device_class: humidity
    accuracy_decimals: 1    
    filters:
      - multiply: 0.1

3 Likes

Just want to piggyback that I also got this to work with the ITH-13-B as a proxy. Without any modification of the code.

1 Like

Sorry to ask here, since I’m new to HA. I just got myself a Raspberry Pi 5, installed HA, installed ESPHome, compiled the yaml code. But I’m not really sure I how can now connect the the Inkbird ITH-11-B with HA… do I need any addional hardware beside the Raspberry? Would be very nice if someone could explain it with a few key points, how to proceed here :slight_smile:
TY

Pretty sure it should just work via ESPhome, and show as a device with entities.
Is it not showing under the ESPhome integration?
If not, are you sure you changed the mac address etc. correctly in the code above?

I’m pretty sure you need additional hardware. Some ESP-based board is working as a BLE to WLAN proxy here and interprets the packets sent by the Inkbird sensor. You need to flash it initially with ESPHome as new device, keep the HA API key etc., insert your sensor’s MAC address and insert the sensor code from above.

Apologies, I had a brain dead moment of when writing this, and was assuming you meant in addition to an ESP32.