Closed NoxNoctium closed 3 years ago
Hi, Thanks for reporting the issue! I do not use hassio and have never used it, so I might not be fully across the technical details, but from what I can read online, the hassio image already contains bluepy so I would assume they have already set the system permissions accordingly. But from the log it is clear that bluepy cannot connect to the device.
Can I ask what host you use for hassio? RPI, NUC? And are you using the integrated bt or a usb dongle? Also, do you have the bt working for other components?
Hi hcoohb, Thanks for looking into it!
I use an older laptop with Proxmox as host and Home Assistant OS running inside a virtual machine, with the USB device of the Intel bluetooth adapter (ID: 8087:0025) assigned to it. Yes bluepy is already included and I can scan for devices from inside the Home Assistant OS VM, I even got the bedside lamp into pairing mode with it. To try out bluetooth I've set up the mitemp_bt platform for three room temperature sensors, Home Assistant is able to read out and display the sensor data reliably.
I'll try out a "cleaner" approach at the weekend with a RPi3B+, Home Assistant OS and the included bluetooth adapter if you want me to.
So it seems bluetooth is definitely running well on your machine and hassio is able to control it. But the bluetooth-helper of the library could not establish a connection at all. I need to enable more trace for that (I'll do that in next release)
And then if you are familiar with your system, best way would be to ssh in hassio and try to connect to the lamp manually first.
ps, can I ask the process hassio to scan for device as another user has the issue to find the mac address of the lamp using hassio...?
I've played around with bluetoothctl inside the Home Assistant OS VM and also the host machine this evening and unfortunately it seems I was wrong about being able to pair the lamp. It flashed a few times (indicating pairing process) during my attempts but it actually failed to pair, rather it was listed as a"trusted" device. Judging from the related journald loglines it errors out after the device interview and during the start of the pairing process. I can pair other devices though without an issue. I'll try out the pairing behaviour on another bluetooth adapter and a RPi and get back to you next week.
To your ps: I don't know of any bluetooth related funtions in hass-cli but you can always enter "login" and access the OS directly, from there you can use bluetoothctl for the scanning/pairing process. I'd also suggest waiting for the wifi/bluetooth-integration in the Home Assistant OS network manager as teased in this blog post: https://www.home-assistant.io/blog/2020/09/16/supervisor-joins-the-party/
This is just the start to make advanced host management more accessible and it only touches a minimal part of what we will be able to do with it. Support for Wi-Fi and Bluetooth will follow later as part of our usability improvements.
Currently this custom component doesn't seem to be compatible with Home Assistant Operating System. Adding the component and setting it up in the "integrations" menu works but connection to the actual bedside lamp fails. HAOS uses buildroot, setting permissions as instructed in the ReadMe fails, "setcap" is not available on the host system.
Relevant log entries: