Closed dancavallaro closed 2 years ago
I am also having this issue on Big Sur. It seems like the hb-service does not have access to bluetooth. When I run sudo hb-service in terminal it does not prompt for Bluetooth permissions, it does however ask for permissions when running homebridge command.
I tried granting access to /Users/
Sorry y'all are hitting permissions issue. Unfortunately this is very specific to the environment in which you are running homebridge. https://github.com/abandonware/noble#installation is the best set of docs that I know of for getting set up properly, but I'm not sure it goes into much detail on user permissions. Please post back here if you figure it out!
I was able to find a workaround by granting /usr/local/bin/node access to permissions
I can see now it looks good in the logs:
" [8/21/2022, 11:49:59 PM] [HatchBabyRest] Scanning for Hatch Rest [8/21/2022, 11:49:59 PM] [HatchBabyRest] Found device Hatch Rest with address --**-1a-23-02 "
I hope this helps you too
FYI - not a good security practice...
@dancavallaro I haven't heard back from you on whether you got this working. I'm guessing the steps above should work for you as well
Hey @dgreif, sorry for the silence, I just got back from vacation. @sonorone's workaround did indeed work for me. I first tried giving Bluetooth permissions just to homebridge
in my Node bin directory and that didn't work, but when I granted bluetooth permissions to node
that did finally work.
FWIW, I did follow https://github.com/abandonware/noble#installation and it does mention giving Bluetooth permissions to Terminal, but that doesn't seem to be sufficient. Maybe that's what allows homebridge
to work correctly when started manually from the terminal, but hb-service seems to need blanket permissions for Node for some reason.
Anyway, thanks for the help!
I've got this working now with my Hatch Rest and integrated with HomeKit (this is super awesome, thanks for doing this!) but I've noticed something odd where this plugin doesn't seem to work properly when I start Homebridge via
sudo hb-service start
, but does work when I start it from the command-line by runninghomebridge
. More specifically: when I start HB by runninghomebridge
and watch the logs, I see this plugin startup and configure my cached Rest, then it scans for the device and finds it, then when I try interacting with it via HomeKit (e.g. turn it on) I seeConnecting to <device name>...
andConnected to <device name>
messages in the logs, and the actions work. But when I start HB viasudo hb-service start
, I see the same first couple messages about configuring the cached device, but it never scans for the device, and then when I interact via HomeKit I never see any of those connection log messages, and the actions don't have any effect.Here's a snippet of the logs when I start via
hb-service start
:Here's when I start via
homebridge
, and you can see the additional log messages:For context I'm testing this on a Mac (OS X 11.6 Big Sur), using Homebridge 1.5.0, using
homebridge-hatch-baby-rest@3.3.1
, which I installed usinghomebridge-config-ui-x@4.50.1
.I wasn't sure if this is a problem with this plugin or with
homebridge-config-ui-x
but I figured I'd ask here first in case you've seen or heard of this behavior before. Let me know if there's any diagnostic information I can provide or any debugging steps you'd suggest -- I'm a software engineer so I know my way around a good bug deep dive ;-).