Open ajobbins opened 3 years ago
I have exactly the same response as you do, constant MQTT connect messages.
I ended up just using the BLE Tracker from ESPHome and it's works great
I ended up just using the BLE Tracker from ESPHome and it's works great
You have it fully functional in ESPHome? I'm trying to do the same, do you have more information on this?
Edit: I found the info how to set it up, and it's working for me as well -> https://community.home-assistant.io/t/inkbird-bt-thermometer-ibbq-with-esp32/325825
found the info how to set it up, and it's working for me as well -> https://community.home-assistant.io/t/inkbird-bt-thermometer-ibbq-with-esp32/325825
For completeness, here is my code. I updated it to include the device and state class, which then allows you to swap between C and F in the HomeAssistant UI if you need.
substitutions:
esp_name: ble_tracker
esphome:
name: ble_tracker
platform: ESP32
board: nodemcu-32s
on_boot:
priority: -10
then:
- switch.turn_off: annoyingled
- lambda: |-
{
id(ble_sensor_1).publish_state(0);
id(ble_sensor_2).publish_state(0);
id(ble_sensor_3).publish_state(0);
id(ble_sensor_4).publish_state(0);
id(ble_sensor_5).publish_state(0);
id(ble_sensor_6).publish_state(0);
}
- delay: 1 sec
- switch.turn_on: annoyingled
- delay: 1 sec
- switch.turn_off: annoyingled
wifi:
ssid: ""
password: ""
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Ble Tracker Fallback Hotspot"
password: ""
captive_portal:
web_server:
port: 80
# Enable logging
logger:
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
time:
- platform: homeassistant
esp32_ble_tracker:
on_ble_advertise:
- lambda: |-
if (x.get_name() != "iBBQ") 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];
int probe2 = (data.data[13] << 8) + data.data[12];
int probe3 = (data.data[15] << 8) + data.data[14];
int probe4 = (data.data[17] << 8) + data.data[16];
int probe5 = (data.data[19] << 8) + data.data[18];
ESP_LOGI("ble_data", " - %f %f %f %f %f %f", probe0 / 10.0, probe1 / 10.0, probe2 / 10.0, probe3 / 10.0, probe4 / 10.0, probe5 / 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);
}
if (probe2 < 60000) {
id(ble_sensor_3).publish_state(probe2 / 10.0);
} else {
id(ble_sensor_3).publish_state(0);
}
if (probe3 < 60000) {
id(ble_sensor_4).publish_state(probe3 / 10.0);
} else {
id(ble_sensor_4).publish_state(0);
}
if (probe4 < 60000) {
id(ble_sensor_5).publish_state(probe4 / 10.0);
} else {
id(ble_sensor_5).publish_state(0);
}
if (probe5 < 60000) {
id(ble_sensor_6).publish_state(probe5 / 10.0);
} else {
id(ble_sensor_6).publish_state(0);
}
}
}
switch:
- platform: gpio
name: "${esp_name}-Onboard-LED"
pin: 2
inverted: False
id: annoyingled
- platform: restart
name: ${esp_name}-restart
id: restart_switch
sensor:
- platform: uptime
name: "${esp_name}_Uptime Sensor"
- platform: wifi_signal
name: "${esp_name} WiFi Signal"
update_interval: 60s
- platform: template
name: "Inkbird Temperature Probe 1"
id: ble_sensor_1
icon: "mdi:thermometer"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 0
- platform: template
name: "Inkbird Temperature Probe 2"
id: ble_sensor_2
icon: "mdi:thermometer"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 0
- platform: template
name: "Inkbird Temperature Probe 3"
id: ble_sensor_3
icon: "mdi:thermometer"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 0
- platform: template
name: "Inkbird Temperature Probe 4"
id: ble_sensor_4
icon: "mdi:thermometer"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 0
- platform: template
name: "Inkbird Temperature Probe 5"
id: ble_sensor_5
icon: "mdi:thermometer"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 0
- platform: template
name: "Inkbird Temperature Probe 6"
id: ble_sensor_6
icon: "mdi:thermometer"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 0
All the Inkbird BBQ and many more are natively integrated into OpenMQTTGateway for ESP32 and Theengs gateway for Raspberry/servers. With OMG you don't need any yaml as the sensors are autodiscovered. With Theengs the autodiscovery is being added.
I have an Inkbird IBT-6XS and an ESP32 DEVKITV1.
Flashed this software fine and the device boots and connects to WiFi/MQTT but doesn't seem to be picking up a thermometer? I am not seeing any topics being published to the MQTT server and the logs don't seem to indicate any issue that is obvious to me. Any clues as to what is going wrong?
Full log below. It stops at the last line (MQTT Connected) and doesn't do anything further.