quentinms / homebridge-aranet4

An Homebridge plugin to get data from an Aranet4
Apache License 2.0
36 stars 1 forks source link

Connect Aranet4 in Homebridge. #8

Open tijsmatton opened 2 years ago

tijsmatton commented 2 years ago

Hi, I cannot get my Aranet4 device in Homebridge. I have a Aranet4, Homebrige on Windows PC. De childbrige is runnig, but I do not get my accesorry in Homebrige.

Does it connect true bluetooth?

quentinms commented 2 years ago

Hi @tijsmatton

Yes it connects via Bluetooth. Can you try to pair your Aranet from the Bluetooth settings of your computer?

This repo uses https://github.com/abandonware/noble to handle Bluetooth connections, so maybe try following their Windows instructions to see if it helps: https://github.com/abandonware/noble#windows

I don't have a Windows computer to try, unfortunately.

tijsmatton commented 2 years ago

Hi @quentinms , I will try that. At the first try I'm not abble to connect the Aranet4 with my PC true bluetooth. Not sure if the PC I'm using for Homebridge has a bluetooth connection.

Thx!

tijsmatton commented 2 years ago

Hi @quentinms I tried installing homebridge on a other PC with bluetooth. I paired the Arenet4 device with bluetooth. But I get this error in Homebrige: errored while getting devices:Error: No compatible USB Bluetooth 4.0 device found!

quentinms commented 2 years ago

It looks like the Bluetooth library only works with Bluetooth 4 (Low Energy) devices. See https://github.com/abandonware/noble/issues/78

tijsmatton commented 2 years ago

@quentinms So, do you think it should work if I use a bluetooth USB adapter?

quentinms commented 2 years ago

If it's a Bluetooth 4 adapter, I think so.

hamlynt commented 2 years ago

Confirming Aranet4 will successfully pair on Ubuntu server using bluetoothctl but same error appears in Homebridge. I'm pairing using the internal Bluetooth module on an Intel NUC.

quentinms commented 2 years ago

Can you confirm it's Bluetooth 4? All the specs I've found online for intel NUCs are just saying "Bluetooth: yes" without more info.

hamlynt commented 2 years ago

It's bluetooth 5, according to specs for NUC10i7FNK, and as noted it can pair successfully.

But I haven't worked out how to pass through the bluetooth device to homebridge in docker, so my docker container can't see the paired device. I will post an update once I can work that out.

quentinms commented 2 years ago

Thanks for the extra info.

The Bluetooth 4 requirement is coming from the bluetooth library I'm using (https://github.com/abandonware/noble) and not from the Aranet4 itself (it can happily connect to most other bluetooth versions).

As a sanity check can you try going to https://kasparsd.github.io/sensor-pilot/ and checking if your Aranet4 is detected?

Can you try following the Linux instructions here: https://github.com/abandonware/noble#linux?

After that, if you could try running the scripts/debug_bluetooth.js from this branch https://github.com/quentinms/homebridge-aranet4/pull/10/files (it'll list all the Bluetooth devices it can find, your Aranet4 should hopefully show up) it would help to make sure the issue isn't with homebridge.

It would make sure that outside of docker, things work as expected at least.

hamlynt commented 2 years ago

As a sanity check can you try going to https://kasparsd.github.io/sensor-pilot/ and checking if your Aranet4 is detected?

I'm running docker on Ubuntu server so I don't have a desktop to test this on, but as noted above I can successfully pair and trust the Aranet4 using bluetoothctl. I'm reluctant to tinker with the server too much further.

I may do some testing on a raspberry pi as it's easier to install homebridge directly on device (rather than on docker) and with a direct install it's got a better chance of properly seeing the bluetooth module.

macguyincali commented 1 year ago

I went to the website (on Chrome MacOS) and Aranet4 is not detected. Is there something I'm doing wrong? The Aranet app does detect it (on iPhone)

quentinms commented 1 year ago

@macguyincali Have you paired the Aranet with your Mac (in the bluetooth settings)?

bluetooth-screenshot
macguyincali commented 1 year ago

The Aranet device doesn't show up in Bluetooth Settings. Running 2022 Mac Studio. It is visible via iPhone (via the Aranet App). Very odd.