Scan for bluetooth le using hassio on pi

I was hoping to scan and get the MAC address of a plant sensor I have just bought.

Found this guide but do not understand the root bit.

I have home assistant running on a pi3+ and can ssh into it but typing not sure what I am supposed to do. Is it enough to just add:

device_tracker:
  - platform: bluetooth_le_tracker

Or do I need to do the rootless setup and if so how?

what about going down this track

put esphome on it

add this

then

have 3 of the above have just order 2 more

I’ve just bought an esp32 board and two vegtrug as dont seem to be able to find any xiaomi mi plants at a decent price!

Plan was to go esp32 + mqtt into HA but don’t think any of the esp32 code works with vegtrug so wanted to at least find the Mac code first.

my under standing

if you add
just

esp32_ble_tracker:

into esphome script

it will display a mac address of what it finds its the data it wont show

that mite help

Not sure I understand esphome. Can I use it to program an esp32 chip to receive Bluetooth data and transmit via mqtt or is esphome purely Wi-fi?

Bit stuck with the device to device to device logic

what happens when you run the

sudo apt-get install libcap2-bin
sudo setcap 'cap_net_raw,cap_net_admin+eip' `readlink -f \`which python3\``
sudo setcap 'cap_net_raw+ep' `readlink -f \`which hcitool\``

commands?

This is part of my problem, I’m not sure where to run commands.

I have terminus on my iPhone and can connect to hassio via ssh but I get “core-ssh” on the screen so typing anything like the above doesn’t work. Sure I need to do something obvious but don’t know what sorry

hassio

Oh I didn’t know you that you are running hassio, I don’t think the

apt-get

command will work on HassIO, you need to be using Raspbian in order to use the

apt-get

command as far as I know.

Why aren’t you simply using your phone?

Take one sensor and your phone, go anywhere as far as possible from other BT devices, like speaker or whatever, and turn on the BT of the phone. Search for devices and pair the phone with the sensor. Go back to the BT page where all devices ae listed and long press the sensor. There should be the MAC. :smiley:

After writing it down, delete the pairing on the phone, get the next sensor and start again. :slight_smile:

My understanding was you couldn’t pair with ble devices as such only connect to get the information

I have done his with a few BTLe devices, in my case the Aqara Humidity/Temp sensors with display. In my case the garage is the place to go. :wink: I start BT on the phone and scan for devices. And it almost directly shows up and asks to connect. That’s it. Afterwards I can select it in the list of paired devices and can show the MAC.

Have you tried it?

Tried being right next to it with my phone (iPhone) it won’t find it when just scanning for Bluetooth but my phone will connect to it using the app to get data.

The plant sensor is now next to my pi and a restart still shows “no Bluetooth le devices to track”

From a bit more reading seems Mac addresses are not visible on iOS and uuid are not available on Android. And HA is failing me at the moment in finding the device. Anyway in hassio to check bluetooth is working?

ok, all solved.

Borrowed an Android device, downloaded a BLE scanner and got the MAC address.

Just to confirm though, HA could not pick the device up using BLE tracker. Bluetooth is working though on the PI as I added the normal tracker and with my phone in search mode it found it, so assume BLE trackers only find things that are actively seeking a pair.

IOS software does not show mac address, either in paired bluetooth devices screen or using any app that exists. IOS shows UUID, Android apps show MAC address so I now have the MAC address at least.

Next to get it to talk to esp32, then mqtt to HA!