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