Using Bluetooth with Home Assistant Container
HTML-код
- Опубликовано: 31 май 2024
- Setting up the new Bluetooth Home Assistant integration on Home Assistant Container. I show you how to map the DBus socket, install BlueZ and solve a couple of problems I ran into.
Links:
Upgrading BlueZ on Linux: www.homeautomationguy.io/home...
Automatically turn on Bluetooth after container restart: www.homeautomationguy.io/home...
Home Assistant Bluetooth integration: www.home-assistant.io/integra...
My Docker Compose Playlist: • Why I Use Docker for m...
Chapters:
00:00 - Intro
01:12 - Choosing a USB Bluetooth Adaptor for Home Assistant
01:42 - Setting up Docker Compose for Bluetooth
02:27 - Installing BlueZ on Linux
02:56 - Adding the Home Assistant Bluetooth integration
03:25 - Solving the problem: Invalid Arguments in Method Call
04:08 - Solving the problem: Bluetooth Resource Not Ready
04:58 - Don't forget to Subscribe! - Хобби
If you run into an error "Failed to start Bluetooth: [org.bluez.Error.NotReady] Resource Not Ready"
Check out this blog post on how to fix it: www.homeautomationguy.io/home-assistant-tips/failed-to-start-bluetooth-org-bluez-error-notready-resource-not-ready/
Thanks man, you helped me a lot! A donation is on the way :) Just maybe can you make a tutorial on how to fix the bluethooth issue on the latest Ubuntu 23.10 version? Seems like there's a kernel issue and the only manual fix is to patch it. Trying to figure it out myself at. But the dbus forwarding does not work.
Throwing this error atm : hci0 (E4:5F:01:F1:81:71): Failed to start Bluetooth: [org.freedesktop.DBus.Error.ServiceUnknown] The name org.bluez was not provided by any .service files
I am on a Mac mini with integrated Bluetooth, mapped the dbus as you described and installed bluez (first try and directly installed 5.64). Homeassistant configuration worked fine. 2min of work, thanks!!
Solid tutorial and a spot on solution to get BT seen by the HA container - thanks Alan! Next - how to read the Ruuvitag BLE sensors.
Hi, been loving your videos, this just worked right away with Integrated Bluetooth.
Thanks for all your advice
Thank you! I had the exact same experience - searching tech blogs for why my seemingly correctly installed Bluetooth adaptor wasn't working - to no avail. Turning the Bluetooth service ON from within the container did the trick. 😃
Sometimes it's the simple things!
God Bless my new friend. I look forward to learning from you. Offline I can teach you “tons” of different related material.
Awesome video man! I did it before your guide and run into exact same issues on my Raspberry Pi 4. Btw, didn't we all have the same error message on the Printer integration when its off:) Cheers to that!
Haha! That printer error is so annoying!
Do you know if the process would be similar if I'm running HA in a container on a Synology NAS?
Thanks for the excellent tutorial!
Have you faced any issues when you can see the added bluetooth device to the docker container, but you are unable to add it as integration?
I used the HA container shell to lookup the device and using hciconfig and hcitool and the device is visible there, along with the correct MAC address. Frmo the HA GUI, trying to add the Bluetooth integration spits out the "No unconfigured Bluetooth adapters found. There are 0 ignored adapters." error message
Thanks! This was very useful!
Had no problems setting up BT on my Rpi4 hass container. After mapping DBus it (hass) immediately detected my devices. Using it primarily now with the SwitchBot bot's and doorsensors atm but planning to get some curtains in the future too.
If you can - can you find a way to install home assistant on mac docker desktop with a work around for lack of network=host on docker desktop?
Great Alan! Thanks for the video.. I just startet again with HA / Docker on a OdroidM1. I have a question, I have a little LCD screen on my Odroid, Now its constantly jellying about , Bluetooth unknown advertisements. Any idea how to get rid of these messages? A form of " Be Quit" :-)
Great video man. I wish it was going to be that easy to get Bluetooth working in unraid home assistant core. Maybe I can adapt what you did to get it to work for us
All the best! I am sure a lot of the steps will be similar, but you might need to map the adaptor through slightly differently.
How many devices can you connect with Asus BT400 at a time? Is Asus BT500 better than BT400? What if you reach the limit and want to add more devices. I run Home Assistant OS on an Intel-based computer. Your reply shall be appreciated. Thanks.
Will this work on HA on VM using Proxmox server install on an intel NUC?
All I needed for raspberry pi 4 was the dbus line in docker-compose! Works now!
Glad you got it working!
@@HomeAutomationGuy Thanks again! It was that simple yet was bugging me for a while 😅
Can you do a video on how to create a custom service on Docker Container and then use that service in the HA UI? Or a video on how to use a curl request as an Action in an automation?
Bluetooth frequencies……. Are they strong enough to reach through walls to other rooms? Or do you have a PI in each room to gather WiFi signals and send them to home assistant server?
New Subscriber! Alton. New tinkerer. Lol
Sir Paul Hibbert sent me over! Glad he did. (I love Paul’s humor and knowledge).
You are the 4th Brit from across the pond I subscribe to!
Welcome to the channel! My production qualities are far lower than Paul's, and he's far funnier than I am, but I'm trying my best here!
Bluetooth signals are strong enough to get through most normal drywall style walls for 3 or 4 meters (that's like 12 feet I think for you imperials). If you're a home assistant (Home Assistant!) user then you don't need a pi in each room, you can use a cheaper ESP thingie to spread out your WiFi receivers. I'll be making a video about it soon.
Home Assistant PROXMOX Install (With NUC Alternative)i am getting the error: “Retrying setup: Failed to start Bluetooth: adapter ‘hci0’ not found” help?
Thanks for this. I'm currently deciding whether to use this approach, or add Bluetooth via an ESP32 Proxy in ESPHome. I think I may go with your approach, as it'll likely be up to handling traffic more devices, should the need be later on.
ESP proxies are pretty damn good. If you're already using ESPHome or Shelly devices elsewhere in your home then it's a no brainer to turn those on first. You won't need any extra hardware
Hi. I bought the same bt adapter. I'm runing HA in docker on a Synology NAS. How can I check the bluez Version on Synology? Great Videos, thx😀
Thank you!
Thanks as always for taking one for the team!!! Did you connect it to any bt devices???? Which adapter did you go with?? Does it restart when rebooting???
I've not connected any BT devices, because I don't actually have one to connect. I used the Asus BT400 adapter that's in the thumbnail.
And it seems that I need to rerun the up command after a restart.
@@HomeAutomationGuy Sorry, missed it in the thumb... hope there is a way to restart the adapter after a reboot...👍😁 Lots of us are curious, keep posting when you add devices... Please...
I fixed it, check out my blog post: www.homeautomationguy.io/home-assistant-tips/failed-to-start-bluetooth-org-bluez-error-notready-resource-not-ready/
I installed HA in a VM (esxi), i have a few lights working only. I can see when i log into homeassistant:8123 there is a ha > prompt. I cant work how how to then modify the yaml file to do the dbus business.. can it it be done via the ha > prompt? After inserting a BT dongle, I could see on startup BT support OK.. and in the VM (Edit configuration) it seemed to find the USB BT dongle ok.. but thats where I am stuck. Thanks..
Thanks to the author.. much appreciated.
Thanks Alan, I look forward to trying this myself soon. I am curious to know if the bluetooth inside your container needs to be turned on again after redeploying the container - i.e. after the monthly update....
I need to turn it on again after the container restarts, but I'm looking to automate this in my docker compose file. (I'll post a blog about it when I figure it out exactly)
I fixed it, check out my blog post: www.homeautomationguy.io/home-assistant-tips/failed-to-start-bluetooth-org-bluez-error-notready-resource-not-ready/
Very clear video thanks. I want to use the Bluetooth proxy of the Shelly Gen2 devices in a docker container. Did anyone tried already?
Great video 👍🏻 I’m really curious what the use case is for BT in home assistant, as the range is fairly limited. So it could only manage devices that are in close proximity. I have SwitchBot curtain drivers that work on Bluetooth, but because they are not close to my Hass system I needed a bridge anyway.
Don’t get me wrong I’m sure people have really good use-cases for it, but I’m just curious!
I'm curious too!
I'm getting a 50ft Bluetooth range through the walls on raspberry pi zero w2. Also Bluetooth BLE5 is good for passive sensors, although I wouldn't use HA for that anyway.
Some sensors use BLE to communicate directly to your phone... but monitoring via phone is annoying and less optimal than continuous monitoring with HA. E.g. the airthings wave radon monitor. There are a number of solar powered weather stations which struggle to keep up with solar when updating over wifi, but do great over BLE. Getting a sensor close to your sensor can be difficulty though, but fortunately, you can use bluetooth proxy to make a network of cheap ESP32 devices that'll effectively extend your range. Also, if you build a network of these cheap devices, you can capitalize on BLE's short range to make each of these a short range sensor and watch for your phone. Based on which device is closest to you phone/smart watch/etc. you can do micro location tracking and make home assistant build automations based on this presence detection that is specific to different rooms within your home. Lots of cool stuff that you can do in spite of, or perhaps because of, BLE's short range.
Done the dbus map but when I try to install the integration it says 'No unconfigured Bluetooth adapters found. There are 0 ignored adapters.'. I can enter the dockers terminal and use Bluetoothctl to scan for Bluetooth devices and this works so don't know why the integration throws that warning up and then doesn't install :(
Did you find a solution to this? I have the same problem
@@onterrahdgaming Yes. I had to delete the :RO from the end of the line. Worked perfectly then.
I'm using home assistant green what kind of USB hub do I need
I have been searching for a way to connect more than one bluetooth speaker to a raspberry pi running on bullseye and play music on these connected Bluetooth speakers.
Could you please do a tutorial on how to do this !!! 🙏
Thanks for your sharing video. I wonder can we using build-in bluetooth on NUC and why you need to buy a new one instead of using build-in bluetooth ?
I am sure you can, you would just need to make sure you enable the built-in Bluetooth in the NUC BIOS and then it should work much like a USB dongle. The performance and range may not be as good though.
Do you have an idea how to deal with built in BT for RPI 3B, HA is installed in container and uses Alpine-Linux?
"bluetoothctl
Waiting to connect to bluetoothd...dbus[135]: arguments to dbus_connection_get_object_path_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5921.
This is normally a bug in some application using the D-Bus library.
D-Bus not compiled with backtrace support so unable to print a backtrace"
try adding
privileged: true
below the volumes in your compose file. it seems that this fixed that error for me today :D
@@saadchaaban5007 i tried, didn't help, also I have a problem with access to gpio via container node red...will do mqtt on regular node red moat likely :/
i am getting the error: “Retrying setup: Failed to start Bluetooth: adapter ‘hci0’ not found”! i Install Home Assistant PROXMOX With NUC Alternative
Pete Tong! there is a blast from the past
I saw him play live two weeks ago outside of London!
@@HomeAutomationGuy Nice, I saw him multiple times in the late 90s. lol
hello, I'm looking for your videos that compare several scene buttons. can you pass me the link. your videos are exceptional
hmmm im getting this error: DBus service not found; docker config may be missing `-v /run/dbus:/run/dbus:ro`: {ex}. Which is funny because i did add the volume for this. What i've been wondering specifically is the "{ex}" at the end of the error message, no idea what this means....
Try deleting the :RO bit off the end. Thats what I had to do. So you will be mapping /run/dbus:/run/dbus
@@markloughtonUK yes that did the job, forgot to update my comment :) thanks for the comment!
How do I pair Bluetooth devices after the integration? Using Pi4
Check out the Home Assistant Bluetooth integration page for more info
installed first time with a random BT dongle from mpow. No luck in getting it to discover anything though
Where is the docker-compose file stored??? i cant figure out where or how to access it
You need to create it yourself. Check out my Docker video for more information: ruclips.net/video/S-itdbqwj4I/видео.html
I am using pax fan that is connected with Bluetooth ...
I need to stop and then start bluetooth.service via systemctl and then do the bluetoothctl power on after every restart. Also, you don't need to do it in the HA container, doing it outside has the same result.
do you actually need to run the container in privileged mode?
I don't know
Wow, what a nightmare!
sudo apt install glib2.0 dbus-1-dbg build-essential libdbus-glib-1-dev libgirepository1.0-dev libudev-dev libical-dev libreadline-dev python-docutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package dbus-1-dbg is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
dbus-tests
E: Unable to locate package glib2.0
E: Couldn't find any package by glob 'glib2.0'
E: Package 'dbus-1-dbg' has no installation candidate
end back to command line
before trying legacy method i went for workaround method and get above error. after installing bluez homeassistant container grab the bluetooth and integration submitted succesfully.
pr໐๓໐Ş๓
I am not a fan of those tutorials where everything is already working and you don't show how it's done. :(
My apologies
@@HomeAutomationGuy No worries, I was just having some trouble with getting Bluetooth running and was so frustrated :D
I wouldn't call connecting the blue tooth adapter "using" it. What do you do next?