I’ll start my own thread since it’s a diff probe…
Hi guys,
Setting up my first ESP32 device to use exclusively with Inkbird BT4 and asking for a little help here.
I basically followed the steps from the first post, copy pasted all the configs.
I can see probes temperature in ESPHome logs:
But in home assistant sensors are not appearing, thought they are created under different names, but cannot find anything that may look like those sensors. To me it feels like ESP32 board not publishing anything to HA, but as it’s my first board I may miss something.
Update:
I think I found where my problem is - had to setup ESPHome integration in order for this to work.
Setup couldn’t be easier so thanks for the detailed setup instructions! I was able to get my BT thermometer into HA pretty quickly without any changes to the setup. Although sadly like a few other posts I also had dropouts which would cause my graphs to have huge spikes to 0 at times, range isn’t the issue as they’re VERY close to each other. The iBBQ app must either not get the connection drops or must smooth the map over as the issue isn’t present there. Given once you connect your phone the BT connection to the ESP also drops so sadly had to resort back to the iBBQ app for last weekends 7 hour smoke and miss out on all that juicy HA data!
I’m trying to set this up with an Inkbird ibt-2x.
I had to change iBBQ
to xBBQ
to get the following result
13:18:50 [I] [ble_adv:019] New BLE device
13:18:50 [I] [ble_adv:020] address: D3:6D:00:00:11:2C
13:18:50 [I] [ble_adv:021] name: xBBQ
13:18:50 [I] [ble_adv:022] Advertised service UUIDs:
13:18:50 [I] [ble_adv:025] - 0xFFF0
13:18:50 [I] [ble_adv:028] Advertised service data:
13:18:50 [I] [ble_adv:034] Advertised manufacturer data:
However I don’t get any useful data. Is there anyway to debug this? Can I maybe get all service data and manufacturer data in my log to see if it matches the expected format?
Please post the code from the config you’re using. It’s hard to say without actually seeing the code.
It’s basically the same code as above, but with xBBQ
instead of iBBQ
This is what I see with VERY_VERBOSE logging
Address: D3:6D:00:00:11:2C (PUBLIC)
RSSI: -20Name: 'xBBQ'
TX Power: 2
Ad Flag: 6
Service UUID: 0xFFF0
Manufacturer data: 00.00.2C.11.00.00.6D.D3.04.01.01.01 (12)
Adv data: 02.01.06.03.02.F0.FF.0F.FF.01.00.00.00.2C.11.00.00.6D.D3.04.01.01.01.05.09.78.42.42.51.05.12.18.00.38.01.02.0A.00 (38)
This is the information the template returns in the log:
[20:01:22][I][ble_adv:021]: name: xBBQ
[20:01:22][I][ble_adv:022]: Advertised service UUIDs:
[20:01:22][I][ble_adv:025]: - 0xFFF0
[20:01:22][I][ble_adv:028]: Advertised service data:
[20:01:22][I][ble_adv:034]: Advertised manufacturer data:
[20:01:23][I][ble_adv:037]: - 0x0001: (00.00.2C.11.00.00.6D.D3.F9.00.F7.00 (12))`
This is my code:
substitutions:
device_name: Inkbird
device_type: BLE
ip: 192.168.2.92
mac_inkbird: "D3:6D:00:00:11:2C"
esp32:
board: lolin32_lite
framework:
type: arduino
esphome:
name: inkbird
on_boot:
priority: -10
then:
- lambda: |-
{
id(ble_sensor_1).publish_state(false);
id(ble_sensor_2).publish_state(false);
}
packages:
minimal: !include packages/minimal.yaml
basic: !include packages/basic.yaml
inkbird: !include packages/inkbird.yaml
packages/inkbird.yaml
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: ${mac_inkbird}
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
sensor:
- platform: template
name: "iBBQ Temperature Probe 1"
id: ble_sensor_1
unit_of_measurement: "°C"
accuracy_decimals: 0
- platform: template
name: "iBBQ Temperature Probe 2"
id: ble_sensor_2
unit_of_measurement: "°C"
accuracy_decimals: 0
packages/minimal.yaml
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
fast_connect: on
manual_ip:
static_ip: ${ip}
gateway: 192.168.2.100
subnet: 255.255.255.0
ap:
ssid: "${device_name} ${device_type} Hotspot"
password: !secret hotspot_pass
captive_portal:
# Enable logging
logger:
level: VERY_VERBOSE
# Enable Home Assistant API
api:
# Enable OTA updates
ota:
packages/basic.yaml
# Enable Web server
web_server:
port: 80
#Sync time
time:
- platform: homeassistant
id: time_homeassistant
timezone: "Europe/Amsterdam"
on_time_sync:
- component.update: sensor_uptime_timestamp
- platform: sntp
id: time_sntp
timezone: "Europe/Amsterdam"
text_sensor:
- platform: version
hide_timestamp: true
name: "${device_name} ${device_type} ESPHome Version"
entity_category: diagnostic
- platform: wifi_info
ip_address:
name: "${device_name} ${device_type} IP Address"
icon: mdi:wifi
entity_category: diagnostic
ssid:
name: "${device_name} ${device_type} Connected SSID"
icon: mdi:wifi-strength-2
entity_category: diagnostic
# Sensors with general information.
sensor:
# Uptime sensor.
- platform: uptime
id: sensor_uptime
internal: true
- platform: template
id: sensor_uptime_timestamp
name: "${device_name} ${device_type} Uptime"
device_class: "timestamp"
accuracy_decimals: 0
update_interval: never
lambda: |-
static float timestamp = (
id(time_homeassistant).utcnow().timestamp - id(sensor_uptime).state
);
return timestamp;
entity_category: diagnostic
# WiFi Signal sensor.
- platform: wifi_signal
name: ${device_name} ${device_type} WiFi Signal
icon: mdi:wifi-strength-2
update_interval: 60s
# restart button
button:
- platform: restart
name: "${device_name} ${device_type} Restart"
# safe mode switch
switch:
- platform: safe_mode
name: "${device_name} ${device_type} Safe Mode"
binary_sensor:
- platform: status
name: ${device_name} ${device_type} Status
entity_category: diagnostic
@paddy0174 I’ve done some debuggin myself, and the reason it does not work is because of this if-statement: if (data.uuid.contains(0, 0))
If I take that out, it works.
I’m not completely sure what it does, but it seems to retern false
.
Why are you fighting using OMG ?
PapaLanc
Not sure if you are referring to me, but I don’t use MQTT and I don’t plan to use it just for this
Nobody is fighting OMG, it simply is not the correct thread here. OMG has it’s own thread here in this forum and is profundly supported, especially by @1technophile! So if questions arise about it, why not ask there?
@TheFes
On a first glance, I can’t see anything wrong, but I’d like to test some things @home
, before I answer.
I made a reminder, so I won’t forget it tonight, and keep fingers crossed I can find my Inkbirds. We had some painters here, and since then, nothing is, where it should be.
I added it to my post, but I have it working now, however I had to remove the check for the uuid.
It falls on if (data.uuid.contains(0, 0)) { }
My uuid is 0xFFF0
.
I now removed that check, and that made it work. I am curious on why it falls, but no rush, I can fire up my BBQ
Hi, any chance you dug up the inkbird already?
I guess that if statement might be needed after all, because this is how my sensor history looks like while it is lying idle at the attic (it’s around 27 degrees there now)
I guess it filters out those incorrect values, but it is always false for me. Any idea how I can change it for my advertisement.
I also tried the new Bluetooth integration in HA btw, but that also doesn work for my model (with name xBBQ
instead of iBBQ
)
Additional info:
These advertisements are correct:
[09:04:51][I][ble_adv:019]: New BLE device
[09:04:51][I][ble_adv:020]: address: D3:6D:00:00:11:2C
[09:04:51][I][ble_adv:021]: name: xBBQ
[09:04:51][I][ble_adv:022]: Advertised service UUIDs:
[09:04:51][I][ble_adv:025]: - 0xFFF0
[09:04:51][I][ble_adv:028]: Advertised service data:
[09:04:51][I][ble_adv:034]: Advertised manufacturer data:
[09:04:51][I][ble_adv:037]: - 0x0001: (00.00.2C.11.00.00.6D.D3.02.01.02.01 (12))
[09:04:51][I][ble_data:043]: - 25.800000 25.800000
These are incorrect. It seems to be some uptime counter updating twice per minute:
[09:07:17][I][ble_adv:019]: New BLE device
[09:07:17][I][ble_adv:020]: address: D3:6D:00:00:11:2C
[09:07:17][I][ble_adv:021]: name: xBBQ
[09:07:17][I][ble_adv:022]: Advertised service UUIDs:
[09:07:17][I][ble_adv:025]: - 0xFFF0
[09:07:17][I][ble_adv:028]: Advertised service data:
[09:07:17][I][ble_adv:034]: Advertised manufacturer data:
[09:07:17][I][ble_adv:037]: - 0x0002: (00.00.2C.11.00.00.6D.D3.BD.52.BD.52 (12))
[09:07:17][I][ble_data:043]: - 2118.100000 2118.100000
Any advice how to exclude them?
UPDATE:
Figured it out, I have to use if (data.uuid.contains(1, 0))
instead of if (data.uuid.contains(0, 0))
!
Many thanks for the guide! This is my first ESPHome device and it all worked perfectly. One question I do have is, is it possible to pull the values in Fahrenheit or do we need to do a Celsius to Fahrenheit conversion ourselves in Home Assistant?
Also, another thing I have spotted is that all my sensors report the temperature correctly, but probe 4 is showing this:
[16:50:51][D][sensor:127]: 'iBBQ Temperature Probe 4': Sending state 6552.60010 °C with 0 decimals of accuracy
The config for Probe 4 is exactly the same as the other 3 and the readout on the Inkbird and the App show the correct value.
That made the trick here also,
also saw that my sends data with 1 decimal also, an easy update of the sensor accuracy.
You da man!! This solved the problem I’ve been having.
I think I solved this myself. The guide at the top of this thread has the below:
if (probe3 < 60000) {
id(ble_sensor_4).publish_state(probe1 / 10.0);
} else {
id(ble_sensor_4).publish_state(0);
}
I noticed that it references probe1 on the second line when getting data from ble_sensor_4, when it should say probe3 as below:
if (probe3 < 60000) {
id(ble_sensor_4).publish_state(probe3 / 10.0);
} else {
id(ble_sensor_4).publish_state(0);
}
Does that seem right?
That is how I have mine setup for the 4 Probe IBT-4XS.