HI, I have been trying to get BLE tracking working, I get it working but the default 300 second
delay makes it pretty useless, when I try to change this to 10 seconds the ESP Home editor gives an error on the scan interval line. What Am I doing wrong?
Thanks
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
port: 8266
# Bluetooth Tracker
esp32_ble_tracker:
scan_interval: 10s
binary_sensor:
- platform: ble_presence
mac_address: C5:68:04:6A:0C:F5
name: "Tracker John"
Not really, I got it to work but it was slow to respond and unreliable. I tried various time scan setting to
no avail. Gave up eventually.
I am now in the process of trying out a dedicated MQTT BLE detector, at the moment I havnt finished building the hardware so cant say if it is better.
I am using this https://jptrsn.github.io/ESP32-mqtt-room/index.html#getting-started. I am using an ESP8266 with an external Bluetooth module as the ESP 32 does have problems with it bluetooth apparently
Cheers
Don’t mean to necrodig this topic, but I fell on it while hunting for a solution on device trackers.
I’m pretty sure modern smartphones are fuzzing / hiding their real Bluetooth mac address to avoid tracking. It’s a good thing since you don’t want a person or business to be able to identify you’re in a specific location, passively (ie without you knowing).
Hence, the “declared” Bluetooth mac as seen by many devices will be a random one.
If you want to accurately know which BLE devices are around, it’s probably better to use an ibeacon feature, meaning you poll this BLE beacon with an app every 5 min, showing you indeed are around.
Esphome features this and combining it with owntrack (or similar) should do the trick.
I am using the marvellous esp32_ble_tracker with sensor platform xiaomi lywsd03mmc passing data to the Home Assistant HACS Passive BLE monitor integration. I have 2 esp32 nodes equipped with esp32_ble_tracker gathering data from 4 xiaomi_lywsd03mmc units. Why 2 nodes? Redundancy, and better coverage - sometimes one node picks up the data, sometimes the other.
Each of the esp32 nodes automatically creates 4 entity names in Home Assistant for the 4 Xiaomi units, so I end up with duplicate entities for the 4 units. That is, it creates sensor.mijia1_temperature and sensor.mijia1_temperature_2 for the same lywsd03mmc on each of the two esp32 nodes. I merge the 2 back into a single data stream in Home Assistant with a template sensor.
My question: is there a way to stop the duplication of the Home Assistant entity names from the espnode end of things? Then, I can remove my template sensor, and reduce the data load on Home Assistant.
For reference, here’s my espnode yaml extract: (It is identical on each of the espnodes, except that one is id: blehub1 and the other is blehub2: the MAC for the xiaomi unit is the same)
I think I figured it out myself: use ble_gateway on the esp node, and use the Passive BLE Monitor in my Home Assistant configuration.yaml to do the decryption of the raw packet data.
The data from each node gets sent to Home Assistant using the ble_monitor.parse_data service call, and the data from each Xiaomi unit gets mapped to a single entity in Home Assistant.
This seems to work fine: as an added bonus I get the RSSI and Voltage entities, and the RSSI plot shows the RSSI from each of the Xiaomi units to that esp node. Fascinating.
Thanks so much Phil! I got it working with 7 thermometers and 3 ESP32s. All that’s left is to work out how to move the data from the previous entities to the new ones so I don’t lose the history.
I’ve since reduced the number of bt macs on each esp32 to 2 from 4 - I was getting too much data! I was surprised by the ability of each esp32 to reach each Mijia thermometer - RSSI values were ranging from -60 dBm to -90 dBm and the data from each Mijia was still getting through.
Also, I discovered how to get the de-crypted Mijia data back to the esp32 in order to show it on an attached display (this is in the esp32 yaml config):
# Get the Mijia1 temperature value back from Home Assistant
- platform: homeassistant
id: mijia1_temperature
name: "Mijia1 Temperature"
entity_id: sensor.ble_temperature_a4c13829xxxx
# Get the Mijia1 humidity value back from Home Assistant
- platform: homeassistant
id: mijia1_humidity
name: "Mijia1 Humidity"
entity_id: sensor.ble_humidity_a4c13829xxxx
I’ve configured esp32_ble_tracker (see below) and it seems to work (I see the devices and reported temperature in the log), but I don’t see it in HA. In the integrations I see the device, but in its Controls it says “This device has no entities”. Any ideas? What is wrong?