dgreif / homebridge-hatch-baby-rest

A homebridge plugin for Hatch Baby Rest night light
MIT License
74 stars 19 forks source link

Bluetooth rest won't add to homekit #51

Closed Bmkenny closed 2 years ago

Bmkenny commented 3 years ago

Hi,

I've followed the instructions and updated to the newest version of the plugin and my bluetooth rest won't add to homekit. My wifi rest works fine. Can someone please help?

Thanks!

dgreif commented 3 years ago

The Bluetooth Rest won't be detected automatically. You need to go into your config and at it based on MAC address

Bmkenny commented 3 years ago

I know. I have added it there but it’s still not being added and I don’t get any json errors when saving the config. Am I supposed to add it directly to the json file or through the plug in? Any ideas would be greatly appreciated.

Thanks!

dgreif commented 3 years ago

You can add it via homebridge-config-ui-x, which has a nice UI to make sure you have everything structured properly

dgreif commented 3 years ago

@Bmkenny any luck?

Twileyskunk commented 2 years ago

I am having this same issue. Running Homebridge on Windows 10, confirmed I have BTLE, followed instructions exactly. But HB doesn't seem to add it as an accessory? I can't even see it to control it in HB much less HK. What am I missing?

dgreif commented 2 years ago

@Twileyskunk do you have any logs to show what's happening?

Twileyskunk commented 2 years ago

Sure. Looks like there is an error connecting to the API, and it says "address family not supported by protocol"?

dgreif commented 2 years ago

Would you mind posting the full error from the logs?

Twileyskunk commented 2 years ago

HatchBabyRest] Error connecting to API [9/19/2021, 8:17:02 PM] [HatchBabyRest] Error: EAFNOSUPPORT, Address family not supported by protocol at new Hci (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/hci.js:80:18) at new NobleBindings (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:25:15) at module.exports (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/resolve-bindings.js:13:12) at Object. (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/index.js:2:51) at Module._compile (internal/modules/cjs/loader.js:1072:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) at Module.load (internal/modules/cjs/loader.js:937:32) at Function.Module._load (internal/modules/cjs/loader.js:778:12) at Module.require (internal/modules/cjs/loader.js:961:19) at require (internal/modules/cjs/helpers.js:92:18) { errno: 97, code: 'EAFNOSUPPORT', syscall: 'socket'

dgreif commented 2 years ago

What hardware/OS are you using to run homebridge? Does it have a Bluetooth LE adapter? Could you post your config (without your Hatch username/password)?

Twileyskunk commented 2 years ago

Running HB on a Dell machine with Windows 10. Yes it does have BT LE adapter plugged in. My config as follows (with UN/PW removed):

email": " XXXXXX@gmail.com", "password": "XXXXX", "restLights": [ { "name": "Nursery", "macAddress": "CF:49:A4:64:BB:2B" } ], "platform": "HatchBabyRest" }

dgreif commented 2 years ago

I don't see anything out of the ordinary. My guess is the noble package simply doesn't like something with your computer/bluetooth hardware. Unfortunately it's not something I can debug 😞. I think most users use a raspberry pi, so consider setting one of those up as your homebridge server

Homekitdude commented 2 years ago

Mine also doesn’t work. Shows up in HomeKit, but nothing works at all.

dgreif commented 2 years ago

I'm really not doing much maintenance on the bluetooth side of this plugin any longer. For the best experience, I recommend buying one of the newer wifi lights from Hatch. The bluetooth is just too complicated given the hardware requirements, and the fact that bluetooth warries widely between different devices (rpi vs mac vs ...). PRs welcome if anyone finds improvements.