How to use built-in Rpi 4 bluetooth?

My RPi has built-in bluetooth, but I can’t find any utilities to use it/pair devices? Trying to pair a Switchbot via bluetooth.

1 Like

See

You just need your switchbot mac address

Chris thanks, yes that was the guide I used but it doesn’t work.
I try to turn on/off and indicator says ‘failed’.
Is there a way to know if the bluetooth on RPi is working or not? And I assume there is no need to pair the device?

I don’t know how to check with Hassio but if your running Ubuntu you can run:

sudo bluetoothctl

then

scan on

and the Pi’s controller should pop up along with MACs of any Bluetooth devices it finds.

Actually, smartbot seems ble, so it would be

hcitool lescan

What “indicator”?
Do you have messages in log?
Try to be close to the rpi to test. Bluetooth in rpi can be finicky due to interferences. If you use USB3 on the rpi, forget about BT :wink:

Correction: under “attributes” within switchbot entity, “Last run success” is “false”.

I guess I’m just surprised HASS has no ability to check on RPi’s native system functions, like Bluetooth. And there are no BT integrations to do that.

1 Like

I’m running native HASS so those commands don’t work sadly.

At least, hcitool is available.
Assuming you have the terminal addon installed, you have to login, first

I don’t think there’s hcitool in the HA Core shell. I can’t get it anyway. 2021.9.2 on Rpi4.

Not sure what you mean by that, but it’s included in the HA docker image:

/config # hcitool
hcitool - HCI Tool ver 5.55
Usage:
        hcitool [options] <command> [command parameters] 

I mean the default RPi installation method without full Linux, without apt (with Terminal/SDH addon), not the HA Docker image. There’s no hcitool. There’s bluetoothctl though.

All installation methods (besides “core”, ofc) use the same docker image.
The SSH addon gives you access to the hassio CLI (I think?), not to the actual container.

On a container or supervised install, you enter the actual container with the docker exec command.

cbro@RPI-3:~ $ docker exec -it homeassistant /bin/sh
/config # hcitool
hcitool - HCI Tool ver 5.55
Usage:
        hcitool [options] <command> [command parameters]

Whatever shell script in executed in HA is executed there.

Nope, “docker: command not found”. Or maybe I don’t know what to log into really. I’m logging into root@“address of the pi running HA”. Eve when I login into the homeassistant docker container using Portainer, it gives me the same error.

That gives me

FATA[0000] Error while executing rootCmd: unknown shorthand flag: 'i' in -it

Which is an error I get literally no matches for on Google. Only on these forums there is one match, and the next answer states the Docker stuff is irrelevant on Home Assistant OS. So I can’t really access hcitool.

Hardcore sceptic, are we? :slight_smile:

¯\_(ツ)_/¯

1 Like

It’s not scepticism if nothing works :slight_smile:

1 Like

should be so simple - Enable onboard bluetooth for Rpi 3 / 4 Home Assistant Installs.

yet again another series of hurdles and techno babel.

This thread is exactly what I am looking for, except there is no solution here. I have a RPi4 running HA and have a SwitchBot temperature sensor in my basement workshop. I can connect with my phone app over BT but can’t even add the SwitchBot integration because I have no bluetooth device. Yet, checking my Raspberry Pi4 specs, it has “Bluetooth 5.0, BLE Gigabit Ethernet” built in.

I had a similar issue a few weeks ago adding a second USB NIC for my SunPower solar integration. I was able to enable the second NIC with “ha network update” commands so I have looked through the HA CLI commands for network but so far, I can’t find a way to enable Bluetooth. I will post here if I figure it out.